-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Converts cross2 object from crosstype "do" to crosstype "genail8"
- Loading branch information
Showing
5 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# cross2_do_to_genail8() | ||
#' Convert cross2 object from do to genail8 | ||
#' | ||
#' Convert a cross2 object from cross type `"do"` to cross type `"genail8"`. | ||
#' | ||
#' @param cross Object of class `"cross2"`, as produced by | ||
#' [qtl2::read_cross2()]. | ||
#' | ||
#' @return The input object `cross` with cross type changed to | ||
#' class `"genail8"` and the cross information revised to match. | ||
#' | ||
#' @export | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' file <- paste0("https://raw.githubusercontent.com/rqtl/", | ||
#' "qtl2data/master/DOex/DOex.zip") | ||
#' DOex <- read_cross2(file) | ||
#' | ||
#' DOex_genail <- cross2_do_to_genail(DOex) | ||
#' } | ||
|
||
cross2_do_to_genail8 <- | ||
function(cross) | ||
{ | ||
|
||
# check that it's cross2 | ||
if(!inherits(cross, "cross2")) stop('Input cross must have class "cross2"') | ||
|
||
# check that it's DO | ||
if(!cross$crosstype == "do") stop('input cross is not of type "do"') | ||
|
||
# crosstype -> genail8 | ||
cross$crosstype <- "genail8" | ||
|
||
# revise cross_info -> | ||
cross$cross_info <- cbind(cross$cross_info+5L, | ||
A=1L, B=1L, C=1L, D=1L, E=1L, F=1L, G=1L, H=1L) | ||
|
||
cross | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.