replaceGeneId: replace matrix gene identifiers

Description Usage Arguments Details Value References See Also Examples

View source: R/replaceGeneId.R

Description

Translate matrix rownames between gene identifiers.

Usage

1
replaceGeneId(emat, id.in = "symbol", id.out = "entrez")

Arguments

emat

a numeric matrix with row features and sample columns.

id.in

a character, gene symbol, entrez and ENSG are valid options.

id.out

a character, gene symbol, entrez and ENSG are valid options.

Details

Gene identifiers are from the org.Hs.eg.db package.

Value

A matrix with rownames gene identifier as specified in id.out. For duplicates, rownames for rows with lower standard deviation are added a number to make unique. make.unique are used to handle NA and duplicates in output.

References

Marc Carlson (). org.Hs.eg.db: Genome wide annotation for Human. R package version 3.2.3.

Steffen Durinck et al. (2009) Mapping identifiers for the integration of genomic datasets with the R/Bioconductor package. Nature Protocols 4, 1184-1191.

See Also

anno.orgHs, fromTo, org.Hs.eg.db, sd make.unique

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# example data
library(Biobase)
x.entrez <- Biobase::exprs(crcTCGAsubset)
# rownames are entrez
head(rownames(x.entrez))
# translate to gene symbols
x.symbol <- replaceGeneId(x.entrez, id.in="entrez", id.out="symbol")
head(rownames(x.symbol))
x.entrez2 <- replaceGeneId(x.symbol, id.in="symbol", id.out="entrez")
# translations are not cycle consistent
table(rownames(x.entrez2) == rownames(x.entrez))
# matrix values are not changed
all(x.entrez == x.entrez2)

peterawe/CMScaller documentation built on June 13, 2020, 4:49 a.m.