JiscaH / sequoia

R package for pedigree inference based on SNP data
25 stars 6 forks source link

sequoia error can't find ErrM #8

Closed sinnweja closed 3 years ago

sinnweja commented 3 years ago

From the example in the vignette, the call to sequoia with MaxSubIter=1, you get an error that it can't find ErrM in the DuplicateCheck function. However, ErrM is an element of ParOUT, so you should make sure to pass ParOUT$ErrM to DuplicateCheck. Here is code that gets the error and shows a work-around.

library(sequoia") data(Ped_HSg5, LH_HSg5) set.seed(1000) Geno <- SimGeno(Ped = Ped_HSg5, nSnp = 200) Geno[1:5,1:5] ParOUT <- sequoia(GenoM = Geno, LifeHistData = LH_HSg5, MaxSibIter = 0) MaxSibIter = 0) names(ParOUT) table(is.na(ParOUT$PedigreePar[,2])) args(sequoia) SeqOUT <- sequoia(GenoM = Geno, SeqList = ParOUT, MaxSibIter = 1) SeqOUT <- sequoia(GenoM = Geno, SeqList = ParOUT, MaxSibIter = 1, Err=1e-4) ErrM <- ParOUT$ErrM SeqOUT <- sequoia(GenoM = Geno, SeqList = ParOUT, MaxSibIter = 1)

JiscaH commented 3 years ago

Apologies for the delay in replying, I had accidentally turned off email notifications!

I've known about this bug in version 2.0.7 for a while, but haven't gotten around yet to submitting a new version to CRAN. If you download the newest version from here, it should work OK.

Alternatively, under version 2.0.7 you can circumvent the bug by not re-using output, i.e. SeqOUT <- sequoia(GenoM = Geno, LifeHistData = LH_HSg5, MaxSibIter = 10)

or fooling it to believe that ParOUT is from an older sequoia version: names(ParOUT$Specs)[match("MaxMismatchOH", names(ParOUT$Specs))] <- "foo"