davidemms / OrthoFinder

Phylogenetic orthology inference for comparative genomics
https://davidemms.github.io/
GNU General Public License v3.0
677 stars 186 forks source link

I ran into this error during gene tree / species tree construction #61

Closed Huanle closed 6 years ago

Huanle commented 7 years ago

I ran into this error during the tree construction stage. I guess It might be an issue due to too many species included in the analysis given that I did not have this issue with analyses including 5-10 species.

of.e611854.txt

[mcl] cut <6> instances of overlap Traceback (most recent call last): File "/home/h.liu/h.liu/Bin/OrthoFinder-1.1.4/dlcpar-1.0/bin/dlcpar_search", line 209, in sys.exit(main()) File "/home/h.liu/h.liu/Bin/OrthoFinder-1.1.4/dlcpar-1.0/bin/dlcpar_search", line 179, in main log=log_out) File "/home/h.liu/h.liu/Bin/OrthoFinder-1.1.4/dlcpar-1.0/python/dlcpar/simplerecon.py", line 39, in dlc_recon return reconer.recon(nsearch).get_dict() File "/home/h.liu/h.liu/Bin/OrthoFinder-1.1.4/dlcpar-1.0/python/dlcpar/simplerecon.py", line 97, in recon proposal = self.proposer.next_proposal() File "/home/h.liu/h.liu/Bin/OrthoFinder-1.1.4/dlcpar-1.0/python/dlcpar/simplerecon.py", line 247, in next_proposal newCopy=False) File "/shares/common/users/h.liu/Bin/OrthoFinder-1.1.4/dlcpar-1.0/python/dlcpar/deps/compbio/phylo.py", line 707, in recon_root walk(child) File "/shares/common/users/h.liu/Bin/OrthoFinder-1.1.4/dlcpar-1.0/python/dlcpar/deps/compbio/phylo.py", line 704, in walk node.recurse(walk) File "/shares/common/users/h.liu/Bin/OrthoFinder-1.1.4/dlcpar-1.0/python/dlcpar/deps/rasmus/treelib.py", line 83, in recurse func(child, *args) File "/shares/common/users/h.liu/Bin/OrthoFinder-1.1.4/dlcpar-1.0/python/dlcpar/deps/compbio/phylo.py", line 704, in walk node.recurse(walk) ..... File "/shares/common/users/h.liu/Bin/OrthoFinder-1.1.4/dlcpar-1.0/python/dlcpar/deps/compbio/phylo.py", line 703, in walk if not node.is_leaf(): RuntimeError: maximum recursion depth exceeded

Will you please help me figure out what could have caused this issue? Thanks a lot.

davidemms commented 7 years ago

Hi

I've seen this issue before, it's a problem in dlcpar when reading or processing the tree. I will report it to the owner of dlcpar and see if it can be fixed. In the meantime I think you should be able to fix it on your machine though:

A previous user who reported this was able to fix it by editing the dlcpar_search file (for me the file is here: "/usr/local/bin/dlcpar_search"). They added the line "sys.setrecursionlimit(1000000)" as shown in this screenshot: image

Let me know if you have any problems with this.

All the best David

davidemms commented 6 years ago

Hi

OrthoFinder now implements its own method for the reconciliation which is more accurate and many times faster and doesn't have these memory/recursion depth issues. You can try it in the latest version.

All the best David

TaehyungKwon commented 3 years ago

Hi David,

I'm using conda version of Orthofinder v2.4.0, but I still face the same problem. It appears to be a tree reconstruction problem, but with different messages. I had no problem with ~30 species, but this run includes 218 genomes. I am trying to fix this with the solution you've posted above, by adding "sys.setrecursionlimit(1000000)" in /home/tkwon/miniconda3/envs/busco/bin/scripts_of/tree.py. However, I am not sure if this "ch.get_cached_content(store_attr=store_attr, _store=_store)" recursion is okay to ignore. Could you kindly help me to solve this issue?

Traceback (most recent call last): File "/home/tkwon/miniconda3/envs/busco/bin/orthofinder", line 7, in main(args) File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/main.py", line 1733, in main GetOrthologues(speciesInfoObj, options, prog_caller) File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/main.py", line 1513, in GetOrthologues options.name) File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/orthologues.py", line 1055, in OrthologuesW orkflow ReconciliationAndOrthologues(recon_method, db.ogSet, nHighParallel, i if qMultiple else None, all_stride_dup_ge nes=all_stride_dup_genes) File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/orthologues.py", line 851, in Reconciliatio nAndOrthologues nOrthologues_SpPair = trees2ologs_of.DoOrthologuesForOrthoFinder(ogSet, species_tree_rooted_labelled, trees2olo gs_of.GeneToSpecies_dash, all_stride_dup_genes, qNoRecon, hog_writer) File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/trees2ologs_of.py", line 819, in DoOrtholog uesForOrthoFinder orthologues, recon_tree, suspect_genes = GetOrthologues_from_tree(iog, rooted_tree_ids, species_tree_rooted_lab elled, GeneToSpecies, neighbours, dupsWriter=dupWriter, seqIDs=spec_seq_dict, spIDs=ogSet.SpeciesDict(), all_stride _dup_genes=all_stride_dup_genes, qNoRecon=qNoRecon) File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/trees2ologs_of.py", line 524, in GetOrtholo gues_from_tree if not qNoRecon: tree = Resolve(tree, GeneToSpecies) File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/trees2ologs_of.py", line 676, in Resolve tree = resolve.resolve(n, GeneToSpecies) File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/resolve.py", line 193, in resolve if check_monophyly(n, sis[0]) and check_monophyly(n, sis[1]): File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/resolve.py", line 158, in check_monophyly return node.check_monophyly(target_attr='name', values=taxa)[0] File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/tree.py", line 1671, in check_monophyly n2leaves = self.get_cached_content() File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/tree.py", line 1524, in get_cached_content ch.get_cached_content(store_attr=store_attr, _store=_store) File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/tree.py", line 1524, in get_cached_content ch.get_cached_content(store_attr=store_attr, _store=_store) File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/tree.py", line 1524, in get_cached_content ch.get_cached_content(store_attr=store_attr, _store=_store) [Previous line repeated 984 more times] File "/home/tkwon/miniconda3/envs/busco/bin/scripts_of/tree.py", line 1523, in get_cached_content for ch in self.children: RecursionError: maximum recursion depth exceeded

Thanks, Taehyung