Error on SNaQ - parallel edges

59 views
Skip to first unread message

Matheus Salles

unread,
Feb 6, 2024, 6:00:56 PMFeb 6
to PhyloNetworks users
Dear all,

I'm getting the following error, when trying to run SNaQ on my server:

'Warning: ERROR found on SNaQ for run 1 seed 1234: ErrorException("cycle with only 2 nodes: parallel edges")'

I'm parallelizing my runs through the Distributed application, and this is happening with all runs, after some time of analysis. Decreasing the number of runs (from 10 to 5) did not solved my problem.

This is my script:
nruns = 5
using Distributed
addprocs(5)
@everywhere using PhyloNetworks
astralfile = joinpath("/home/dzoo/julia-phylonet-tropidurus/bestnet_h1.tre");
net1 = readTopology(astralfile)
using DataFrames, CSV
tropidurusCF = readTableCF("/home/dzoo/julia-phylonet-tropidurus/tableCF_genetrees_internaltrim_30daset_tropidurus.csv")
net2 = snaq!(net1, tropidurusCF, hmax=2, filename="net2_trops", seed=1234, runs=nruns)

Thanks a lot!

Best regards,
Matheus.

Cécile Ané

unread,
Feb 6, 2024, 9:19:23 PMFeb 6
to PhyloNetworks users
Hi Matheus,
If you get this with all runs, my first guess is that it's something about your starting network. If you are willing to share it with me "offline", I'd be happy to check if this starting network might be the reason (perhaps after it's considered as unrooted), and if so, I'm sure there's an easy fix.
Cecile.

Matheus Salles

unread,
Feb 7, 2024, 9:47:56 AMFeb 7
to PhyloNetworks users
Thanks a lot!

I'll send you the files on private.

Cécile Ané

unread,
Feb 10, 2024, 10:36:10 PMFeb 10
to PhyloNetworks users
Your starting network is just fine. I was able to reproduce the error, and it seems to affect just the first run, given the seed that you used. That's why changing the number of runs didn't eliminate the error, using the same seed each time. The other runs are fine, so you can use the results at the end -- just with 1 fewer run than what you had asked for.

Alternatively, you can also change the seed to get rid of the error during the first run. I suggest that you always use a different seed, in fact! (just save it for reproducibility). With a different seed, you may avoid errors altogether, or the same error may creep in again in a different run (without affecting other runs). I don't know how frequently these cycles of 2 parallel edges are being proposed without being rejected (and then cause an error), so I don't have a good estimate of the proportion of runs that will be affected.

But I will look into fixing this bug. In the meantime, you should be able to run SNaQ: hopefully the explanations above make sense.
Thank you so much for reporting this.
Cecile.

On Wednesday, February 7, 2024 at 8:47:56 AM UTC-6 matheusmac... wrote:
...
I'm getting the following error, when trying to run SNaQ on my server:

'Warning: ERROR found on SNaQ for run 1 seed 1234: ErrorException("cycle with only 2 nodes: parallel edges")'

...
Reply all
Reply to author
Forward
0 new messages