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")
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
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
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
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
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
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