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

fixed bug caused by new taxonomy ranks #839

Merged
merged 2 commits into from
Sep 1, 2020
Merged

fixed bug caused by new taxonomy ranks #839

merged 2 commits into from
Sep 1, 2020

Conversation

trvinh
Copy link
Contributor

@trvinh trvinh commented Sep 1, 2020

Description

New taxonomy ranks (e.g. biotype, isolate, pathogroup,...) causes issue for class2tree function:

"Error in if (currentIndex <= tmpEnv[[subList[i - 1]]]) { : argument is of length zero"

By including those new ranks, the problem is solved. The list of current ranks is:

c(
      "strain","biotype","isolate","pathogroup","serogroup","serotype",
      "genotype","morph","forma","subspecies","subvariety","varietas",
      "formaspecialis","subspecies","species","speciessubgroup",
      "speciesgroup","series","subgenus","genus","subtribe","tribe",
      "subfamily","family","superfamily",
      "parvorder","infraorder","suborder","order","superorder",
      "subcohort","cohort","infraclass","subclass","class","superclass",
      "subphylum","phylum","superphylum",
      "subkingdom","kingdom","superkingdom"
)

Other ranks (such as clade, section, subsection,...) are treated as same as no rank, since they can appear at different positions in the taxonomy tree.

Related Issue

#838 #835

Example

library(taxize)
spnames <- c("Engraulis mordax", "Mola mola", "Sebastes", "Sardinops sagax",
             "Merluccius productus")
out <- classification(spnames, db = "ncbi", verbose = FALSE)
out <- out[!is.na(out)]
tr <- class2tree(out)
plot(tr)

@trvinh trvinh requested a review from sckott September 1, 2020 09:32
@sckott sckott added this to the v0.9.98 milestone Sep 1, 2020
This was linked to issues Sep 1, 2020
@sckott sckott merged commit 5b45b29 into ropensci:master Sep 1, 2020
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.

Error with class2tree new rank of NCBI taxonomy
2 participants