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) {