Skip to content

Inputting into ncbi.get_rank() a list with a taxid having multiple ranks wrongly returns an empty dictionary #811

Description

@GravityCore

Inputting into ncbi.get_rank() a list containing a taxid which has multiple ranks assigned to it returns for that taxid an empty dictionary, while in reality it should return at least something (either all the ranks or the lowest one).

This silently removes the taxid from the results, and hides the fact that actually a rank is assigned to that taxid (and actually multiple), which causes problems further in the custom code.

The problem is also partly responsible for the inconsistency seen in #707.

Steps to reproduce

ncbi.get_rank("2588313")

returns

{1: 'no rank', 2: 'domain'}  # dict with two values

while

ncbi.get_rank(["2588313"])

returns

{}  # an empty dict

Both of these should be returning a value from which we can see that at least some kind of a rank exists, which is not the case for the 2nd code snippet.

Similar result with "565624" as a test case.

Interestingly, the "2588313" in older NCBI taxonomy browser redirects to page for Arxotrichum gangligerum, where taxid is 2074836 and rank is mentioned as "species" (so completely different to what was returned).

Ideally, the lower level rank should be returned, or at least multiple of them. Also, the same procedure could be done for all descendants of a root tax node, then checked for multiple ranks being present and sent to NCBI for correction.

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