Skip to content

AttributeError: 'NoneType' object has no attribute 'features' #19

@gmartinezredondo

Description

@gmartinezredondo

Hi!

I am using pyham 1.1.11 with 4 different gene trees/orthoxml files with a large species tree, and another orthoxml with a second species tree which is a clade within the other one. However, when I use the species trees without modifications I get this error:
Traceback (most recent call last): File "/mnt/netapp2/Store_csbye/scripts/orthoxml_pyham.py", line 44, in <module> ham_analysis = pyham.Ham(tree_str, orthoxml_path, use_internal_name=False) File "/opt/cesga/2020/software/Core/pyham/1.1.11/lib/python3.7/site-packages/pyham/ham.py", line 263, in __init__ self.top_level_hogs, self.extant_gene_map, self.external_id_mapper = self._build_hogs_and_genes(orthoxml_file, filter_object=self.filter_obj) File "/opt/cesga/2020/software/Core/pyham/1.1.11/lib/python3.7/site-packages/pyham/ham.py", line 819, in _build_hogs_and_genes parser.feed(line) File "/opt/cesga/2020/software/Core/pyham/1.1.11/lib/python3.7/site-packages/pyham/parsers.py", line 159, in end ln['node'].set_MRCA() File "/opt/cesga/2020/software/Core/pyham/1.1.11/lib/python3.7/site-packages/pyham/abstractgene.py", line 512, in set_MRCA self.MRCA = self.ham._get_ancestral_genome_by_taxon(self.MRCA.taxon.up) File "/opt/cesga/2020/software/Core/pyham/1.1.11/lib/python3.7/site-packages/pyham/ham.py", line 907, in _get_ancestral_genome_by_taxon if "genome" in tax_node.features: AttributeError: 'NoneType' object has no attribute 'features'

If I add to the species trees an outgroup species (not present in the orthoxml file), pyham runs without any issue for all genes but one.

Why is it working if I add an outgroup species but not without it? What could be the source of the error?

I attach the smallest of my datasets (the original and modified species tree) to see if you can see where the issue lies.
eglps.orthoxml.txt
insecta_original.nwk.txt
insecta_with_outgroup.nwk.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions