etetoolkit / ete

Python package for building, comparing, annotating, manipulating and visualising trees. It provides a comprehensive API and a collection of command line tools, including utilities to work with the NCBI taxonomy tree.
http://etetoolkit.org
GNU General Public License v3.0
782 stars 212 forks source link

AttributeError: 'NoneType' object has no attribute 'up' #556

Open rresendepinto opened 3 years ago

rresendepinto commented 3 years ago

When I try to use the run_model function I get the following error.

Traceback (most recent call last):
  File "/home/users/rrpinto/anaconda3/envs/ete3/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/users/rrpinto/anaconda3/envs/ete3/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "ete3_custom_pipeline.py", line 56, in run_model
    tree.run_model(model_name)
  File "/home/users/rrpinto/anaconda3/envs/ete3/lib/python3.8/site-packages/ete3-3.1.2-py3.7.egg/ete3/evol/evoltree.py", line 269, in run_model
    self.link_to_evol_model(os.path.join(fullpath,'out'), model_obj)
  File "/home/users/rrpinto/anaconda3/envs/ete3/lib/python3.8/site-packages/ete3-3.1.2-py3.7.egg/ete3/evol/evoltree.py", line 436, in link_to_evol_model
    model._load(path)
  File "/home/users/rrpinto/anaconda3/envs/ete3/lib/python3.8/site-packages/ete3-3.1.2-py3.7.egg/ete3/evol/model.py", line 163, in _load
    parse_paml(path, self)
  File "/home/users/rrpinto/anaconda3/envs/ete3/lib/python3.8/site-packages/ete3-3.1.2-py3.7.egg/ete3/evol/parser/codemlparser.py", line 253, in parse_paml
    _check_paml_labels (model._tree, labels, pamout, model)
  File "/home/users/rrpinto/anaconda3/envs/ete3/lib/python3.8/site-packages/ete3-3.1.2-py3.7.egg/ete3/evol/parser/codemlparser.py", line 303, in _check_paml_labels
    if int (node.up.node_id) != int (rel[0]):
AttributeError: 'NoneType' object has no attribute 'up'

I have checked the tree and it seems to be fine. What could be the problem?