taxFun is an R package that provides functions for working with NCBI taxonomy IDs and names.
taxFun requires the latest version of R. Please install or update R on your computer before continue.
taxFun can be installed from this github repository using devtools
:
if (!requireNamespace("devtools"))
install.packages("devtools")
devtools::install_github("trvinh/taxFun", INSTALL_opts = c('--no-lock'), build_vignettes = TRUE)
From the R terminal, enter:
library(taxFun)
to load taxFun package.
taxFun command has this structure
taxFun(function_name, input, options, output)
To learn about the options for each taxFun function, please use this command
?taxFun::function_name()
These are the list of available functions in taxFun and their parameters
If not specified, output file will be saved as input.*
.
For example:
# specify list of taxon IDs and names
idFile <- "inst/ids.txt"
nameFile <- "inst/names.txt"
# convert IDs to names
taxFun("id2name", idFile)
# get names of class, family and phylum for a list of given taxon names
taxFun("getRanks", nameFile, ranks = c("class", "family", "phylum"))
# create an aligned taxonomy hierarchies for a list of taxon IDs
taxFun("sortTaxonomyMatrix", idFile, refspec = "Homo sapiens")
# create taxonomy tree rooted by an outgroup species
taxFun("createTree", nameFile, outgroup = "Homo sapiens")
# sub-sample taxa on phylum level
taxFun("getRepresentative", idFile, rank = "phylum")
# get all metazoa species
taxFun("getClade", idFile, supertaxon = "metazoa")
# get last common ancestor
taxFun("getLCA", nameFile)
Any bug reports or comments, suggestions are highly appreciated. Please open an issue on GitHub or be in touch via email.
This tool is released under MIT license.
Use the citation function in R CMD to have it directly in BibTex or LaTeX format
citation("taxFun")
Vinh Tran tran@bio.uni-frankfurt.de