hybridLambda / hybrid-Lambda

Hybrid-Lambda is a software package that can simulate gene trees within a rooted species network or a rooted species tree under the Kingman's coalescent or Lambda coalescent process.
http://hybridlambda.github.io/
GNU General Public License v3.0
6 stars 4 forks source link

segmentation fault with hybrid ladder #44

Open laufran opened 2 years ago

laufran commented 2 years ago

Hi there, when running Hybrid-Lambda through Julia package QuartetNetworkGoodnessFit (cc: @cecileane) the command

/Users/laurenfrankel/.julia/packages/QuartetNetworkGoodnessFit/NhwsJ/deps/usr/bin/hybrid-Lambda -spcu "'((t3:1.123916174,((t4:0.4459935601,((t13:0.02953586373,t7:0.02953586373)I1:0.2529580411,t6:0.2824939049)I2:0.1634996552)I3:0.6268849558,(((t10:0.2528263692,((t5:0.02957738207)H26#0.5164631303:0.2232489871)H24#0.9067618483:0.0)I4:0.1281591885,(((t1:0.02957738207,H26#0.5164631303:0.0)I5:0.2232489871,H24#0.9067618483:0.0)I6:0.1281591885)H20#0.662992664:0.0)I7:0.07706148448,(t12:0.3809855577,H20#0.662992664:0.0)I8:0.07706148448)I9:0.6148314737)I10:0.05103765815)I11:1.604201279,t8:2.728117453)I12;'" -num 100 -seed 6724

results in Segmentation fault: 11.

Visualizing this network, you can see it is a hybrid ladder. Perhaps this is causing the seg fault?

Screen Shot 2022-03-27 at 7 09 47 PM
fogg-uw commented 2 years ago

I might've had a similar problem.

My input was:

./hybrid-Lambda -spcu "'(((((t3:0.2637610952,t2:0.2637610952)I1:1.0912968362,(t5:0.2662054335)#H22:1.0888524979)I2:0.2211237452,((#H22:0.1800944633)#H15:1.017267664)#H14:0.1126141157)I3:0.08142212706,#H14:0.1940362428)I4:0.2476537071,(t4:0.4462998968,#H15:0.0)I5:1.458957614)I6;'" -num 6400 -seed 1619 -o gt

My output was:

Segmentation fault (core dumped)

Here's a picture of the network:

Screenshot from 2022-06-08 16-25-17

We can see that there's a hybrid ladder here, too.

cecileane commented 2 years ago

I get the same error on the network above, after switching the # and the hybrid node names, e.g. after editing the network string to change #H22 to H22# (for example). I am using hybrid-Lambda v0.6.3-beta.

cecileane commented 2 years ago

I noticed that this network was missing gamma values. After setting them all to 0.5 (and simplifying edge lengths), the process still fails:

hybrid-Lambda -spcu '(((((t3:0.1,t2:0.1)I1:0.1,(t5:0.1)H22#0.5:0.1)I2:0.1,((H22#0.5:0.1)H15#0.5:0.1)H14#0.5:0.1)I3:0.1,H14#0.5:0.1)I4:0.1,(t4:0.1,H15#0.5:0.1)I5:0.1)I6;' -num 3 -seed 2 -o example
zsh: segmentation fault   -spcu  -num 3 -seed 2 -o example1
gaballench commented 2 years ago

Hello everyone, we had recently an issue with segfaults and @shajoezhu suggested that the latest version of hybrid-Lambda might be causing them (see #42). I have run the command you used and it's fine using v0.6.2:

$ hybrid-Lambdav0.6.2 -spcu "'((t3:1.123916174,((t4:0.4459935601,((t13:0.02953586373,t7:0.02953586373)I1:0.2529580411,t6:0.2824939049)I2:0.1634996552)I3:0.6268849558,(((t10:0.2528263692,((t5:0.02957738207)H26#0.5164631303:0.2232489871)H24#0.9067618483:0.0)I4:0.1281591885,(((t1:0.02957738207,H26#0.5164631303:0.0)I5:0.2232489871,H24#0.9067618483:0.0)I6:0.1281591885)H20#0.662992664:0.0)I7:0.07706148448,(t12:0.3809855577,H20#0.662992664:0.0)I8:0.07706148448)I9:0.6148314737)I10:0.05103765815)I11:1.604201279,t8:2.728117453)I12;'" -num 100 -seed 6724
Default Kingman coalescent on all branches.
Default population size of 10000 on all branches. 
Random seed: 6724
Produced gene tree files: 
OUT_coal_unit

I can confirm that it fails using v0.6.3:

$ hybrid-Lambdav0.6.3 -spcu "'((t3:1.123916174,((t4:0.4459935601,((t13:0.02953586373,t7:0.02953586373)I1:0.2529580411,t6:0.2824939049)I2:0.1634996552)I3:0.6268849558,(((t10:0.2528263692,((t5:0.02957738207)H26#0.5164631303:0.2232489871)H24#0.9067618483:0.0)I4:0.1281591885,(((t1:0.02957738207,H26#0.5164631303:0.0)I5:0.2232489871,H24#0.9067618483:0.0)I6:0.1281591885)H20#0.662992664:0.0)I7:0.07706148448,(t12:0.3809855577,H20#0.662992664:0.0)I8:0.07706148448)I9:0.6148314737)I10:0.05103765815)I11:1.604201279,t8:2.728117453)I12;'" -num 100 -seed 6724
Segmentation fault (core dumped)
cecileane commented 2 years ago

Thanks! v0.6.3 fixes an important (but silent) bug (see #38 and #36), so going back to v0.6.2 may mean trading an error that's explicit (and detected, so we can go avoid those networks) with a potential undetected error.