[Bioc-sig-seq] Combine GRanges Stored In A GRangesList

Steve Lianoglou mailinglist.honeypot at gmail.com
Tue Nov 30 06:10:53 CET 2010


Hi,

On Tue, Nov 30, 2010 at 12:00 AM, Dario Strbenac
<D.Strbenac at garvan.org.au> wrote:
> Hello,
>
> I have a GRangesList and some of the GRanges elements of it are replicates that I'd like to pool together. I can't get the c() to work with GRanges that are in a GRangesList.
>
>> summary(IPlist)
>     Length       Class        Mode
>          8 GRangesList          S4
>> tmp <- do.call(c, IPlist[1:2])
> Error in do.call(c, IPlist[1:2]) : second argument must be a list
>
> Is there a smarter way of achieving my use case than using c() ? I've got GenomicRanges 1.2.1.
>
> Note that it also doesn't work if I have a standard list of GRanges.
>
>> tmpList <- as.list(IPlist)
>> tmp <- do.call(c, tmpList[1:2])
>> length(tmp)
> [1] 2

Try:

R> do.call(c, unname(as.list(IPlist)))

The names() of the GRangesList is likely getting in your way here.

-steve

-- 
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-sig-sequencing mailing list