mapGenesToRownames | R Documentation |
Take a user-defined gene vector and dynamically map the input to either the object rownames or the gene names (symbols). These functions are useful for writing code that needs to handle either gene identifier or gene name input dynamically (e.g. for single-cell RNA-seq marker analysis).
mapGenesToRownames(object, ...)
mapGenesToIds(object, ...)
mapGenesToSymbols(object, ...)
## S4 method for signature 'SummarizedExperiment'
mapGenesToRownames(object, genes, strict = TRUE)
## S4 method for signature 'SummarizedExperiment'
mapGenesToIds(object, genes, strict = TRUE)
## S4 method for signature 'SummarizedExperiment'
mapGenesToSymbols(object, genes, strict = TRUE)
object |
Object. |
genes |
|
strict |
|
... |
Additional arguments. |
character
.
Some genomes (e.g. Homo sapiens, Mus musculus) contain duplicated gene names
for multiple gene identifiers. Normally we handle these ambiguous gene names
by sanitizing them with make.names
. If a user requests a gene name that
is duplicated, these functions will return a warning.
Updated 2021-10-08.
data(RangedSummarizedExperiment, package = "AcidTest")
## SummarizedExperiment ====
object <- RangedSummarizedExperiment
rownames <- head(rownames(object))
print(rownames)
g2s <- GeneToSymbol(object)
geneIds <- head(g2s[["geneId"]])
print(geneIds)
geneNames <- head(g2s[["geneName"]])
print(geneNames)
## Row names.
mapGenesToRownames(object, genes = rownames)
mapGenesToRownames(object, genes = geneIds)
mapGenesToRownames(object, genes = geneNames)
## Gene identifiers.
mapGenesToIds(object, genes = rownames)
mapGenesToIds(object, genes = geneIds)
mapGenesToIds(object, genes = geneNames)
## Gene names (symbols).
mapGenesToSymbols(object, genes = rownames)
mapGenesToSymbols(object, genes = geneIds)
mapGenesToSymbols(object, genes = geneNames)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.