convertGenesToSymbols: Convert genes to symbols

Description Usage Arguments Value Note Examples

Description

Convert genes to symbols

Usage

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

convertSymbolsToGenes(object, ...)

## S4 method for signature 'character'
convertGenesToSymbols(object, gene2symbol)

## S4 method for signature 'matrix'
convertGenesToSymbols(object, gene2symbol)

## S4 method for signature 'Matrix'
convertGenesToSymbols(object, gene2symbol)

## S4 method for signature 'GRanges'
convertGenesToSymbols(object)

## S4 method for signature 'SummarizedExperiment'
convertGenesToSymbols(object)

## S4 method for signature 'SummarizedExperiment'
convertSymbolsToGenes(object)

Arguments

object

Object.

gene2symbol

Gene2Symbol. Gene-to-symbol mappings. Must contain geneID and geneName columns. See Gene2Symbol for more information.

...

Additional arguments.

Value

Modified object of same class.

Note

Updated 2020-05-17.

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
29
30
31
32
data(RangedSummarizedExperiment, package = "acidtest")
rse <- RangedSummarizedExperiment
object <- rse

g2s <- Gene2Symbol(object)
print(g2s)
genes <- head(g2s[["geneID"]])
print(genes)

## character ====
x <- convertGenesToSymbols(genes, gene2symbol = g2s)
print(x)

## matrix ====
samples <- head(colnames(object))
counts <- matrix(
    data = seq_len(length(genes) * length(samples)),
    byrow = TRUE,
    nrow = length(genes),
    ncol = length(samples),
    dimnames = list(genes, samples)
)
print(counts)
x <- convertGenesToSymbols(counts, gene2symbol = g2s)
print(x)

## SummarizedExperiment ====
x <- convertGenesToSymbols(rse)
print(x)
## Interconvert back to gene IDs.
y <- convertSymbolsToGenes(x)
print(y)

acidgenomics/basejump documentation built on Aug. 8, 2020, 2:11 a.m.