[Bioc-sig-seq] adding columns to values of GenomicRange objects
mailinglist.honeypot at gmail.com
Mon Aug 23 23:00:54 CEST 2010
On Mon, Aug 23, 2010 at 4:14 PM, Jiang, Lichun (NIH/NIDDK) [F]
<jianglichun at niddk.nih.gov> wrote:
> Hi Dear all,
> I am a newbie using GRanges and related packages. Try to figure out how can I add an column of values to the GenomicRanges.
> For example I get a object named as TF_peaks:
> GRanges with 2000 ranges and 3 elementMetadata values
> seqnames ranges strand | elementMetadata.polIIsignal elementMetadata.inputSignal elementMetadata.enrichment
> <Rle> <IRanges> <Rle> | <integer> <integer> <numeric>
>  chr1 [205566106, 205576720] * | 1504 4 382.2567
>  chr1 [ 11890546, 11892791] * | 1140 4 347.6909
> I tried to add another value to describe whether this features are overlapping with promoters(I already has this value as inpromoteres for example ).
> But I can't add this value to the TF_peaks object by standard function for dataframe manipulation. I guess I am not fully understand the S4 methods. Anyone can help me out?
How did you try to do it?
You have to "get" the DataFrame associated with your GRanges object
using the `values` or `elementMetadata` function, which you could then
manipulate as you (probably) are expecting to. So, you simply have to:
R> values(TF_peas)$overlaps <- inpromoteres
or variation above, given the column name you want to store this
under, and the variable name you have your 'overlapping' info in.
Hope that helps,
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-sig-sequencing