miriammiyagi / QuIBL

Quantifying Introgression via Branch Lengths
49 stars 7 forks source link

ValueError: math domain error #18

Open matthewglasenapp opened 2 years ago

matthewglasenapp commented 2 years ago

Hello,

When running QuIBL, I encounter a "ValueError: math domain error" after the program runs for quite some time. I've tried two different data set sizes (16801 trees, 7645 trees). I've also varied the numsteps parameter from 50 - 200. The gene trees were reconstructed with iqtree using the following command: iqtree2 -S <directory_of_fasta_alignments>

I made sure that I did not include trees with 0-length branches. I'm running the program on an Intel 24 core node with 128 GB memory capacity. Any tips would be greatly appreciated.

Best, Matt

error_log.txt trees2.txt InputFile.txt

stubbsrl commented 2 years ago

Hello,

Has there been on progress on this? I looked through the closed and open issues and the "math domain error" is quite common and problematic. I split my 3000+ trees with 19 tips into two groups and I was able to run them successfully. So, I am sure it isn't an issue with a single tree. Also, I have also had the error for running out of memory, so I know I have the resources properly allocated (and I ran quibl successfully with 5000+ trees on these same resources at one point).

@matthewglasenapp can I ask why you varied the numstep parameter and what if any affect that had? Did you try splitting your trees into two groups?

Any help is appreciated!

Thanks, Rebecca

laufran commented 2 years ago

I just wanted to bump this error as I've been having it as well. I'm running QuIBL on 1000 gene trees with 10 tips generated from Seq-Gen. I've confirmed that there are no zero-length edges on all the gene trees. I've attached my gene trees file, the QuIBL command file, and the exact error message I get after a variable amounts of triplets have already been successfully analyzed. I've tried this for a variety of independent gene tree files and this happens for nearly all of them.

gts.txt quibl.txt error.txt

jihoonjo commented 1 year ago

Hello, I also met the math domain error, It seems an error from during the log transformation of the '0' value. So I manually fixed it with a minor correction of the 'Quibl.py' python script. And, it worked well.

The fixed line is line 139 in 'QuIBL.py', like below.

before: L+=log(temp)

after (you have to appropriately align the tab or space): if temp != 0: L+=log(temp)

I hope it will be helpful to your research.

I attached the fixed code. QuIBL.py.txt

cecileane commented 1 year ago

but log(0)= - infinity so is it appropriate to pretend as if log(temp) = 0 when temp is 0? I understand this fix avoids the technical error, which is great. I wonder if it introduces a mathematical error in the calculation of the criterion.

Dived-Jin commented 1 year ago

Hello, I also met the same problem when I randomly selected 500 1-Kb trees constructed by iqtree2. I also confirmed that don't have a branch length with zero in my data sets. But most replicates end with the same error at QuIBL.py line 139 (log(temp)). So has anyone solved this problem?

juanenciso14 commented 10 months ago

If you guys still have this problem, maybe you could try what I did. After facing this problem with the original script that is in the main folder, I managed to consistently run batches of 500 trees with 43 tips each, using the Cython version and maxcores:2. I'm not sure which of the two did the trick but this way I managed to overcome this error.

xiaolongtu commented 3 months ago

hello, i also meet this, have anyone solve this probelm ?

juanenciso14 commented 3 months ago

hello, i also meet this, have anyone solve this probelm ?

Hey @xiaolongtu! Check my comment above, it may work for you as well.

xiaolongtu commented 3 months ago

@juanenciso14 , thank you , I hvae try it but still has wrong