Description Usage Arguments Value Note Author(s) Examples
Sometimes you need to chain (or JOIN) a few mapping
tables together in order to get the end result. For
example, Using the annotation.db packages, if you need to
go from GENESYMBOL to GENENAME, you have to go via the
ENTREZGENE ID. You would lookup the entrez gene ID for
each SYMBOL, using the org.Hs.egSYMBOL2EG AnnDbBimap,
which can sometimes return NA
's. Then take those
Entrez Gene ID's and look them up in the
org.Hs.egGENENAME table. This function does the hard work
for you.
1 | mget.chain(keys, a, b, debug = FALSE)
|
keys |
a vector of search keys which must be found in a |
a |
an environment, or AnnDbBimap object |
b |
an environment, or AnnDbBimap object |
debug |
logical: if |
For the N search keys, either return a named vector, of
length N of mapped values, or a 3 column, N row
data.frame
, if debug=TRUE
. if there is no
mapped value for a key, NA
is returned.
this returns only the first match for each key, along
each of the mapping steps, where “first” is
defined in mget2
.
Mark Cowley, 2011-09-21
1 2 3 4 5 | if( require(org.Hs.eg.db) ) {
geneids <- c("TP53", "INS", "KRAS")
mget.chain(geneids, org.Hs.egSYMBOL2EG, org.Hs.egGENENAME, FALSE)
mget.chain(geneids, org.Hs.egSYMBOL2EG, org.Hs.egGENENAME, TRUE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.