mapGenes: Map genes

Description Usage Arguments Value Ambiguous gene names Note Examples

Description

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).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
mapGenesToRownames(object, ...)

mapGenesToIDs(object, ...)

mapGenesToSymbols(object, ...)

## S4 method for signature 'Gene2Symbol'
mapGenesToRownames(object, genes, strict = TRUE)

## S4 method for signature 'SummarizedExperiment'
mapGenesToRownames(object, genes, strict = TRUE)

## S4 method for signature 'Gene2Symbol'
mapGenesToIDs(object, genes, strict = TRUE)

## S4 method for signature 'SummarizedExperiment'
mapGenesToIDs(object, genes, strict = TRUE)

## S4 method for signature 'Gene2Symbol'
mapGenesToSymbols(object, genes, strict = TRUE)

## S4 method for signature 'SummarizedExperiment'
mapGenesToSymbols(object, genes, strict = TRUE)

Arguments

object

Object.

genes

character. Gene identifiers.

strict

logical(1). Require all genes to match. Recommended by default. If set FALSE, instead will return a warning to the user, and subset the genes vector to only include matches.

...

Additional arguments.

Value

character.

Ambiguous gene names

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.

Note

Updated 2019-08-21.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
data(RangedSummarizedExperiment, package = "acidtest")
rse <- RangedSummarizedExperiment
print(rse)

rownames <- head(rownames(rse))
print(rownames)

g2s <- Gene2Symbol(rse)
geneIDs <- head(g2s[["geneID"]])
print(geneIDs)

geneNames <- head(g2s[["geneName"]])
print(geneNames)

## Row names.
mapGenesToRownames(rse, genes = rownames)
mapGenesToRownames(rse, genes = geneIDs)
mapGenesToRownames(rse, genes = geneNames)

## Gene identifiers.
mapGenesToIDs(rse, genes = rownames)
mapGenesToIDs(rse, genes = geneIDs)
mapGenesToIDs(rse, genes = geneNames)

## Gene names (symbols).
mapGenesToSymbols(rse, genes = rownames)
mapGenesToSymbols(rse, genes = geneIDs)
mapGenesToSymbols(rse, genes = geneNames)

acidgenomics/basejump documentation built on Nov. 21, 2019, 1:36 a.m.