dcgerard / updog

Flexible Genotyping of Polyploids using Next Generation Sequencing Data
https://dcgerard.github.io/updog/
24 stars 8 forks source link

ERROR: "non-finite value supplied by optim" #24

Closed knagasaka closed 1 year ago

knagasaka commented 1 year ago

I ran multidog and got the following error. I have no idea how to solve this problem. Could you please help me?

Error Description

Working on it...Loading required package: foreach Loading required package: future Loading required package: rngtools Error in { : task 37080 failed - "non-finite value supplied by optim"

Software :

dcgerard commented 1 year ago

Hey @knagasaka, thanks for trying out {updog}!

It seems that multidog() does not like the 37080th SNP. Could you extract that SNP's reference and total counts, verify that this is the problematic SNP, and send me that data? Could you also give me the code that you used to run on that SNP? I'll take a look.

Best, David

knagasaka commented 1 year ago

Thanks for the reply! I see, it is really convenient that multidog tells us the SNP that could be problematic. I'll send you the txt files by email later! Thank you, Kyoka

dcgerard commented 1 year ago

The issue data were

refvec <- c(1121, 1927, 806)
sizevec <- c(2183, 3831, 1648)
fout <- flexdog(refvec = refvec, sizevec = sizevec, ploidy = 4, model = "norm")

The issue turned out to be from the update of the parameters of the proportional normal model during the m-step of the EM algorithm. Bounding the variance during this optimation fixes the issue. Fixed in 7903747cd3eb894d68a73ba37a0dce7a29f77902 .