Browse code

Fixed bug when input object is ExpressionSet. Now instead of replacing expression values via exprs() a new ExpressionSet object is instantiated

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/GSVA@85470 bc3139a8-67e5-0310-9ffc-ced21a209358

Robert Castelo authored on 13/01/2014 09:36:56
Showing 3 changed files

... ...
@@ -1,6 +1,6 @@
1 1
 Package: GSVA
2
-Version: 1.11.2
3
-Date: 2013-10-21
2
+Version: 1.11.3
3
+Date: 2014-01-13
4 4
 Title: Gene Set Variation Analysis for microarray and RNA-seq data
5 5
 Author: Justin Guinney with contributions from Robert Castelo
6 6
 Maintainer: Justin Guinney <justin.guinney@sagebase.org>
... ...
@@ -1,6 +1,8 @@
1 1
 useDynLib(GSVA)
2 2
 
3 3
 import(methods)
4
+import(BiocGenerics)
5
+
4 6
 importClassesFrom(Biobase, ExpressionSet)
5 7
 importClassesFrom(GSEABase, GeneSetCollection)
6 8
 importFrom(Biobase, exprs)
... ...
@@ -45,14 +45,11 @@ setMethod("gsva", signature(expr="ExpressionSet", gset.idx.list="list", annotati
45 45
                                          min.sz=max(1, min.sz),
46 46
                                          max.sz=max.sz)
47 47
 
48
-  eSco <- GSVA:::.gsva(Biobase::exprs(expr), mapped.gset.idx.list, method, rnaseq, abs.ranking,
48
+  eSco <- GSVA:::.gsva(exprs(expr), mapped.gset.idx.list, method, rnaseq, abs.ranking,
49 49
                        no.bootstraps, bootstrap.percent, parallel.sz, parallel.type,
50 50
                        mx.diff, tau, kernel, verbose)
51
-  eScoEset <- expr
52
-  ## eScoEset <- Biobase::`exprs<-`(eScoEset, eSco$es.obs)
53
-  ## eScoEset <- Biobase::`annotation<-`(eScoEset, value="")
54
-  Biobase::exprs(eScoEset) <- eSco$es.obs
55
-  Biobase::annotation(eScoEset) <- ""
51
+  eScoEset <- new("ExpressionSet", exprs=eSco$es.obs, phenoData=phenoData(expr),
52
+                  experimentData=experimentData(expr), annotation="")
56 53
 
57 54
 	return(list(es.obs=eScoEset,
58 55
 				      bootstrap=eSco$bootstrap,
... ...
@@ -93,7 +90,7 @@ setMethod("gsva", signature(expr="ExpressionSet", gset.idx.list="GeneSetCollecti
93 90
 
94 91
   ## map gene identifiers of the gene sets to the features in the chip
95 92
   mapped.gset.idx.list <- GSEABase::mapIdentifiers(gset.idx.list,
96
-                                                   GSEABase::AnnoOrEntrezIdentifier(Biobase::annotation(expr)))
93
+                                                   GSEABase::AnnoOrEntrezIdentifier(annotation(expr)))
97 94
   
98 95
   ## map to the actual features for which expression data is available
99 96
   tmp <- lapply(geneIds(mapped.gset.idx.list),
... ...
@@ -106,14 +103,11 @@ setMethod("gsva", signature(expr="ExpressionSet", gset.idx.list="GeneSetCollecti
106 103
                                          min.sz=max(1, min.sz),
107 104
                                          max.sz=max.sz)
108 105
 
109
-  eSco <- GSVA:::.gsva(Biobase::exprs(expr), mapped.gset.idx.list, method, rnaseq, abs.ranking,
106
+  eSco <- GSVA:::.gsva(exprs(expr), mapped.gset.idx.list, method, rnaseq, abs.ranking,
110 107
                        no.bootstraps, bootstrap.percent, parallel.sz, parallel.type,
111 108
                        mx.diff, tau, kernel, verbose)
112
-  eScoEset <- expr
113
-  ## eScoEset <- Biobase::`exprs<-`(eScoEset, eSco$es.obs)
114
-  ## eScoEset <- Biobase::`annotation<-`(eScoEset, value="")
115
-  Biobase::exprs(eScoEset) <- eSco$es.obs
116
-  Biobase::annotation(eScoEset) <- ""
109
+  eScoEset <- new("ExpressionSet", exprs=eSco$es.obs, phenoData=phenoData(expr),
110
+                  experimentData=experimentData(expr), annotation="")
117 111
 
118 112
 	return(list(es.obs=eScoEset,
119 113
 				      bootstrap=eSco$bootstrap,
... ...
@@ -949,7 +943,7 @@ setMethod("computeGeneSetsOverlap", signature(gSets="GeneSetCollection", uniqGen
949 943
 setMethod("computeGeneSetsOverlap", signature(gSets="GeneSetCollection", uniqGenes="ExpressionSet"),
950 944
           function(gSets, uniqGenes, min.sz=1, max.sz=Inf) {
951 945
   ## map gene identifiers of the gene sets to the features in the chip
952
-  gSets <- GSEABase::mapIdentifiers(gSets, GSEABase::AnnoOrEntrezIdentifier(Biobase::annotation(uniqGenes)))
946
+  gSets <- GSEABase::mapIdentifiers(gSets, GSEABase::AnnoOrEntrezIdentifier(annotation(uniqGenes)))
953 947
   
954 948
   uniqGenes <- Biobase::featureNames(uniqGenes)
955 949