Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-part / non-unique names #40

Merged
merged 16 commits into from
Jul 19, 2021
Merged

In-part / non-unique names #40

merged 16 commits into from
Jul 19, 2021

Conversation

tpoisot
Copy link
Member

@tpoisot tpoisot commented Jul 15, 2021

This closes #39 by erroring when there are multiple nodes with the same name, as in in-part names.

@tpoisot
Copy link
Member Author

tpoisot commented Jul 15, 2021

New issue: there are some cases where a genus and subgenus share a name, like Mus.

julia> NCBITaxonomy.names_table[findall(isequal(10088), NCBITaxonomy.names_table.tax_id),:]
3×4 DataFrame
 Row │ tax_id  name    unique_name  class
     │ Int64   String  String?      NCBIName
─────┼────────────────────────────────────────────────────
   110088  mice    mice <Mus>   class_common_name
   210088  mouse   mouse <Mus>  class_common_name
   310088  Mus     Mus <genus>  class_scientific_name

julia> NCBITaxonomy.names_table[findall(isequal(862507), NCBITaxonomy.names_table.tax_id),:]
1×4 DataFrame
 Row │ tax_id  name    unique_name     class
     │ Int64   String  String?         NCBIName
─────┼───────────────────────────────────────────────────────
   1862507  Mus     Mus <subgenus>  class_scientific_name

This might require to add something like the rank in GBIF

@tpoisot
Copy link
Member Author

tpoisot commented Jul 15, 2021

Alternatively, we can drop a keyword argument to taxon which would be an instance of NCBINameClass (or whatever it's called).

@tpoisot
Copy link
Member Author

tpoisot commented Jul 15, 2021

The best solution is probably to stick to the GBIF.jl API and pass the rank when there is an ambiguity. So this would be an additional error type NameRankAmbiguous), with a list of possible levels.

@tpoisot tpoisot merged commit 8ca2ae7 into main Jul 19, 2021
@tpoisot tpoisot deleted the bugfix/partialnames branch March 3, 2023 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In-part names only return the first element
1 participant