[BioC] gdata affects LumiBatch::combine method

Martin Morgan mtmorgan at fhcrc.org
Tue Oct 9 22:06:03 CEST 2012


On 10/08/2012 09:40 PM, Mark Cowley wrote:
> Dear list,
> i'm trying to combine two LumiBatch objects, using the S4 combine("LumiBatch","LumiBatch") method, defined originally in BiocGenerics, and enhanced within lumi.
> In a fresh session, with just lumi loaded, everything works fine, i.e. I get a LumiBatch object.
> As soon as I load gdata, this breaks the combine method, instead returning a data.frame with very odd dimensions. This is true if I load gdata before, or after lumi. Note that showMethods("lumi") doesn't change after loading gdata. Any ideas?

Hi Mark -- unfortunately, this is not easily avoidable. gdata (a CRAN  package) 
defines its own function combine that masks the version used by lumi and other 
Bioconductor packages. The work-around is to invoke lumi's combine with, e.g.,

lumi::combine(x = example.lumi[, 1], y = example.lumi[, 3])

If gdata were in Bioconductor, we could coerce the author into writing a method 
for combine, as defined in BiocGenerics. If you were writing a package, then you 
could importMethodsFrom(lumi, combine) and use combine safely in your own 
package code whether or not gdata was on the search path.

Martin

> cheers,
> Mark
>
> ### lumi, then gdata
>> suppressPackageStartupMessages(library(lumi))
> Warning messages:
> 1: found methods to import for function ‘eapply’ but not the generic itself
> 2: replacing previous import ‘image’ when loading ‘graphics’
>> load("Rmisc/n525.RDa")
>> load("Rmisc/s295.RDa")
>> showMethods("combine")
> Function: combine (package BiocGenerics)
> x="AnnotatedDataFrame", y="AnnotatedDataFrame"
> x="ANY", y="missing"
> x="AssayData", y="AssayData"
> x="data.frame", y="data.frame"
> x="eSet", y="eSet"
> x="ExpressionSet", y="LumiBatch"
> x="LumiBatch", y="ExpressionSet"
> x="LumiBatch", y="LumiBatch"
> x="matrix", y="matrix"
> x="MethyLumiM", y="MethyLumiM"
> x="MethyLumiQC", y="MethyLumiQC"
> x="MethyLumiSet", y="MethyLumiSet"
> x="MIAME", y="MIAME"
>
>> a <- combine(n525, s295)
>> class(a)
> [1] "LumiBatch"
> attr(,"package")
> [1] "lumi"
> ## the expected output
>
>> suppressPackageStartupMessages(library(gdata))
>> showMethods("combine")
> Function: combine (package BiocGenerics)
> x="AnnotatedDataFrame", y="AnnotatedDataFrame"
> x="ANY", y="missing"
> x="AssayData", y="AssayData"
> x="data.frame", y="data.frame"
> x="environment", y="environment"
>      (inherited from: x="AssayData", y="AssayData")
> x="eSet", y="eSet"
> x="ExpressionSet", y="LumiBatch"
> x="LumiBatch", y="ExpressionSet"
> x="LumiBatch", y="LumiBatch"
> x="matrix", y="matrix"
> x="MethyLumiM", y="MethyLumiM"
> x="MethyLumiQC", y="MethyLumiQC"
> x="MethyLumiSet", y="MethyLumiSet"
> x="MIAME", y="MIAME"
>
>> a <- combine(n525, s295)
>> class(a)
> [1] "data.frame"
>>
>
>
> #### gdata then lumi
>> suppressPackageStartupMessages(library(gdata))
>> suppressPackageStartupMessages(library(lumi))
> Warning messages:
> 1: found methods to import for function ‘eapply’ but not the generic itself
> 2: replacing previous import ‘image’ when loading ‘graphics’
>> load("Rmisc/n525.RDa")
>> load("Rmisc/s295.RDa")
>> showMethods("combine")
> Function: combine (package BiocGenerics)
> x="AnnotatedDataFrame", y="AnnotatedDataFrame"
> x="ANY", y="missing"
> x="AssayData", y="AssayData"
> x="data.frame", y="data.frame"
> x="eSet", y="eSet"
> x="ExpressionSet", y="LumiBatch"
> x="LumiBatch", y="ExpressionSet"
> x="LumiBatch", y="LumiBatch"
> x="matrix", y="matrix"
> x="MethyLumiM", y="MethyLumiM"
> x="MethyLumiQC", y="MethyLumiQC"
> x="MethyLumiSet", y="MethyLumiSet"
> x="MIAME", y="MIAME"
>
>> a <- combine(n525, s295)
>> class(a)
> [1] "LumiBatch"
> attr(,"package")
> [1] "lumi"
>
>
>> sessionInfo()
> R version 2.15.1 (2012-06-22)
> Platform: i386-apple-darwin9.8.0/i386 (32-bit)
>
> locale:
> [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] lumi_2.10.0        nleqslv_1.9.4      Biobase_2.18.0     BiocGenerics_0.4.0
> [5] gdata_2.12.0
>
> loaded via a namespace (and not attached):
>   [1] affy_1.36.0           affyio_1.26.0         annotate_1.36.0
>   [4] AnnotationDbi_1.20.0  BiocInstaller_1.8.1   colorspace_1.1-1
>   [7] DBI_0.2-5             grid_2.15.1           gtools_2.7.0
> [10] IRanges_1.16.2        KernSmooth_2.23-8     lattice_0.20-10
> [13] MASS_7.3-22           Matrix_1.0-9          methylumi_2.4.0
> [16] mgcv_1.7-21           nlme_3.1-104          parallel_2.15.1
> [19] preprocessCore_1.20.0 RSQLite_0.11.2        stats4_2.15.1
> [22] XML_3.95-0.1          xtable_1.7-0          zlibbioc_1.4.0
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>


-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the Bioconductor mailing list