-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
30,397 additions
and
13,326 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: polyBreedR | ||
Title: Genomics-assisted breeding for polyploids (and diploids) | ||
Version: 0.36 | ||
Version: 0.37 | ||
Author: Jeffrey B. Endelman | ||
Maintainer: Jeffrey Endelman <[email protected]> | ||
Description: Genomics-assisted breeding for polyploids (and diploids) | ||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(ADsplit) | ||
export(A_mat) | ||
export(GT2DS) | ||
export(G_mat) | ||
|
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,39 @@ | ||
#' Extract read counts from AD string | ||
#' | ||
#' Extract read counts from AD string | ||
#' | ||
#' @param AD array of AD strings | ||
#' @param ALT TRUE or FALSE (= REF) | ||
#' @param n.core number of cores | ||
#' | ||
#' @return integer data with same dimensions as AD | ||
#' @export | ||
#' @importFrom parallel makeCluster stopCluster parApply clusterExport | ||
|
||
ADsplit <- function(AD, ALT, n.core=1) { | ||
|
||
stopifnot(inherits(ALT,"logical")) | ||
|
||
f <- function(AD,k) { | ||
x <- strsplit(AD,split=",",fixed=T) | ||
as.integer(sapply(x,"[[",k)) | ||
} | ||
|
||
k <- as.integer(ALT)+1 | ||
|
||
if (inherits(AD,"matrix")) { | ||
if (n.core > 1) { | ||
cl <- makeCluster(n.core) | ||
clusterExport(cl=cl,varlist=NULL) | ||
out <- parApply(cl=cl,X=AD,MARGIN=2,FUN=f,k=k) | ||
stopCluster(cl) | ||
} else { | ||
out <- apply(AD,2,f,k=k) | ||
} | ||
dimnames(out) <- dimnames(AD) | ||
} else { | ||
out <- f(AD,k) | ||
names(out) <- names(AD) | ||
} | ||
return(out) | ||
} |
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
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
Binary file not shown.
Oops, something went wrong.