wangke16 / MSMC-IM

A tool for estimating time-dependent migration rates based on cross-/within-population coalescent rates from MSMC
16 stars 2 forks source link

invalid in double_scalars, no 0 or inf #1

Closed stsmall closed 5 years ago

stsmall commented 5 years ago

Hi @wangke16, @stschiff I am running your MSMC-IM on the output of the Cross-Coalescent analysis from MSMC2. I am receiving some warnings but also an issue with missing 0 and inf values. I checked my input files for input into combinCrossCoal.py and all of them contained a 0 and inf, but the output file did not. Is this a problem for MSMC-IM? The warnings are below. I can email files if needed. thanks, @stsmall

Warning! The time segment is not start from 0 or end with infinity. The program will force the time start from 0 and end with infinity now! py36/lib/python3.6/site-packages/scipy/optimize/optimize.py:1850: RuntimeWarning: invalid value encountered in double_scalars tmp2 = (x - v) (fx - fw) py36/lib/python3.6/site-packages/scipy/optimize/optimize.py:2189: RuntimeWarning: invalid value encountered in double_scalars w = xb - ((xb - xc) tmp2 - (xb - xa) * tmp1) / denom ##############################################################################

wangke16 commented 5 years ago

Hi @stsmall It's not a problem for MSMC-IM. The warning message of double_scalars comes from scipy.optimize function, which essentially means numerical problems like division by zero in the auto-optimisation process. I also got this warning quite often. Regarding the time segment warning, maybe you are using an old version of combinCrossCoal.py? Stephan fixed an interpolation issue in the old script a long time ago. Ke

stsmall commented 5 years ago

Hi Ke, Thanks. I was running an older version of combineCrossCoal.py. Updating fixed the error/warning. thanks, @stsmall