-
Notifications
You must be signed in to change notification settings - Fork 62
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
Issue with class2tree on taxa list with multiple classification levels #934
Comments
Hi @meghanmshea , Firstly, the function is implemented so that all input taxa will be displayed as tips of the tree. Therefore, you will see Haliotis plotted at the same level as H. rufescent and H.cracherodii. Secondly, the
When the table is returned as an output, duplicated values are replaced by NA, which can lead to confusion or wrong (for example, Anthozoa is a class, not a species. So, a simple solution is, that one should not use a taxon with high taxonomy level as input, when it already belongs to the taxonomy string of other taxa (e.g. Haliotis belongs to the taxonomy string of H. cracherodii, or Gastropoda belongs to the taxonomy string of C. luteomarginata). A smarter solution would be, that the function should remove those taxa automatically :-D The removed taxa will be showed as the node labels anyway: I hope this helps! Best, |
class2tree checks duplicated taxa in higher levels, resolve #934
I am combining data across multiple biodiversity survey types, which results in a taxonomic list that has multiple final classification levels (e.g. some organisms are identified to species, some only to genus, etc.). I use the classification function and GBIF database to get standardized taxonomic classification, and then I want to plot a tree to visualize all of the organisms identified (and ultimately, mark which organisms were identified by which survey type).
When I use class2tree, however, the hierarchy seems to get funky: it seems to treat every input classification as the same taxonomic level, so the resulting tree doesn't make taxonomic sense.
Here's a small subset example:
The resulting plot, for example, treats species and higher level taxonomic classifications the same, which is especially apparent with Haliotis, since the classification list had one genus-level classification, which should be the node above the two species-level classifications -- but here they are all side-by-side.
Looking at the underlying taxa_tree_test, it seems like one issue might be in how

taxa_tree_test$classification
is being constructed:As shown, all of the inputs are getting added as "species", even when they are different taxonomic levels.
Is there any way to fix this?
Session Info
The text was updated successfully, but these errors were encountered: