[BioC] need to clarify RangedData documentation?
Steve Lianoglou
mailinglist.honeypot at gmail.com
Wed Nov 3 17:07:07 CET 2010
On Wed, Nov 3, 2010 at 11:50 AM, Michael Dondrup <Michael.Dondrup at uni.no> wrote:
> Hi Steve,
>
> yes values() was what I was looking for, thank you, I am getting confused about the IRanges objects ever now and then.
> As for elementMetadata(), maybe it was changed for the latest bioc release but it doesn't do the same thing:
>
>>rd = RangedData(ranges=IRanges(start=1:2, width=1), space=1)
>> values(rd) = DataFrame(somedata=1:2)
>> rd
> RangedData with 2 rows and 1 value column across 1 space
> space ranges | somedata
> <character> <IRanges> | <integer>
> 1 1 [1, 1] | 1
> 2 1 [2, 2] | 2
>> elementMetadata(rd) = DataFrame(somedata=1:2)
> Error in .local(x, ..., value) :
> the number of rows in elementMetadata 'value' (if non-NULL) must match the length of 'x'
>
> Now I even more think the documentation needs some clarifications. I would like to help, if I understood what
> was really going on.
I see ... strange. So I know that values is an alias for
elementMetadata for IRanges and GRanges, since they inherit this from
sequence:
R> getMethod('values', 'Sequence')
Method Definition:
function (x, ...)
elementMetadata(x, ...)
<environment: namespace:IRanges>
Signatures:
x
target "Sequence"
defined "Sequence"
I thought this was universal throughout the classes defined in IRanges
... I'm not quite sure why values() becomes "the primary" function for
RangedData (ie. it returns the RangedData at values object) ... maybe
this slot was added to RangedData afterwards and didn't bring the
baggage of the originally named elementMetadata slot/method with it?
I'll let the core devs field that Q.
-steve
--
Steve Lianoglou
Graduate Student: Computational Systems Biology
| Memorial Sloan-Kettering Cancer Center
| Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact
More information about the Bioconductor
mailing list