Retrieve taxa by their identifiers

get_taxa_by_ids(
  taxa,
  raw = getOption("gemma.raw", FALSE),
  memoised = getOption("gemma.memoised", FALSE),
  file = getOption("gemma.file", NA_character_),
  overwrite = getOption("gemma.overwrite", FALSE)
)

Arguments

taxa

Limits the result to entities with given identifiers. A vector of identifiers. Identifiers can be the any of the following:

  • taxon ID

  • scientific name

  • common name Retrieval by ID is more efficient. Do not combine different identifiers in one query. For convenience, below is a list of officially supported taxa

    IDComm.nameScient.nameNcbiID
    1humanHomo sapiens9606
    2mouseMus musculus10090
    3ratRattus norvegicus10116
    11yeastSaccharomyces cerevisiae4932
    12zebrafishDanio rerio7955
    13flyDrosophila melanogaster7227
    14wormCaenorhabditis elegans6239
raw

TRUE to receive results as-is from Gemma, or FALSE to enable parsing. Raw results usually contain additional fields and flags that are omitted in the parsed results.

memoised

Whether or not to save to cache for future calls with the same inputs and use the result saved in cache if a result is already saved. Doing options(gemma.memoised = TRUE) will ensure that the cache is always used. Use forget_gemma_memoised to clear the cache.

file

The name of a file to save the results to, or NULL to not write results to a file. If raw == TRUE, the output will be the raw endpoint from the API, likely a JSON or a gzip file. Otherwise, it will be a RDS file.

overwrite

Whether or not to overwrite if a file exists at the specified filename.

Value

A data table with the queried taxa's details.

Examples

gemma.R:::get_taxa_by_ids(c("mouse", "human"))
#>    taxon.name taxon.scientific taxon.ID taxon.NCBI taxon.database.name
#>        <char>           <char>    <int>      <int>              <char>
#> 1:      human     Homo sapiens        1       9606                hg38
#> 2:      mouse     Mus musculus        2      10090                mm10
#>    taxon.database.ID
#>                <int>
#> 1:                87
#> 2:                81