-
Notifications
You must be signed in to change notification settings - Fork 4
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
TaxDict breaks if passed lineage with unlabeled terminal rank #4
Comments
Went with option (2) in commit e14cec0 I think this more explicitly addresses the failure mode while being less likely to cover up other potential problems... |
Hi Jon, I tried out your option(2) solution and I think it's a good one. By searching for the lowest shared rank between the given taxonomy and the resolved taxonomy, you're identifying the best match in a repeatable way. In the case of your unidentified insect family, its returning the lowest identifiable level, Trichoceridae which is a family. In the hypothteical situation where the last 2 ranks are unknown, your method would be able to handle it also. It should also raise an error if a resolved name only contains unidentified ranks. I would say, however, that it may not be a good idea to search for the Feel free to push your solution to the master and I can play with it a bit more. |
I was wondering how that would interface with your intentions for the
|
I noticed this when parsing a list of insect taxa from genbank with available genomic information. When I attempted to make a TaxDict object with the list of taxa, it failed.
In this case, the terminal lineage entry is 'Unclassified' with no assigned rank, causing
_getLevel
to fail on initialization of theTaxRef
object:Not sure what the best way to resolve this should be.
Could add a catch in
_getLevel
to make sure the query rank is present in the default taxonomy before it tries to index, otherwise return 'Unknown' or similar.Rather than simply passing the terminal rank to the
TaxRef
constructor, look for the most terminal labeled rank that is present in either the provided or default taxonomy.Any thoughts?
The text was updated successfully, but these errors were encountered: