This function implements a generic mapping workflow that
enables mapping gene identifers between different types,
given a mapper function. The default mapper,
biocann_map
, enables mapping identifiers
within or across platform, as well as across species.
mapIDs(keys, from, to, method = c("auto", "mauto", "all", "firstN", "1:1", "1:*", "affy"), mapper = biocann_map, verbose = FALSE, ...)
idFilter
.object
. This is only neeeded when the source type
cannot be inferred from object
itself.convertIDs,character,GeneIdentifierType,GeneIdentifierType
.
See each method's description for more details.The mapper function passed in argument mapper
is
responsible for providing a sequence of map(s) that are
sequentially applied, starting with the source gene
identifiers in keys
. It must at least have the
following 4 arguments:
GeneIdentifierType
)
object. GeneIdentifierType
)
object.
# some ENTREZ ids
ez <- as.character(1:1000)
# convert into probe ids for Affymetrix Chip hgu133a
m <- mapIDs(ez, EntrezIdentifier('hgu133a.db'), AnnotationIdentifier('hgu133b.db'), verbose=2)
## # Converting from EntrezId (hgu133a.db) to Annotation (hgu133b.db) ...
## # Limiting query to EntrezId (hgu133a.db) ... [1000 -> 690 id(s)]
## # Loading map(s) from EntrezId (hgu133a.db) to Annotation (hgu133b.db) [x-platform/x-id] ... OK [1 step(s)]
## # Mapping from EntrezId (hgu133b.db) to Annotation (hgu133b.db) [43827 entries] ... [173/690 mapped (1:1-6 = 269)]
## OK [173/1000 mapped (1:1-6 = 269)]
# keep primary affy probes only
m <- mapIDs(ez, EntrezIdentifier('hgu133a.db'), AnnotationIdentifier('hgu133b.db')
, method='affy', verbose=2)
## # Converting from EntrezId (hgu133a.db) to Annotation (hgu133b.db) ...
## # Limiting query to EntrezId (hgu133a.db) ... [1000 -> 690 id(s)]
## # Loading map(s) from EntrezId (hgu133a.db) to Annotation (hgu133b.db) [x-platform/x-id] ... OK [1 step(s)]
## # Mapping from EntrezId (hgu133b.db) to Annotation (hgu133b.db) [43827 entries] ... [173/690 mapped (1:1-6 = 269)]
## # Applying filtering strategy 'affy' ... (kept 61 2nd-affy probes) [173/173 passed (1:1-6 = 269)]
## OK [173/1000 mapped (1:1-6 = 269)]
# same but only keep 1:1 mapping, using a composed filtering strategy
m <- mapIDs(ez, EntrezIdentifier('hgu133a.db'), AnnotationIdentifier('hgu133b.db')
, method=c('affy', '1:1'), verbose=2)
## # Converting from EntrezId (hgu133a.db) to Annotation (hgu133b.db) ...
## # Limiting query to EntrezId (hgu133a.db) ... [1000 -> 690 id(s)]
## # Loading map(s) from EntrezId (hgu133a.db) to Annotation (hgu133b.db) [x-platform/x-id] ... OK [1 step(s)]
## # Mapping from EntrezId (hgu133b.db) to Annotation (hgu133b.db) [43827 entries] ... [173/690 mapped (1:1-6 = 269)]
## # Applying filtering strategy 'affy > 1:1' ... (kept 61 2nd-affy probes) (dropped 61 1:2+ maps) [112/173 passed (1:1)]
## OK [112/1000 mapped (1:1)]