Skip to contents

Make sure the resource supports the organism and it has the ID

Usage

organism_for(organism, resource, error = TRUE)

Arguments

organism

Character or integer: name or NCBI Taxonomy ID of the organism.

resource

Charater: name of the resource.

error

Logical: raise an error if the organism is not supported in the resource. Otherwise it only emits a warning.

Value

Character: the ID of the organism as it is used by the resource. NA if the organism can not be translated to the required identifier type.

Examples

organism_for(10116, 'chalmers-gem')
#> [1] "Rat"
# [1] "Rat"
organism_for(6239, 'chalmers-gem')
#> Error in organism_for(6239, "chalmers-gem"): Organism `6239` (common_name: `Caenorhabditis elegans (Nematode, N2)`; common_name: `Caenorhabditis elegans (Nematode, N2)`) is not supported by resource `chalmers-gem`. Supported organisms: Human, Mouse, Rat, Zebrafish, Drosophila melanogaster (Fruit fly), Caenorhabditis elegans (PRJNA13758).
# [1] "Worm"
# organism_for('foobar', 'chalmers-gem')
# Error in organism_for("foobar", "chalmers-gem") :
# Organism `foobar` (common_name: `NA`; common_name: `NA`)
# is not supported by resource `chalmers-gem`. Supported organisms:
# Human, Mouse, Rat, Zebrafish, Drosophila melanogaster (Fruit fly),
# Caenorhabditis elegans (PRJNA13758).