Re: [Bioc-devel] 'GRangesList' does not keep metadata of items

2013-09-03 Thread Hervé Pagès
Hi Julian, Michael, Alternatively a trick is to use the outer mcols of the GRangesList object. If the experimental metadata of each GRanges has the same structure/fields, and those fields contain single values: library(GenomicRanges) gr1 <- GRanges() metadata(gr1) = list(a="1", b="hello")

Re: [Bioc-devel] 'GRangesList' does not keep metadata of items

2013-09-03 Thread Hervé Pagès
Related to the storage of a list inside a DataFrame (as a column), I found 2 issues: df <- DataFrame(A=I(list(a=1:3, b="BB"))) 1. The name of the col is not as specified: > df DataFrame with 2 rows and 1 column X 1 2 2. rbind() doesn't

Re: [Bioc-devel] 'GRangesList' does not keep metadata of items

2013-09-03 Thread Julian Gehring
Hi Michael, Thanks, using 'GenomicRangesList' instead of 'GRangesList' essentially solves my issues. Could you please add a small note to the documentation that mentions the different behaviors for the two classes? Best wishes Julian On 09/03/2013 03:34 PM, Michael Lawrence wrote: If the

Re: [Bioc-devel] 'GRangesList' does not keep metadata of items

2013-09-03 Thread Michael Lawrence
If the number of GRanges is small (not thousands), and you don't need the semantic of treating each GRanges as a "compound range", then use GenomicRangesList(). It's a SimpleList, so metadata should be preserved. It's the data structure for storing per-sample GRanges. Michael On Tue, Sep 3, 2013

Re: [Bioc-devel] 'GRangesList' does not keep metadata of items

2013-09-03 Thread Julian Gehring
Hi Michael, The use case is storing experimental metadata togther with a GRanges object that does not fit the tabular structure of a GRange. And at a later stage, storing multiple of these annotated GRanges objects together as a list/GRangesList. Best wishes Julian This second case is ex

Re: [Bioc-devel] 'GRangesList' does not keep metadata of items

2013-09-02 Thread Michael Lawrence
On Mon, Sep 2, 2013 at 12:38 AM, Julian Gehring wrote: > Hi, > > It seems to me that constructing a 'GRangesList' object containing > 'GRanges' with metadata does not keep the metadata. As an example: > > * Example 1 > > library(GenomicRanges) > gr = GRanges() > metadata(gr) = list(a = "1") > met

[Bioc-devel] 'GRangesList' does not keep metadata of items

2013-09-02 Thread Julian Gehring
Hi, It seems to me that constructing a 'GRangesList' object containing 'GRanges' with metadata does not keep the metadata. As an example: * Example 1 library(GenomicRanges) gr = GRanges() metadata(gr) = list(a = "1") metadata(gr) ## the metadata was stored grl = GRangesList(gr, gr) ## put it