Skip to content

TypeError: expect subclass obj of 'AncestralGenome', got ExtantGenome #7

@ethanbass

Description

@ethanbass

Hi,
I am trying to set up a HAM from the latest OMA release (https://omabrowser.org/oma/current/) as in the tutorial here (https://zoo.cs.ucl.ac.uk/tutorials/tutorial_pyHam_get_started.html).

import pyham
nwk_path = "./speciestree.nwk"
orthoxml_path =  "./oma-hogs.orthoXML"
ham_analysis = pyham.Ham(nwk_path, orthoxml_path, use_internal_name=True, tree_format='newick')

It comes back with the following error:

Traceback (most recent call last):

  File "<ipython-input-6-9b28b33953bd>", line 1, in <module>
    ham_analysis = pyham.Ham(nwk_path, orthoxml_path, use_internal_name=True, tree_format='newick')

  File "/Users/ethanbass/Downloads/pyham_master/pyham/ham.py", line 273, 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 "/Users/ethanbass/Downloads/pyham_master/pyham/ham.py", line 829, in _build_hogs_and_genes
    parser.feed(line)

  File "/Users/ethanbass/Downloads/pyham_master/pyham/parsers.py", line 182, in end
    hog.set_genome(ancestral_genome)

  File "/Users/ethanbass/Downloads/pyham_master/pyham/abstractgene.py", line 245, in set_genome
    type(genome).__name__))

TypeError: expect subclass obj of 'AncestralGenome', got ExtantGenome

I would appreciate any insights into what might be causing this problem.
Ethan

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