bioperl / bioperl-live

Core BioPerl 1.x code
http://bioperl.org
299 stars 182 forks source link

get_taxonids from Bio::DB::Taxonomy returns unexpected (wrong) uid's #212

Closed nylander closed 7 years ago

nylander commented 7 years ago

Hi, the get_taxonids function in Bio::DB::Taxonomy will sometimes return an incorrect uid (taxon ID) given a scientific binomen. This will happen if there is an initial "no hit" for the binomen (Genus species), but the species (second word in the search string) happens to mach a Genus in NCBI's data base. get_taxonids will then return the uid for the found Genus and not, as desired, a "no hit" for the binomen.

Example:

String                 | What I expect | What I get
---------------------- | ------------- | ----------
'Lissotriton vulgaris' | 8324          | 8324
'Chlorella vulgaris'   | 3077          | 3077
'Phygadeuon solidus'   | 1763951       | 1763951
'Ovatus'               | 666060        | 666060
'Phygadeuon ovatus'    | "No hit"      | 666060
'Trimorus ovatus'      | "No hit"      | 666060

More details and code example here: https://gist.github.com/nylander/de0fe4f009314c1272523eb11a179910

Cheers Johan

bosborne commented 7 years ago

Johan, this is fixed, tested using your examples.