diff --git a/NEWS.md b/NEWS.md index 43d5dd3..5b4fd8f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# BGmisc 1.3.2.1 +* Added ability to pass additional arguments to the ped2FOO functions + # BGmisc 1.3.2 * Added some more tests of identifyModel.R * Modified tests to be MKL friendly diff --git a/R/buildPedigree.R b/R/buildPedigree.R index 5139730..bba0250 100644 --- a/R/buildPedigree.R +++ b/R/buildPedigree.R @@ -9,6 +9,7 @@ #' @param momID character. Name of the column in ped for the mother ID variable #' @param dadID character. Name of the column in ped for the father ID variable #' @param famID character. Name of the column to be created in ped for the family ID variable +#' @param ... additional arguments to be passed to \code{\link{ped2com}} #' @details #' The general idea of this function is to use person ID, mother ID, and father ID to #' create an extended family ID such that everyone with the same family ID is in the @@ -25,14 +26,17 @@ #' #' @export #' -ped2fam <- function(ped, personID = "ID", momID = "momID", dadID = "dadID", famID = "famID") { +ped2fam <- function(ped, personID = "ID", + momID = "momID", dadID = "dadID", famID = "famID", + ...) { # Call to wrapper function .ped2id(ped = ped, personID = personID, momID = momID, dadID = dadID, famID = famID, type = "parents") } .ped2id <- function(ped, personID = "ID", momID = "momID", dadID = "dadID", - famID = "famID", type) { + famID = "famID", type, + ...) { # Turn pedigree into family pg <- ped2graph(ped = ped, personID = personID, momID = momID, dadID = dadID, adjacent = type) @@ -79,7 +83,8 @@ ped2graph <- function(ped, momID = "momID", dadID = "dadID", directed = TRUE, - adjacent = c("parents", "mothers", "fathers")) { + adjacent = c("parents", "mothers", "fathers"), + ...) { # Check ped/data.fram if (!inherits(ped, "data.frame")) stop("ped should be a data.frame or inherit to a data.frame") # Handle adjacent argument @@ -171,7 +176,8 @@ ped2graph <- function(ped, #' for creating paternal line IDs #' @export #' -ped2maternal <- function(ped, personID = "ID", momID = "momID", dadID = "dadID", matID = "matID") { +ped2maternal <- function(ped, personID = "ID", + momID = "momID", dadID = "dadID", matID = "matID",...) { # Call to wrapper function .ped2id(ped = ped, personID = personID, momID = momID, dadID = dadID, famID = matID, type = "mothers") } @@ -189,7 +195,9 @@ ped2maternal <- function(ped, personID = "ID", momID = "momID", dadID = "dadID", #' for creating maternal line IDs #' @export #' -ped2paternal <- function(ped, personID = "ID", momID = "momID", dadID = "dadID", patID = "patID") { +ped2paternal <- function(ped, personID = "ID", + momID = "momID", dadID = "dadID", + patID = "patID",...) { # Call to wrapper function .ped2id(ped = ped, personID = personID, momID = momID, dadID = dadID, famID = patID, type = "fathers") } diff --git a/R/convertPedigree.R b/R/convertPedigree.R index 4f5e204..4dc6f4d 100644 --- a/R/convertPedigree.R +++ b/R/convertPedigree.R @@ -204,8 +204,11 @@ ped2com <- function(ped, component, #' @inherit ped2com details #' @export #' -ped2add <- function(ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, - tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE) { +ped2add <- function(ped, max.gen = 25, sparse = FALSE, verbose = FALSE, + gc = FALSE, + flatten.diag = FALSE, standardize.colnames = TRUE, + tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE, + ...) { ped2com( ped = ped, max.gen = max.gen, @@ -226,7 +229,13 @@ ped2add <- function(ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FAL #' @export #' @aliases ped2mt #' -ped2mit <- ped2mt <- function(ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE) { +ped2mit <- ped2mt <- function(ped, max.gen = 25, + sparse = FALSE, + verbose = FALSE, gc = FALSE, + flatten.diag = FALSE, + standardize.colnames = TRUE, + tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE, + ...) { ped2com( ped = ped, max.gen = max.gen, @@ -246,7 +255,11 @@ ped2mit <- ped2mt <- function(ped, max.gen = 25, sparse = FALSE, verbose = FALSE #' @inherit ped2com details #' @export #' -ped2cn <- function(ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALSE, flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE) { +ped2cn <- function(ped, max.gen = 25, sparse = FALSE, verbose = FALSE, + gc = FALSE, flatten.diag = FALSE, + standardize.colnames = TRUE, + tcross.alt.crossprod = FALSE, tcross.alt.star = FALSE, + ...) { ped2com( ped = ped, max.gen = max.gen, @@ -266,6 +279,7 @@ ped2cn <- function(ped, max.gen = 25, sparse = FALSE, verbose = FALSE, gc = FALS #' @inherit ped2com details #' @export #' -ped2ce <- function(ped) { +ped2ce <- function(ped, + ...) { matrix(1, nrow = nrow(ped), ncol = nrow(ped), dimnames = list(ped$ID, ped$ID)) } diff --git a/man/ped2add.Rd b/man/ped2add.Rd index 7cc056c..075faf6 100644 --- a/man/ped2add.Rd +++ b/man/ped2add.Rd @@ -13,7 +13,8 @@ ped2add( flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, - tcross.alt.star = FALSE + tcross.alt.star = FALSE, + ... ) } \arguments{ @@ -36,6 +37,8 @@ ped2add( \item{tcross.alt.crossprod}{logical. If TRUE, use alternative method of using Crossprod function for computing the transpose} \item{tcross.alt.star}{logical. If TRUE, use alternative method of using \%\*\% for computing the transpose} + +\item{...}{additional arguments to be passed to \code{\link{ped2com}}} } \description{ Take a pedigree and turn it into an additive genetics relatedness matrix diff --git a/man/ped2ce.Rd b/man/ped2ce.Rd index f4c1efa..b4e3db1 100644 --- a/man/ped2ce.Rd +++ b/man/ped2ce.Rd @@ -4,10 +4,12 @@ \alias{ped2ce} \title{Take a pedigree and turn it into an extended environmental relatedness matrix} \usage{ -ped2ce(ped) +ped2ce(ped, ...) } \arguments{ \item{ped}{a pedigree dataset. Needs ID, momID, and dadID columns} + +\item{...}{additional arguments to be passed to \code{\link{ped2com}}} } \description{ Take a pedigree and turn it into an extended environmental relatedness matrix diff --git a/man/ped2cn.Rd b/man/ped2cn.Rd index b31a164..b14ba30 100644 --- a/man/ped2cn.Rd +++ b/man/ped2cn.Rd @@ -13,7 +13,8 @@ ped2cn( flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, - tcross.alt.star = FALSE + tcross.alt.star = FALSE, + ... ) } \arguments{ @@ -36,6 +37,8 @@ ped2cn( \item{tcross.alt.crossprod}{logical. If TRUE, use alternative method of using Crossprod function for computing the transpose} \item{tcross.alt.star}{logical. If TRUE, use alternative method of using \%\*\% for computing the transpose} + +\item{...}{additional arguments to be passed to \code{\link{ped2com}}} } \description{ Take a pedigree and turn it into a common nuclear environmental relatedness matrix diff --git a/man/ped2fam.Rd b/man/ped2fam.Rd index 49a7471..4dbc9aa 100644 --- a/man/ped2fam.Rd +++ b/man/ped2fam.Rd @@ -9,7 +9,8 @@ ped2fam( personID = "ID", momID = "momID", dadID = "dadID", - famID = "famID" + famID = "famID", + ... ) } \arguments{ @@ -22,6 +23,8 @@ ped2fam( \item{dadID}{character. Name of the column in ped for the father ID variable} \item{famID}{character. Name of the column to be created in ped for the family ID variable} + +\item{...}{additional arguments to be passed to \code{\link{ped2com}}} } \value{ A pedigree dataset with one additional column for the newly created extended family ID diff --git a/man/ped2graph.Rd b/man/ped2graph.Rd index cf90526..13c191d 100755 --- a/man/ped2graph.Rd +++ b/man/ped2graph.Rd @@ -10,7 +10,8 @@ ped2graph( momID = "momID", dadID = "dadID", directed = TRUE, - adjacent = c("parents", "mothers", "fathers") + adjacent = c("parents", "mothers", "fathers"), + ... ) } \arguments{ @@ -25,6 +26,8 @@ ped2graph( \item{directed}{Logical scalar. Default is TRUE. Indicates whether or not to create a directed graph.} \item{adjacent}{Character. Relationship that defines adjacency in the graph: parents, mothers, or fathers} + +\item{...}{additional arguments to be passed to \code{\link{ped2com}}} } \value{ A graph diff --git a/man/ped2maternal.Rd b/man/ped2maternal.Rd index 3822684..88106fb 100755 --- a/man/ped2maternal.Rd +++ b/man/ped2maternal.Rd @@ -9,7 +9,8 @@ ped2maternal( personID = "ID", momID = "momID", dadID = "dadID", - matID = "matID" + matID = "matID", + ... ) } \arguments{ @@ -22,6 +23,8 @@ ped2maternal( \item{dadID}{character. Name of the column in ped for the father ID variable} \item{matID}{Character. Maternal line ID variable to be created and added to the pedigree} + +\item{...}{additional arguments to be passed to \code{\link{ped2com}}} } \description{ Add a maternal line ID variable to a pedigree diff --git a/man/ped2mit.Rd b/man/ped2mit.Rd index 4f84579..ad4fd49 100644 --- a/man/ped2mit.Rd +++ b/man/ped2mit.Rd @@ -14,7 +14,8 @@ ped2mit( flatten.diag = FALSE, standardize.colnames = TRUE, tcross.alt.crossprod = FALSE, - tcross.alt.star = FALSE + tcross.alt.star = FALSE, + ... ) } \arguments{ @@ -37,6 +38,8 @@ ped2mit( \item{tcross.alt.crossprod}{logical. If TRUE, use alternative method of using Crossprod function for computing the transpose} \item{tcross.alt.star}{logical. If TRUE, use alternative method of using \%\*\% for computing the transpose} + +\item{...}{additional arguments to be passed to \code{\link{ped2com}}} } \description{ Take a pedigree and turn it into a mitochondrial relatedness matrix diff --git a/man/ped2paternal.Rd b/man/ped2paternal.Rd index 719097d..16a9e35 100755 --- a/man/ped2paternal.Rd +++ b/man/ped2paternal.Rd @@ -9,7 +9,8 @@ ped2paternal( personID = "ID", momID = "momID", dadID = "dadID", - patID = "patID" + patID = "patID", + ... ) } \arguments{ @@ -22,6 +23,8 @@ ped2paternal( \item{dadID}{character. Name of the column in ped for the father ID variable} \item{patID}{Character. Paternal line ID variable to be created and added to the pedigree} + +\item{...}{additional arguments to be passed to \code{\link{ped2com}}} } \description{ Add a paternal line ID variable to a pedigree