Probable bug in GSEABase package.
2
2
Entering edit mode
jcrodriguez ▴ 20
@jcrodriguez-12079
Last seen 7.8 years ago

Hi everyone,
I am having a problem with GSEABase package, I am not sure if this is the place where I should post this.
Well, my problem. I am creating a GeneSet with genes, setName and setIdentifier, however, when I update its name I get the setIdentifier automatically modified. Here is my code:

> library(GSEABase);
> # creating a GeneSet with genes "1".."10", name MyName and id MyId
> myGset <- GeneSet(as.character(1:10), setName="MyName", setIdentifier="MyId");
> details(myGset);
setName: MyName  
geneIds: 1, 2, ..., 10 (total: 10)
geneIdType: Null
collectionType: Null  
setIdentifier: MyId
description:  
organism:  
pubMedIds:  
urls:  
contributor:  
setVersion: 0.0.1
creationDate:
> c(setName(myGset), setIdentifier(myGset)) ;
[1] "MyName" "MyId"
> # It was correctly created, now lets change just its name to OtherName
> setName(myGset) <- "OtherName";
> c(setName(myGset), setIdentifier(myGset))
[1] "OtherName"                                         
[2] "bdmgWorkstation2:28927:Tue Jan 24 12:09:13 2017:1"
> # As we can see, the setIdentifier has changed automatically
> details(myGset);                          
setName: OtherName  
geneIds: 1, 2, ..., 10 (total: 10)
geneIdType: Null
collectionType: Null  
setIdentifier: bdmgWorkstation2:28927:Tue Jan 24 12:09:13 2017:1
description:  
organism:  
pubMedIds:  
urls:  
contributor:  
setVersion: 0.0.1
creationDate:
> sessionInfo(); 
R Under development (unstable) (2017-01-04 r71888)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 13.04

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               
[3] LC_TIME=es_AR.UTF-8        LC_COLLATE=en_US.UTF-8     
[5] LC_MONETARY=es_AR.UTF-8    LC_MESSAGES=en_US.UTF-8    
[7] LC_PAPER=es_AR.UTF-8       LC_NAME=C                  
[9] LC_ADDRESS=C               LC_TELEPHONE=C             
[11] LC_MEASUREMENT=es_AR.UTF-8 LC_IDENTIFICATION=C        

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets  
[8] methods   base

other attached packages:
[1] GSEABase_1.37.0      graph_1.53.0         annotate_1.53.1      
[4] XML_3.98-1.5         AnnotationDbi_1.37.1 IRanges_2.9.14       
[7] S4Vectors_0.13.7     Biobase_2.35.0       BiocGenerics_0.21.3  

loaded via a namespace (and not attached):
[1] Rcpp_0.12.9    digest_0.6.11  bitops_1.0-6   xtable_1.8-2   DBI_0.5-1      
[6] RSQLite_1.1-2  tools_3.4.0    RCurl_1.95-4.8 compiler_3.4.0 memoise_1.0.0

 

software error bug gseabase • 1.5k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States

Not a bug but maybe a misguided feature. The idea is that the identifier is 'unique', so when you change the gene set, in any way, you get a new identifier. Otherwise, the information would be redundant with the set name.

ADD COMMENT
0
Entering edit mode
jcrodriguez ▴ 20
@jcrodriguez-12079
Last seen 7.8 years ago

Martin, thanks for you (really) fast reply.
I am getting confused with GeneSet-class slots:
setNames must be unique inside a GeneSetCollection, but setIdentifiers might not. As I am used to have the IDs to be unique then it is being hard to get used to it haha.
I get your idea about setIdentifiers, so I will have to use my workaroud:

> myGset <- GeneSet(as.character(1:10), setName="MyName", setIdentifier="MyId");
> old_setId <- setIdentifier(myGset);
> setName(myGset) <- "OtherName";
> setIdentifier(myGset) <- old_setId;

However, just to have it clear, how would you manually create the "GO:0000102" gene set? (I am just interested in ID and Name, no matter about genes, collection, etc).
Am I right as follows?

> fakeGenes <- as.character(1:10)
> myGOgset <- GeneSet(fakeGenes, setName="L-methionine secondary active transmembrane transporter activity", setIdentifier="GO:0000102");

thanks!!
Rodriguez, Juan Cruz.

ADD COMMENT
0
Entering edit mode

Probably you wanted to ADD COMMENT to my answer, rather than post a new answer.

setIdentifier was originally not set-able, just a unique identifier, so I would not use it and use the GOID for the name

gs = GeneSet(LETTERS, setName="GO:0000102")

I'd rely on mapIds() to get the term, when desired

> mapIds(GO.db, setName(gs), "TERM", "GOID")
'select()' returned 1:1 mapping between keys and columns
                                                        GO:0000102 
"L-methionine secondary active transmembrane transporter activity" 

 

ADD REPLY

Login before adding your answer.

Traffic: 575 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6