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

class2tree checks duplicated taxa in higher levels, resolve #934 #935

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

trvinh
Copy link
Contributor

@trvinh trvinh commented Aug 26, 2024

Description

class2tree can detect duplicated input taxa, which already belong to the taxonomy strings of other taxa in higher levels (e.g. genus Haliotis belongs to the taxonomy string of species H. cracherodii)

Related Issue

#934

Example

spnames <- c("Haliotis", "Haliotis cracherodii", "Haliotis rufescens", "Megabalanus californicus", "Cadlina luteomarginata", "Anthozoa", "Gastropoda")
outTaxize <- classification(spnames, db = "gbif")
tree <- class2tree(outTaxize)

The duplicated taxa will be ignored with a WARNING while creating the tree

Get all ranks and their taxIDs
Align taxonomy hierarchies...
WARNING: 2 duplicated taxa have been ignored! Including: Haliotis; Gastropoda
Taxonomy alignment done!
Calculate distance matrix
Add node labels

@zachary-foster
Copy link
Collaborator

Thanks! I will modify it to make it optional, since I think some may want the old behavior. In some cases it might make sense to include the coarser taxa in the tree, but this seems useful as well.

@zachary-foster zachary-foster merged commit fe1ec55 into ropensci:master Sep 4, 2024
1 of 3 checks passed
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.

2 participants