This function uses the "taxonkit taxonkit_name2taxid" command to convert taxonomic names to corresponding taxonomic IDs (TaxIDs).

taxonkit_name2taxid(
  file_path,
  name_field = NULL,
  sci_name = FALSE,
  show_rank = FALSE,
  text = FALSE,
  data_dir = NULL
)

Arguments

file_path

The path to the input file containing taxonomic names. Or file text (text=TRUE)

name_field

The field index of the taxonomic name in the input file (default is 1).

sci_name

Logical value indicating whether to search only for scientific names (default is FALSE).

show_rank

Logical value indicating whether to show the taxonomic rank in the output (default is FALSE).

text

Logical

data_dir

directory containing nodes.dmp and names.dmp (default "/Users/asa/.taxonkit")

Value

A character vector containing the output of the "taxonkit_name2taxid" command.

Examples

if (FALSE) {
names <- system.file("extdata/name.txt", package = "pctax")
taxonkit_name2taxid(names, name_field = 1, sci_name = FALSE, show_rank = FALSE)
"Homo sapiens" %>% taxonkit_name2taxid(text = TRUE)
}