[Bioc-devel] Meta data access with $ for GRanges vs RangedData vs data.frame

Steve Lianoglou mailinglist.honeypot at gmail.com
Mon Mar 19 13:50:39 CET 2012

Hi Tim,

On Mon, Mar 19, 2012 at 8:02 AM, Tim Yates <TYates at picr.man.ac.uk> wrote:

> `$.GRanges`   = function( x, name )        {
>  elementMetadata( x )[[ name ]]
> }
> `$<-.GRanges` = function( x, name, value ) {
>  elementMetadata( x )[[ name ]] = value
>  x
> }
> Then all the above functions behave in a similar fashion, however I don't want to do this in my package, as I believe it will be a gateway to namespace hell…
> Is there any plan to add this accessor operator to Granges so that access is normalised across all three of these types?

This does seem to come up every now and again. Most recently (I think)
in this post:


There is a *technically* correct reason as to why there's no `$`
accessor on GRanges that is explained there by Martin (it has to do w/
GRanges extending the Vector class), but still ... it seems that some
of us feel like we still want it, even if it's bad for us. :-)


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 Bioc-devel mailing list