[Bioc-devel] Subsetting Lists by Lists
On 04/01/2014 10:40 AM, Tim Triche, Jr. wrote:
Hi all,
The following is tangentially related, but hopefully the answer will be useful to others (both directly and via my package, which prompts this)...
Suppose I do this:
dat <- GRangesList(
lapply( bigWigFileNames, import,
selection=someRanges ) )
Now I have a GRangesList of values, some of which have 0 ranges, some of which may have hundreds or thousands. I would like to aggregate and smooth over various subgroups of these for Gviz/trackViewer plots, so I was thinking of getting an RleList or similar out of the mcols() from each of the GRangesList atoms.
However,
1) What is the "right" (fast, idiomatic, future-safe) way to extract and combine these ranges into columns of Rles might be. I found something not-dissimilar in SpliceGraphs (or was it spliceGrapher?)
BTW, as the maintainer of the SplicingGraphs package, I'm curious about this. Would be great if you could remember what you've seen exactly and where you've seen it so I could go check and make sure that I'm using the "one true way". Thanks, H.
but I imagine this is a common operation with some efficient "one true way" to do it. 2) should I be sucking these into a genoset or SummarizedExperiment instead? I'll take the hit if I have to, once, but I don't want it to eat up all available RAM since I eventually wish to make the plotting process at least somewhat interactive (even if that means calling IGV or interactiveDisplay to do it). Thanks for any guidance you may have to offer, --t
On Apr 1, 2014, at 7:21 AM, Michael Lawrence <lawrence.michael at gene.com> wrote:
Mostly to Herve:
Sometimes we want to pluck the first 1, or 10, or whatever elements from
each element of a list. If I had a list 'x', I thought I could do this with:
x[IntegerList(1:5)]
But it only gives elements 1:5 from x[[1]], not each element of 'x'. In
other words, I thought the index would be repped out. Instead, 'x' is
subset to the length of 'i', and I'm not sure if that makes sense?
But maybe what we really want are pluckHead/Tail, which would be robust to
the case that < n elements are in an element. And of course a more general
pluck(x, i) to select 'i' from each element, but I wanted the line above to
do that.
Michael
[[alternative HTML version deleted]]
_______________________________________________ Bioc-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
_______________________________________________ Bioc-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel
Herv? Pag?s Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpages at fhcrc.org Phone: (206) 667-5791 Fax: (206) 667-1319