Retrieve Taxonomic Ranks for a List of NCBI Taxonomy Tax IDs in Parallel
Source:R/parallel_get_tax.R
parallel_get_tax.Rd
Retrieves taxonomy ranks for a list of NCBI Taxonomy Tax IDs using parallel processing. The function queries the NCBI database and can retry fetching taxonomy information multiple times if initial attempts fail.
Usage
parallel_get_tax(
organisms_taxIDs,
parse_result = TRUE,
total_cores = 1,
retry_times = 10,
verbose = FALSE,
env_name = "entrez-env"
)
Arguments
- organisms_taxIDs
A character vector of NCBI Taxonomy Tax IDs to retrieve taxonomy information for.
- parse_result
Logical indicating whether to parse the taxonomy information into a tibble (
TRUE
, default) or return the raw output as returned byefetch
(FALSE
).- total_cores
Integer specifying the number of cores to use for parallel processing. Defaults to
1
.- retry_times
Integer specifying the number of times to retry fetching taxonomy information if it fails. Defaults to
10
.- verbose
Logical indicating whether to print verbose messages during the process. Default is
FALSE
.- env_name
Character string specifying the name of the conda environment where
efetch
is installed. Default is"entrez-env"
.
Examples
if (FALSE) { # \dontrun{
# Retrieve taxonomy for multiple Tax IDs using 4 cores
tax_ids <- c("9606", "10090", "10116") # Human, Mouse, Rat
tax_info <- parallel_get_tax(tax_ids, total_cores = 4)
# Retrieve unparsed taxonomy result
tax_info_unparsed <- parallel_get_tax(tax_ids, parse_result = FALSE)
# Increase the number of retry attempts
tax_info <- parallel_get_tax(tax_ids, retry_times = 20)
# Enable verbose output
tax_info <- parallel_get_tax(tax_ids, verbose = TRUE)
} # }