Thanks for the quick reply, this works perfectly, I was working with an
older IRanges version.

Take care,

David


On Tue, Nov 10, 2009 at 6:53 PM, Steve Lianoglou <
[email protected]> wrote:

> Hi,
>
>
> On Nov 10, 2009, at 11:54 AM, David Rossell wrote:
>
>  Hi, I'm frequently faced with the need to convert a regular list of
>> IRanges
>> objects to an IRangesList object. However, there doesn't seem to be an
>> as(x,"IRangesList") coercer when x is a list.
>>
>> I know I can use the constructor IRanges(x[[1]],x[[2]],x[[3]]) but this is
>> not very convenient when x is a long list. I searched around but I
>> couldn't
>> find anything about this topic. Am I missing something obvious? Help
>> anyone?
>>
>
> What version of IRanges are you using? I have v.1.5.4 installed right now
> and this works for me:
>
> R> il <- list(IRanges(start=c(1, 5, 30), end=c(20, 30, 50)),
>             IRanges(start=c(100, 200, 300), end=c(110, 210, 310)))
>
> R> IRangesList(il)
> CompressedIRangesList of length 2
> [[1]]
> IRanges of length 3
>    start end width
> [1]     1  20    20
> [2]     5  30    26
> [3]    30  50    21
>
> [[2]]
> IRanges of length 3
>    start end width
> [1]   100 110    11
> [2]   200 210    11
> [3]   300 310    11
>
> Isn't that what you're after?
>
> -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<http://cbio.mskcc.org/%7Elianos/contact>
>
>


-- 
David Rossell, PhD
Manager, Bioinformatics and Biostatistics unit
IRB Barcelona
Tel (+34) 93 402 0217
Fax (+34) 93 402 0257
http://www.irbbarcelona.org/bioinformatics

        [[alternative HTML version deleted]]

_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

Reply via email to