-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
In get_lineage
, the types are not specified, and tax_id
can be of either int
or str
. Indeed, the function itself seems confused as to what they are, with both the check tax_id == 1
and the check tax_id != '1'
.
taxconverter/taxconverter/__main__.py
Lines 75 to 89 in 9050fef
def get_lineage(tax_id, map_child_parent): | |
if tax_id == 0 or tax_id == 1: | |
logger.info(f"No lineage for ID: {tax_id}") | |
return '' | |
if tax_id not in map_child_parent: | |
logger.info(f"ID not found in NCBI lineage: {tax_id}") | |
return '' | |
lineage = [] | |
while tax_id in map_child_parent and tax_id != '1': | |
lineage.append(tax_id) | |
tax_id = map_child_parent[tax_id] | |
if tax_id != '1': | |
logger.info(f"Parent node warning: {tax_id} is the root, but does not stem from 1. Returning empty lineage.") | |
return '' | |
return ';'.join(lineage[::-1]) |
This causes bugs in a trial run of Taxonverter.
Metadata
Metadata
Assignees
Labels
No labels