wutron / dlcpar

Modeling gene duplication, loss, and coalescence (through parsimony)
GNU General Public License v3.0
7 stars 5 forks source link

Assertion Error #8

Closed lhui2010 closed 1 year ago

lhui2010 commented 1 year ago

Hi,

I met an error when executing dlcpar dp on a rooted RAxML tree. It would be grateful if you can provide me any hints to this problem. Thanks!

Hui

Command I use:

timeout 300 dlcpar dp -s dlcpar.sptree -S dlcpar.txt.smap combine.clean.tre.root --output_format 3t  -D 2 -L 1 -C 0.5  2>stderr.txt > stdout.txt

$more stdout.txt

Found
Found
...

$more stderr.txt

Traceback (most recent call last):
  File "/nfs/liuhui/.conda/envs/dlcpar/bin/dlcpar", line 94, in <module>
    sys.exit(main())
  File "/nfs/liuhui/.conda/envs/dlcpar/bin/dlcpar", line 91, in main
    mod.run()
  File "/nfs/liuhui/.conda/envs/dlcpar/lib/python2.7/site-packages/dlcpar/commands/dp.py", line 280, in run
    log=out_log)
  File "/nfs/liuhui/.conda/envs/dlcpar/lib/python2.7/site-packages/dlcpar/recondp.py", line 61, in dlc_recon
    return reconer.recon()
  File "/nfs/liuhui/.conda/envs/dlcpar/lib/python2.7/site-packages/dlcpar/recondp.py", line 163, in recon
    self._infer_locus_map()
  File "/nfs/liuhui/.conda/envs/dlcpar/lib/python2.7/site-packages/dlcpar/recondp.py", line 225, in _infer_locus_map
    self._infer_opt_locus_map(locus_maps, subtrees)
  File "/nfs/liuhui/.conda/envs/dlcpar/lib/python2.7/site-packages/dlcpar/recondp.py", line 1177, in _infer_opt_locus_map
    dp_table = self._dp_compute(locus_maps)
  File "/nfs/liuhui/.conda/envs/dlcpar/lib/python2.7/site-packages/dlcpar/recondp.py", line 1414, in _dp_compute
    assert mincost != INF, (top_loci, lst)
AssertionError: ((1, 2, 3, 4, 5, 6), [((1, 2, 3, 4, 5, 6), inf, 0)])
wutron commented 1 year ago

Hi @lhui2010,

Can you run with --log and share the .log.gz file here so I can dig deeper? And/or can you share your input files here?

Thanks

lhui2010 commented 1 year ago

Hi @wutron ,

I managed to use dlcpar search if such error persists, and so far it works. I'll let you know, with detailed logs, if I met further problems.

Thanks! Hui

wutron commented 1 year ago

If you use dlcpar search, be sure to increase the search space. The defaults are probably too low unless your trees are small. Unfortunately, I do not have good heuristics for how to set these numbers, but as a start, you can try using the defaults from OrthoFinder.

lhui2010 commented 1 year ago

OK! Thanks for pointing it out, I will have a check on the code you pointed out!

lhui2010 commented 11 months ago

Hi @wutron,

I wonder if Optimal Cost given in dlcpar search is comparable among different runs. Because I found that heuristic method is largely affected by the seed given and sometimes increasing iterations will not get better.

I'm thinking of running dlcpar search seperately, like for ten times independently with different seeds, and select the best reconciliation with lowest Optimal Cost. Maybe it can complement the shortcoming of heuristic approach? Do you think it's reasonable?

Thanks! Hui

wutron commented 11 months ago

Yes, as long as you pass the same event costs as parameters, the costs are comparable across multiple runs. Rerunning with multiple seeds is a good approach - if I want to be more exhaustive, I will run RAxML and dlcpar multiple times and ultimately pick the tree and reconciliation with the minimum cost.

lhui2010 commented 11 months ago

Hi,

Thanks for this information!

Hui