veg / hyphy

HyPhy: Hypothesis testing using Phylogenies
http://www.hyphy.org
Other
200 stars 68 forks source link

hyphy MolecularClockF81.bf failed to compute a valid transition matrix #1706

Closed emollier closed 1 month ago

emollier commented 1 month ago

Hi,

While trying to integrate hyphy 2.5.61 into Debian sid, I ran into the following error while checking the program was in working conditions and able to run examples:

$ hyphy MolecularClockF81.bf

 0).UNCONSTRAINED MODEL:Log Likelihood = -11475.7124480027;
Tree theTree=(HVRNASS:0.02575213075362179,(RICRSS3:0.05627390533450945,((ZMSUCS1:0.07162266979153101,(OSRSS1A:0.06060487365200313,(TASUCSYN1:0.02788108010082381,HVSSYNMR:0.02037111441880681)Internal1:0.0518279749536632)Node9:0.02014621370310849)Node7:0.1581388205189462,(MZESUS1:0.07664980156564326,ORRSS2:0.05437783799018264)Internal2:0.02506152183279519)Node6:0.03255549619638959)Node4:0.05899078943098015,TAAJ153:0.01372476492508802);
Error:
Failed to compute a valid transition matrix; this is usually caused by ill-conditioned rate matrices (e.g. very large rate values)

Function call stack
1 :  Optimize(paramValues, theLnLik);
-------

Check errors.log for execution error details.

Said error.log shows:

Error:Failed to compute a valid transition matrix; this is usually caused by ill-conditioned rate matrices (e.g. very large rate values)
Failed to compute a valid transition matrix; this is usually caused by ill-conditioned rate matrices (e.g. very large rate values)

The crash does not appear with hyphy 2.5.60, and MolecularClockF81.bf example file does not appear to have changed. Am I trying to execute hyphy against a particularly pathological file, in which case I may safely ignore the error with MolecularClockF81.bf? Or is it possible the test uncovered an issue in changes affecting the matrix processing code?

Have a nice day, :) Étienne.

PS: for the avoidance of doubt, the tested file is Examples/SimpleConstraints/MolecularClockF81.bf from hyphy source code.

spond commented 1 month ago

Dear @emollier,

Great catch. I usually don't check these very old files during CI tests, but maybe I should! I have indeed made some tweaks to the optimization code (something to do with gradient re-normalization) in 2.5.61 and that's what triggered the error. I am going to revert this change, and push a few more changes for 2.5.62. I'll go ahead and release it tomorrow (or possibly today).

Thanks for your helpful and timely bug report.

Best, Sergei

emollier commented 1 month ago

Hi Serguei,

I pulled hyphy 2.5.62 and verified the issue is resolved. Thank you!

Have a nice day, :) Étienne.