From cd2f437aaf8dd9ff4193a6c4dab8cb75bfbdef1a Mon Sep 17 00:00:00 2001 From: Magnus Dehli Vigeland Date: Thu, 20 Jul 2023 18:40:16 +0200 Subject: [PATCH] Update pedmut version requirement --- DESCRIPTION | 2 +- NAMESPACE | 1 - R/readFam.R | 16 ++++------------ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5f1f64f..8ed1bd3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -33,7 +33,7 @@ Depends: R (>= 4.1.0) Imports: glue, - pedmut, + pedmut (>= 0.6), pedprobr (>= 0.8), ribd (>= 1.5.0) Suggests: diff --git a/NAMESPACE b/NAMESPACE index 1c820e8..bae115e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -70,4 +70,3 @@ importFrom(stats,quantile) importFrom(stats,rbinom) importFrom(stats,setNames) importFrom(utils,head) -importFrom(utils,packageVersion) diff --git a/R/readFam.R b/R/readFam.R index 02d8b9e..20205dc 100644 --- a/R/readFam.R +++ b/R/readFam.R @@ -29,7 +29,6 @@ #' multiple pedigrees, so the output gets another layer in this case. #' #' @importFrom pedmut mutationMatrix -#' @importFrom utils packageVersion #' @export readFam = function(famfile, useDVI = NA, Xchrom = FALSE, prefixAdded = "added_", fallbackModel = c("equal", "proportional"), verbose = TRUE) { @@ -302,17 +301,10 @@ readFam = function(famfile, useDVI = NA, Xchrom = FALSE, prefixAdded = "added_", femaleMutMat = mutationMatrix(model = femaleMod, alleles = als, afreq = frqs, rate = mutrate.fem, rate2 = mutrate2.fem, range = range.fem) - if("step-stationary" %in% c(names(maleMod), names(femaleMod))) { - if(packageVersion("pedmut") > 0.5) { - if(names(maleMod) == "step-stationary") - maleMutMat = pedmut::stabilize(maleMutMat, method = "PM") - if(names(femaleMod) == "step-stationary") - femaleMutMat = pedmut::stabilize(femaleMutMat, method = "PM") - } - else - warning("Please update the `pedmut` package to enable stabilization of mutation models", - immediate. = FALSE, call. = FALSE) - } + if(names(maleMod) == "step-stationary") + maleMutMat = pedmut::stabilize(maleMutMat, method = "PM") + if(names(femaleMod) == "step-stationary") + femaleMutMat = pedmut::stabilize(femaleMutMat, method = "PM") # Print locus summary if(verbose) {