[Bioc-devel] mcols<-() behaviour inheriting from Vector vs GRanges
hpages at fredhutch.org
Tue Jan 5 02:32:02 CET 2016
This is fixed in S4Vectors release (0.8.6) and devel (0.9.16).
On 01/04/2016 11:52 AM, Hervé Pagès wrote:
> Hi Malcolm,
> Thanks for reporting this. Will fix.
> On 01/04/2016 10:53 AM, Malcolm Perry wrote:
>> A recent question on the support site (
>> https://support.bioconductor.org/p/76430/#76460) shows that the mcols
>> assignment in GRanges (and perhaps others) is subtly different from
>> that purely inherit from Vector (such as GenomicInteractions in the
>> example), as the GRanges method will implicitly convert a data.frame
>> to a "DataFrame".
>> Is it possible for Vector to have the same behaviour? From the users'
>> perspective it looks like a bug in the downstream package, and I guess
>> people will not spot the obvious fix.
>> PS Here is a self-contained example just using the core packages and no
>> external data:
>> representation(char_data = "character"),
>> setMethod(length, "CharacterVector", function(x) length(x at char_data))
>> char = new("CharacterVector", char_data=c("one", "two", "three"))
>> mcols(char) = data.frame(number=1:3) # will fail
>> mcols(char) = DataFrame(number=1:3) # fine
>> gr = GRanges("chr", IRanges(1, 5))
>> mcols(gr) = data.frame(name="range1")
>> [[alternative HTML version deleted]]
>> Bioc-devel at r-project.org mailing list
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