[Bioc-devel] problem with class definitions between S4Vectors and RNeXML in using Summarized Experiment

Hervé Pagès hpages at fredhutch.org
Sat Apr 14 10:05:55 CEST 2018


How about renaming Annotated? Isn't having 2 classes around with the
same name fundamentally a bad situation? No amount of workarounds will
change that.

H.

On 04/12/2018 04:06 PM, Michael Lawrence wrote:
> Yea, good idea, I was thinking of supporting :: in class names and
> parsing them out. In code is better.  Maybe %::%? It wouldn't have to
> get a class object (for one thing, a class might not exist), because
> the methods package supports a 'package' attribute on the character
> vector, abstracted by packageSlot().
> 
> 
> 
> On Thu, Apr 12, 2018 at 3:26 PM, Vincent Carey
> <stvjc at channing.harvard.edu> wrote:
>> If we need to disambiguate class references, perhaps an operator
>>
>> could help?  Along the lines of base::"::" ...
>>
>>
>> "%c%" <- function(package,class) {
>>
>>     pk = as.character(substitute(package))
>>
>>     cl = as.character(substitute(class))
>>
>>     getClass(cl, where=getNamespace(pk))
>>
>> }
>>
>>
>> Biobase %c% ExpressionSet  # a classRepresentation instance
>>
>>
>> is(1:5, Biobase %c% ExpressionSet)  # FALSE
>>
>>
>> is(Biobase::ExpressionSet(), "ExpressionSet")  # TRUE
>>
>>
>> is(Biobase::ExpressionSet(),  Biobase %c% ExpressionSet) # TRUE
>>
>>
>>
>>
>>
>>
>> On Thu, Apr 12, 2018 at 3:57 PM, Michael Lawrence
>> <lawrence.michael at gene.com> wrote:
>>>
>>> Hi Davide,
>>>
>>> We can get this fixed soon, but I was hoping to hear e.g. Herve's
>>> opinion first if he has one.
>>>
>>> Michael
>>>
>>> On Thu, Apr 12, 2018 at 12:53 PM, Davide Risso <dar2062 at med.cornell.edu>
>>> wrote:
>>>> Hi Michael,
>>>>
>>>> Thanks for looking into this.
>>>>
>>>> Can you or someone with push permission to S4Vectors implement the
>>>> workaround that you mentioned?
>>>>
>>>> Happy to create a pull request on Github if that helps.
>>>>
>>>> We’re trying to solve this to fix the clusterExperiment package build on
>>>> Bioc-devel.
>>>>
>>>> Thanks,
>>>> Davide
>>>>
>>>>
>>>> On Apr 12, 2018, at 1:27 PM, Michael Lawrence
>>>> <lawrence.michael at gene.com>
>>>> wrote:
>>>>
>>>> Yea it's basically
>>>>
>>>> library(S4Vectors)
>>>> library(RNeXML)
>>>> is(1:5, "Annotated")
>>>> # Found more than one class "Annotated" in cache; using the first,
>>>> from namespace 'S4Vectors'
>>>> # Also defined by ‘RNeXML’
>>>> # [1] FALSE
>>>>
>>>> But can be worked around:
>>>>
>>>> is(1:5, getClass("Annotated", where=getNamespace("S4Vectors"))
>>>>
>>>> # [1] FALSE
>>>>
>>>> Of course, using class objects instead of class names in every call to
>>>> is() is not very palatable, but that's how it's done in all other
>>>> languages, as far as I know.
>>>>
>>>> There is an inconsistency between new() and is() when resolving the
>>>> class name. new() looks into the calling package's namespace, while
>>>> is() looks at the package for the class of the 'object'. The new()
>>>> approach seems sensible for that function, since packages should be
>>>> abstracting the construction of their objects with constructors. The
>>>> is() approach is broken though, because it's easy to imagine cases
>>>> like where some foreign object is passed to a function, and the
>>>> function checks the type with is().
>>>>
>>>> I can change is() to use the calling package as the fallback, so
>>>> DataFrame(1:5) no longer produces a message. But calling it from
>>>> another package, or global env, will still break, just like new(). How
>>>> does that sound?
>>>>
>>>> On the other hand, maybe we should be more careful with calls to is()
>>>> and use class objects. That's a good workaround in this case, anyway,
>>>> since I probably can't get the change into R before release.
>>>>
>>>> Michael
>>>>
>>>>
>>>> On Thu, Apr 12, 2018 at 9:03 AM, Aaron Lun <alun at wehi.edu.au> wrote:
>>>>
>>>> Well, it's not really SingleCellExperiment's problem, either.
>>>>
>>>> library(S4Vectors)
>>>> DataFrame(1:5) # Silent, okay.
>>>> library(RNeXML)
>>>> DataFrame(1:5) # Prints out the message
>>>> ## Found more than one class "Annotated" in cache; using the first,
>>>> from namespace 'S4Vectors'
>>>> ## Also defined by ‘RNeXML’
>>>>
>>>> Session information attached below.
>>>>
>>>> -Aaron
>>>>
>>>> sessionInfo()
>>>>
>>>> R Under development (unstable) (2018-03-26 r74466)
>>>> Platform: x86_64-pc-linux-gnu (64-bit)
>>>> Running under: Ubuntu 16.04.4 LTS
>>>>
>>>> Matrix products: default
>>>> BLAS: /home/cri.camres.org/lun01/Software/R/trunk/lib/libRblas.so
>>>> LAPACK: /home/cri.camres.org/lun01/Software/R/trunk/lib/libRlapack.so
>>>>
>>>> locale:
>>>> [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
>>>> [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
>>>> [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8
>>>> [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
>>>> [9] LC_ADDRESS=C               LC_TELEPHONE=C
>>>> [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
>>>>
>>>> attached base packages:
>>>> [1] parallel  stats4    stats     graphics  grDevices
>>>> utils     datasets
>>>> [8] methods   base
>>>>
>>>> other attached packages:
>>>> [1] RNeXML_2.0.8        ape_5.1             S4Vectors_0.17.41
>>>> [4] BiocGenerics_0.25.3
>>>>
>>>> loaded via a namespace (and not attached):
>>>> [1] Rcpp_0.12.16        compiler_3.6.0      pillar_1.2.1
>>>> [4] plyr_1.8.4          bindr_0.1.1         iterators_1.0.9
>>>> [7] tools_3.6.0         uuid_0.1-2          jsonlite_1.5
>>>> [10] tibble_1.4.2        nlme_3.1-137        lattice_0.20-35
>>>> [13] pkgconfig_2.0.1     rlang_0.2.0         foreach_1.4.4
>>>> [16] crul_0.5.2          curl_3.2            bindrcpp_0.2.2
>>>> [19] httr_1.3.1          stringr_1.3.0       dplyr_0.7.4
>>>> [22] xml2_1.2.0          grid_3.6.0          reshape_0.8.7
>>>> [25] glue_1.2.0          data.table_1.10.4-3 R6_2.2.2
>>>> [28] XML_3.98-1.10       purrr_0.2.4         reshape2_1.4.3
>>>> [31] tidyr_0.8.0         magrittr_1.5        codetools_0.2-15
>>>> [34] assertthat_0.2.0    bold_0.5.0          taxize_0.9.3
>>>> [37] stringi_1.1.7       lazyeval_0.2.1      zoo_1.8-1
>>>>
>>>>
>>>> On Thu, 2018-04-12 at 17:40 +0200, Elizabeth Purdom wrote:
>>>>
>>>> Just to follow up on my previous post. I am able to replicate the
>>>> problem in the problem like in the github post from 2 years ago (http
>>>> s://github.com/epurdom/clusterExperiment/issues/66
>>>>
>>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_epurdom_clusterExperiment_issues_66&d=DwIFaQ&c=lb62iw4YL4RFalcE2hQUQealT9-RXrryqt9KZX2qu2s&r=27RAi9XMaRMwPy47RdOGbLATWZ3jxxsvAC3lBQmEVTo&m=FD3EbY8tWuTuwKQOAOgm-DLN6S1TI6KmPXPitPvrUgI&s=PsCvulwKcgNnhI8OtnUfHYf8C9LuPyz9sGQmzKhL_rc&e=>)
>>>> only now it
>>>>
>>>> is not the SummarizedExperiment class but the SingleCellExperiment
>>>> class that has the problem. [And I was incorrect, the problem does
>>>> occur in  development version 2018-03-22 r74446].
>>>>
>>>> So this is actually a problem with the SingleCellExperiment package —
>>>> sorry for the incorrect subject line.
>>>>
>>>> All of the best,
>>>> Elizabeth
>>>>
>>>>
>>>>
>>>> library(SingleCellExperiment)
>>>> SingleCellExperiment()
>>>>
>>>> class: SingleCellExperiment
>>>> dim: 0 0
>>>> metadata(0):
>>>> assays(0):
>>>> rownames: NULL
>>>> rowData names(0):
>>>> colnames: NULL
>>>> colData names(0):
>>>> reducedDimNames(0):
>>>> spikeNames(0):
>>>>
>>>>
>>>> library(RNeXML)
>>>>
>>>> Loading required package: ape
>>>>
>>>>
>>>>
>>>> SingleCellExperiment()
>>>>
>>>> Found more than one class "Annotated" in cache; using the first,
>>>> from namespace 'S4Vectors'
>>>> Also defined by ‘RNeXML’
>>>> Found more than one class "Annotated" in cache; using the first,
>>>> from namespace 'S4Vectors'
>>>> Also defined by ‘RNeXML’
>>>> class: SingleCellExperiment
>>>> dim: 0 0
>>>> metadata(0):
>>>> assays(0):
>>>> rownames: NULL
>>>> rowData names(0):
>>>> colnames: NULL
>>>> colData names(0):
>>>> reducedDimNames(0):
>>>> spikeNames(0):
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> sessionInfo()
>>>>
>>>> R Under development (unstable) (2018-03-22 r74446)
>>>> Platform: x86_64-apple-darwin15.6.0 (64-bit)
>>>> Running under: OS X El Capitan 10.11.6
>>>>
>>>> Matrix products: default
>>>> BLAS:
>>>> /System/Library/Frameworks/Accelerate.framework/Versions/A/Framewor
>>>> ks/vecLib.framework/Versions/A/libBLAS.dylib
>>>> LAPACK:
>>>> /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapa
>>>> ck.dylib
>>>>
>>>> locale:
>>>> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>>>>
>>>> attached base packages:
>>>> [1] parallel  stats4    stats     graphics  grDevices
>>>> utils     datasets  methods   base
>>>>
>>>> other attached packages:
>>>> [1]
>>>> RNeXML_2.0.8                ape_5.1                     SingleCellE
>>>> xperiment_1.1.2
>>>> [4] SummarizedExperiment_1.9.16
>>>> DelayedArray_0.5.30         BiocParallel_1.13.3
>>>> [7]
>>>> matrixStats_0.53.1          Biobase_2.39.2              GenomicRang
>>>> es_1.31.23
>>>> [10]
>>>> GenomeInfoDb_1.15.5         IRanges_2.13.28             S4Vectors_0
>>>> .17.41
>>>> [13] BiocGenerics_0.25.3
>>>>
>>>> loaded via a namespace (and not attached):
>>>> [1]
>>>> Rcpp_0.12.16           pillar_1.2.1           bindr_0.1.1
>>>>   compiler_3.5.0
>>>> [5]
>>>> plyr_1.8.4             XVector_0.19.9         iterators_1.0.9
>>>>   bitops_1.0-6
>>>> [9] tools_3.5.0            zlibbioc_1.25.0        uuid_0.1-
>>>> 2             tibble_1.4.2
>>>> [13] jsonlite_1.5           nlme_3.1-137           lattice_0.20-
>>>> 35        pkgconfig_2.0.1
>>>> [17] rlang_0.2.0            Matrix_1.2-
>>>> 14          foreach_1.4.4          crul_0.5.2
>>>> [21]
>>>> curl_3.2               bindrcpp_0.2.2         GenomeInfoDbData_1.1.
>>>> 0 dplyr_0.7.4
>>>> [25]
>>>> httr_1.3.1             stringr_1.3.0          xml2_1.2.0
>>>>   grid_3.5.0
>>>> [29]
>>>> glue_1.2.0             reshape_0.8.7          data.table_1.10.4-
>>>> 3    R6_2.2.2
>>>> [33] XML_3.98-
>>>> 1.10          purrr_0.2.4            tidyr_0.8.0            reshape
>>>> 2_1.4.3
>>>> [37] magrittr_1.5           codetools_0.2-
>>>> 15       assertthat_0.2.0       bold_0.5.0
>>>> [41]
>>>> taxize_0.9.3           stringi_1.1.7          lazyeval_0.2.1
>>>>   RCurl_1.95-4.10
>>>> [45] zoo_1.8-1
>>>>
>>>>
>>>>
>>>> On Apr 11, 2018, at 10:25 AM, Elizabeth Purdom <epurdom at stat.Berkel
>>>> ey.EDU> wrote:
>>>>
>>>> Hello,
>>>>
>>>> Our package clusterExperiment has suddenly started producing errors
>>>> in the bioconductor devel branch because our unit tests are
>>>> failing, even though we haven’t pushed any changes and they passed
>>>> previously. We first noticed this on April 5th.
>>>>
>>>> I believe the source of these errors likely do to calls to
>>>> SummarizedExperiment() creating the following messages due to
>>>> conflicts in ‘RNeXML’ and ’S4Vectors’ both defining class
>>>> ‘Annotated':
>>>>
>>>>
>>>> Found more than one class "Annotated" in cache; using the first,
>>>> from namespace 'S4Vectors'
>>>> Also defined by ‘RNeXML’
>>>>
>>>> This is killing a vast number of our tests where we repeatedly use
>>>> ‘expect_silent’ calls in our unit tests and SummarizedExperiment
>>>> calls underlie everything.
>>>>
>>>> We had this message issue two years ago
>>>>
>>>> (https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_epurdom&d=DwIFaQ&c=lb62iw4YL4RFalcE2hQUQealT9-RXrryqt9KZX2qu2s&r=27RAi9XMaRMwPy47RdOGbLATWZ3jxxsvAC3lBQmEVTo&m=FD3EbY8tWuTuwKQOAOgm-DLN6S1TI6KmPXPitPvrUgI&s=QasLVQB428Ql4woG4ckrA0ljZSLRUgylm3PdN1fOn00&e=
>>>> /clusterExperiment/issues/66
>>>>
>>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_epurdom_clusterExperiment_issues_66&d=DwIFaQ&c=lb62iw4YL4RFalcE2hQUQealT9-RXrryqt9KZX2qu2s&r=27RAi9XMaRMwPy47RdOGbLATWZ3jxxsvAC3lBQmEVTo&m=FD3EbY8tWuTuwKQOAOgm-DLN6S1TI6KmPXPitPvrUgI&s=PsCvulwKcgNnhI8OtnUfHYf8C9LuPyz9sGQmzKhL_rc&e=>),
>>>> when it
>>>> appeared to be a problem with two definitions of the ‘Annotated’
>>>> class in two packages that are both dependencies of packages we
>>>> call. At that time, Michael Lawrence posted that he would fix the
>>>> problem, and it was then fixed in later versions of bioconductor/R.
>>>> But it appears to be back.  I am unfortunately unable to get the
>>>> RNeXML package to compile from source on my computer with the
>>>> current Mac OS X development binary which I just downloaded (2018-
>>>> 04-05 r74542), so I haven’t been able to completely redo the code
>>>> that we presented in that earlier github issue to confirm it is the
>>>> exact same problem. I am having to rely on the error reports/logs
>>>> from both Bioconductor and TravisCI (e.g. 2018-04-07 r74551), where
>>>> this message shows up everywhere and didn’t before. Thus I’m
>>>> guessing that since they are the same messages from before that the
>>>> source is again the call to SummarizedExperiment.
>>>>
>>>> I would note that in development version 2018-03-22 r74446, where I
>>>> was able to install all of the packages, I was not getting these
>>>> messages.
>>>>
>>>> Thanks,
>>>> Elizabeth Purdom
>>>>
>>>>
>>>>       [[alternative HTML version deleted]]
>>>>
>>>> _______________________________________________
>>>> Bioc-devel at r-project.org mailing list
>>>>
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_bioc-2Ddevel&d=DwIFaQ&c=lb62iw4YL4RFalcE2hQUQealT9-RXrryqt9KZX2qu2s&r=27RAi9XMaRMwPy47RdOGbLATWZ3jxxsvAC3lBQmEVTo&m=FD3EbY8tWuTuwKQOAOgm-DLN6S1TI6KmPXPitPvrUgI&s=sgZkMo8EM5lXrra1obmPLWz4H4hrqm1Y2HhQRwa8IaA&e=
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Bioc-devel at r-project.org mailing list
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_bioc-2Ddevel&d=DwIFaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=fol6oIBKr5fVzLGchc4RvlrsYKehauLVF5_G-LWRaXM&s=UovEzK2nsWLv9tn6_XmxsASzSfuAFOLSHTrOousDJOY&e=
>>
>>
> 
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_bioc-2Ddevel&d=DwIFaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=fol6oIBKr5fVzLGchc4RvlrsYKehauLVF5_G-LWRaXM&s=UovEzK2nsWLv9tn6_XmxsASzSfuAFOLSHTrOousDJOY&e=
> 

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioc-devel mailing list