convertGeneIds | R Documentation |
Changes gene identifiers by aggregating expression measures (sum). This is mainly useful when changing from Ensembl IDs to Gene Symbols
convertGeneIds(exp, newIds)
exp |
expression matrix (genes x cells) |
newIds |
character vector specifying the new identifer that corresponds
with each row of the input |
This method is made fast by the use of sparse matrix multiplication
i.e.: (newIds x oldIds) x (oldIds x cells) = (newIds x cells)
a matrix in which rows with duplicate 'newIds' have been summed together
exp <- matrix(c(1, 1, 1, 2, 2, 2, 3, 3, 3), nrow=3)
colnames(exp) <- c("Cell1", "Cell2", "Cell3")
print(exp)
newIds <- c("GeneA", "GeneA", "GeneB")
result <- convertGeneIds(exp, newIds)
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.