On Wed, Nov 3, 2010 at 9:07 AM, Steve Lianoglou <
mailinglist.honeypot@gmail.com> wrote:

> On Wed, Nov 3, 2010 at 11:50 AM, Michael Dondrup <Michael.Dondrup@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@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.
>
>
RangedData used values() before it became an alias for elementMetadata(). A
RangedData is a sequence along the chromosomes (spaces), so the
elementMetadata of a RangedData is chromosome-level metadata. Thus,
RangedData gives you metadata on your ranges (the values, although I don't
really think of this as metadata.. that's more the GRanges mindset), the
chromsomes, and the variables in values().

Make sense?

Michael

-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<http://cbio.mskcc.org/%7Elianos/contact>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

