[BioC] need to clarify RangedData documentation?
Michael Dondrup
Michael.Dondrup at uni.no
Wed Nov 3 16:50:21 CET 2010
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.
Cheers
Michael
On Nov 3, 2010, at 4:38 PM, Steve Lianoglou wrote:
> Hi,
>
> On Wed, Nov 3, 2010 at 10:35 AM, Michael Dondrup <Michael.Dondrup at uni.no> wrote:
>> Hi,
>>
>> I am trying to create a RangedData object and then add a DataFrame of extra annotation columns in a second step.
>> From the documentation of the method columnMetadata, I was assuming this function was meant to do this,
>> but it doesn't seem to work. The documentation says:
>>
>> "columnMetadata(x): Get the DataFrame of metadata along the value columns, i.e., where each column in x is represented by a row in the metadata. Note that calling elementMetadata(x)returns the metadata on each space in x.
>> columnMetadata(x) <- value: Set the DataFrame of metadata for the columns."
>>
>> After reading this more closely, I wasn't able to figure what this really means, and I didn't get it to work at all.
>> Can someone clarify what this is for?
>
> I think you want to be using elementMetadata() or its alias values().
>
> I guess columnMetadata is supposed to hold information about the
> columns(?) but I'm not quite sure ... I've never used it before.
>
> For example:
>
> R> rd = RangedData(ranges=IRanges(start=1:2, width=1), space=1, somedata=1:2)
> R> values(rd) <- DataFrame(something.else=100:101)
> R> rd
> RangedData with 2 rows and 1 value column across 1 space
> space ranges | something.else
> <character> <IRanges> | <integer>
> 1 1 [1, 1] | 100
> 2 1 [2, 2] | 101
>
> Hope that helps,
> -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