View source: R/identifier-mappings.R
| map_identifiers | R Documentation |
Apply a mapping loaded by load_id_mappings() without network access.
Mapping is deliberately explicit: callers select the input namespace and
policies for ambiguous and unmapped identifiers before importing or
preparing analytical objects. This public helper is also useful for mapping
an identifier vector independently of an import operation.
map_identifiers(
ids,
mappings,
from,
ambiguous = c("error", "drop", "first", "expand"),
unmapped = c("keep", "drop", "error"),
case_sensitive = TRUE
)
ids |
Character vector of source identifiers. |
mappings |
A |
from |
Source identifier format listed by |
ambiguous |
Policy for source IDs with several master IDs: error, drop, keep the first sorted match, or expand to all matches. |
unmapped |
Policy for source IDs without a mapping: keep, drop, or error. |
case_sensitive |
Match source identifiers with case sensitivity. |
A character vector in the master namespace. With
ambiguous = "expand", one input may yield several output values.
A mapping_info attribute records mapping counts and policies.
prepare_id_mappings(), load_id_mappings()
example_mappings <- structure(list(
mappings = data.frame(id_format = "ensembl_gene_id",
source_id = c("ENSG1", "ENSG2"), master_id = c("TP53", "MDM2")),
manifest = list(id_formats = "ensembl_gene_id")),
class = "nearender_id_mappings")
map_identifiers(c("ENSG1", "ENSG2"), example_mappings,
from = "ensembl_gene_id")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.