DessimozLab / pyham

MIT License
9 stars 5 forks source link

Can't create pyham.Ham() object #25

Open max-baer opened 9 months ago

max-baer commented 9 months ago

Dear OMA developers.

I ran OMA on some whole genomes and got an output that looks okay at first glance but PyHam can't handle the creation of the .Ham object using the phyloxml_path:

Python 3.9.5 (default, Nov 4 2021, 14:38:27) [GCC 10.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import pyham import logging logging.basicConfig(level=logging.INFO, format="%(asctime)s %(name)-12s %(levelname)-8s %(message)s") orthoxml_path = "./Output/HierarchicalGroups.orthoxml"
phyloxml_path = "./Output/EstimatedSpeciesTree.phyloxml" pyham.Ham(phyloxml_path, orthoxml_path, use_internal_name=True, tree_format='phyloxml') Traceback (most recent call last): File "", line 1, in File "/scicore/home/venv_oma/lib/python3.9/site-packages/pyham/ham.py", line 227, in init self.taxonomy = tax.Taxonomy(self.tree_file, tree_format=tree_format, use_internal_name=use_internal_name, phyloxml_leaf_name_tag=phyloxml_leaf_name_tag, phyloxml_internal_name_tag=phyloxml_internal_name_tag) File "/scicore/home/venv_oma/lib/python3.9/site-packages/pyham/taxonomy.py", line 47, in init self.tree = self._build_tree(tree_file, tree_format, quoted_node_names) File "/scicore/home/venv_oma/lib/python3.9/site-packages/pyham/taxonomy.py", line 270, in _build_tree node.name = self._get_name_phyloxml(node, self.phyloxml_internal_name_tag) File "/scicore/home/venv_oma/lib/python3.9/site-packages/pyham/taxonomy.py", line 228, in _get_name_phyloxml if node.phyloxml_clade.taxonomy[0].scientific_name != '': IndexError: list index out of range

My goal would be to visualize the species tree with all the gains and losses of genes across the tree

max-baer commented 9 months ago

Worked with the newick format :)