morrislab/pairtree

FloatingPointError: invalid value encountered in true_divide

Closed this issue · 0 comments

example_data.zip

I've been getting the following error when running Pairtree using default parameters with the attached example data.

File "/hpf/largeprojects/adam/projects/subclonal_pipeline/scripts/pairtree/bin/../lib/phi_fitter_lol.py", line 47, in _fit_etas
    phi_implied = (var_reads / (ref_reads + var_reads)) / omega
FloatingPointError: invalid value encountered in true_divide

This error takes place during the sampling trees stage. I have noticed that this error usually occurs in datasets with a high proportion of mutations that have a "var_read_prob" of 0.

I wanted to confirm if a SNV mutation that exists in a segment with an estimated minor copy number of 0 and a major copy number of 2 should have a var_read_prob value of 0. If so, what is the best way to correct the above error when there are many mutations that have a var_read_prob value of 0 in the input data?