how to unlist a list of GappedAlignments objects
1
0
Entering edit mode
Yue Li ▴ 370
@yue-li-5245
Last seen 8.3 years ago
USA
Dear R experts, I wonder if anyone knows how to unlist a list of GappedAlignments objects. Simply using unlist does not work b/c each GappedAlignments element of the list is compound. A brute-force way is to run a for loop and use 'append' to append each element to a GappedAlignments object. But this way is painfully slow. Yue
• 776 views
ADD COMMENT
0
Entering edit mode
@steve-lianoglou-2771
Last seen 14 months ago
United States
Hi, On Mon, May 7, 2012 at 7:27 PM, Yue Li <gorillayue at="" gmail.com=""> wrote: > Dear R experts, > > I wonder if anyone knows how to unlist a list of GappedAlignments objects. > > Simply using unlist does not work b/c each GappedAlignments element of the list is compound. > > A brute-force way is to run a for loop and use 'append' to append each element to a GappedAlignments object. But this way is painfully slow. Does something like this work?: R> unlisted <- do.call(c, your.gapped.alignment.list) -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
ADD COMMENT
0
Entering edit mode
Hi Steve, That works wonderfully! Thank you so much! Yue On 2012-05-07, at 9:21 PM, Steve Lianoglou wrote: > Hi, > > On Mon, May 7, 2012 at 7:27 PM, Yue Li <gorillayue at="" gmail.com=""> wrote: >> Dear R experts, >> >> I wonder if anyone knows how to unlist a list of GappedAlignments objects. >> >> Simply using unlist does not work b/c each GappedAlignments element of the list is compound. >> >> A brute-force way is to run a for loop and use 'append' to append each element to a GappedAlignments object. But this way is painfully slow. > > Does something like this work?: > > R> unlisted <- do.call(c, your.gapped.alignment.list) > > -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
ADD REPLY

Login before adding your answer.

Traffic: 722 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6