[Bioc-devel] idempotent identifier mapping with GSEABase::mapIdentifiers()

Robert Castelo robert.castelo at upf.edu
Mon Feb 27 12:25:29 CET 2012


i collaborate mantaining the packages GSVA and GSVAdata and i have a
question about the function mapIdentifiers() from the GSEABase package
which i'm going to illustrate through an example.

1. let's build first an ExpressionSet object whose annotation slot is
going to point to the human organism-level annotation pacakge


mapped_genes <- mappedkeys(org.Hs.egSYMBOL)

exp <- matrix(rnorm(1000), nrow=100,
                            paste("sample", 1:10, sep="")))
eset <- new("ExpressionSet", exprs=exp, annotation="org.Hs.eg.db")
ExpressionSet (storageMode: lockedEnvironment)
assayData: 100 features, 10 samples 
  element names: exprs 
protocolData: none
phenoData: none
featureData: none
experimentData: use 'experimentData(object)'
Annotation: org.Hs.eg.db 

2. now i'm going to load the Broad gene sets stored as a
GeneSetCollection object in the experimental data package GSVAdata:

  unique identifiers: 5167, 100288400, ..., 57191 (29340 total)
  types in collection:
    geneIdType: EntrezIdentifier (1 total)
    collectionType: BroadCollection (1 total)

3. finally, i'd like to obtain a new GeneSetCollection object whose
identifiers have been mapped between the two classes of identifiers in
the GeneSetCollection and the ExpressionSet objects.

in this case both objects actually work with the same class of
identifiers (Entrez), so in fact i don't need to do that but this
operation forms part of a piece of code in the package GSVA which i'd
like it to work regardless of the kind of annotation package referred to
in the ExpressionSet object. i had expected that the function
mapIdentifiers() would have some kind of idempotent behavior, but i get
the following error:

gsc <- mapIdentifiers(c2BroadSets,
Error in GeneSetCollection(lapply(what, mapIdentifiers, to, ..., verbose
= verbose)) : 
  error in evaluating the argument 'object' in selecting a method for
function 'GeneSetCollection': Error in get(mapName, envir = pkgEnv,
inherits = FALSE) : 
  object 'org.Hs.egENTREZID' not found

which does not occur if the feature names and annotation of the
ExpressionSet corresponds to a classical affy chip (e.g. "hgu95av2").

i built the object c2BroadSets in the experiment data package GSVAdata
by importing the entire xml file from the Broad sets so, i guess it
could be also possible that i did something wrong when i built this
'c2BroadSets' object and there's no problem, bug or lacking feature in

i look forward to your diagnostic and suggestions in any of these
possible directions.


More information about the Bioc-devel mailing list