Skip to content

Commit

Permalink
Update pedmut version requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusdv committed Jul 20, 2023
1 parent 91eef65 commit cd2f437
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Depends:
R (>= 4.1.0)
Imports:
glue,
pedmut,
pedmut (>= 0.6),
pedprobr (>= 0.8),
ribd (>= 1.5.0)
Suggests:
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,3 @@ importFrom(stats,quantile)
importFrom(stats,rbinom)
importFrom(stats,setNames)
importFrom(utils,head)
importFrom(utils,packageVersion)
16 changes: 4 additions & 12 deletions R/readFam.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit cd2f437

Please sign in to comment.