| idMap {EnrichmentBrowser} | R Documentation |
Functionality to map the rownames of a SummarizedExperiment between common gene ID types such as ENSEMBL and ENTREZ.
idMap(se, org = NA, from = "ENSEMBL", to = "ENTREZID", multi.to = "first", multi.from = "first") idTypes(org)
se |
An object of class |
org |
Character. Organism in KEGG three letter code, e.g. ‘hsa’ for ‘Homo sapiens’. See references. |
from |
Character. Gene ID type from which should be mapped. Corresponds to the
gene ID type of the names of argument |
to |
Character. Gene ID type to which should be mapped. Corresponds to the gene
ID type the rownames of argument |
multi.to |
How to resolve 1:many mappings, i.e. multiple to.IDs for a
single from.ID? This is passed on to the |
multi.from |
How to resolve many:1 mappings, i.e. multiple from.IDs mapping to the same to.ID? Pre-defined options include:
Note that a user-defined function can also be supplied for custom behaviors.
This will be applied for each case where there are multiple from.IDs for a
single to.ID, and accordingly takes the arguments |
The function 'idTypes' lists the valid values which the arguments 'from' and 'to' can take. This corresponds to the names of the available gene ID types for the mapping.
idTypes: character vector listing the available gene ID types for the mapping;
idMap: An object of class SummarizedExperiment.
Ludwig Geistlinger <Ludwig.Geistlinger@sph.cuny.edu>
KEGG Organism code http://www.genome.jp/kegg/catalog/org_list.html
SummarizedExperiment, mapIds,
keytypes
# create an expression dataset with 3 genes and 3 samples
se <- makeExampleData("SE", nfeat=3, nsmpl=3)
names(se) <- paste0("ENSG00000000", c("003","005", "419"))
mse <- idMap(se, org="hsa")
# user-defined mapping
rowData(se)$MYID <- c("g1", "g1", "g2")
mse <- idMap(se, to="MYID")
# data-driven resolving of many:1 mappings
## e.g. select from.ID with lowest p-value
pcol <- configEBrowser("PVAL.COL")
rowData(se)[[pcol]] <- c(0.001, 0.32, 0.15)
mse <- idMap(se, to="MYID", multi.from="minp")
## ... or using a customized function
maxScore <- function(ids, se)
{
scores <- rowData(se, use.names=TRUE)[ids, "SCORE"]
ind <- which.max(scores)
return(ids[ind])
}
rowData(se)$SCORE <- c(125.7, 33.4, 58.6)
mse <- idMap(se, to="MYID", multi.from=maxScore)