export a GappedAlignment object to a BAM file
1
0
Entering edit mode
Yue Li ▴ 370
@yue-li-5245
Last seen 8.3 years ago
USA
Dear List, I wonder if there's a way to export a GappedAlignment object to a bam file. rtracklayer 'export' function exports gff, bed, bed15, bedGraph but not bam. It also does not recognize GappedAlignment class. One could reformat the GappedAlignment object into a SAM-like table, write.table it to a local disk, and then use 'asBAM' to convert that file to BAM. But that seems a little cumbersome. Thanks much, Yue
convert convert • 1.3k views
ADD COMMENT
0
Entering edit mode
@michael-lawrence-3846
Last seen 2.4 years ago
United States
Good point. We should add GappedAlignments export to BAM into rtracklayer. I recently added BAM import to devel. Without any help from Rsamtools though, we would need to use the strategy that you outline: write out a SAM file and asBam() it. That's not so bad though. Do you think you could submit this as a patch? Thanks, Michael On Tue, May 8, 2012 at 6:24 AM, Yue Li <gorillayue@gmail.com> wrote: > Dear List, > > I wonder if there's a way to export a GappedAlignment object to a bam file. > > rtracklayer 'export' function exports gff, bed, bed15, bedGraph but not > bam. It also does not recognize GappedAlignment class. > > One could reformat the GappedAlignment object into a SAM-like table, > write.table it to a local disk, and then use 'asBAM' to convert that file > to BAM. But that seems a little cumbersome. > > Thanks much, > Yue > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
Hi Michael, Sure. I am working on it and will let you know once it is ready. Basically, we need a function (e.g. exportGappedAlignments) or an inheritance method something like export.GappedAlignments to export the objects of that class, right? Thanks, Yue On 2012-05-08, at 9:37 AM, Michael Lawrence wrote: > Good point. We should add GappedAlignments export to BAM into rtracklayer. I recently added BAM import to devel. Without any help from Rsamtools though, we would need to use the strategy that you outline: write out a SAM file and asBam() it. That's not so bad though. Do you think you could submit this as a patch? > > Thanks, > Michael > > On Tue, May 8, 2012 at 6:24 AM, Yue Li <gorillayue@gmail.com> wrote: > Dear List, > > I wonder if there's a way to export a GappedAlignment object to a bam file. > > rtracklayer 'export' function exports gff, bed, bed15, bedGraph but not bam. It also does not recognize GappedAlignment class. > > One could reformat the GappedAlignment object into a SAM-like table, write.table it to a local disk, and then use 'asBAM' to convert that file to BAM. But that seems a little cumbersome. > > Thanks much, > Yue > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
On 05/08/2012 07:07 AM, Yue Li wrote: > Hi Michael, > > Sure. I am working on it and will let you know once it is ready. Basically, we need a function (e.g. exportGappedAlignments) or an inheritance method something like export.GappedAlignments to export the objects of that class, right? GappedAlignments doesn't really contain enough information for an informative BAM file, e.g., reads, qualities, alignment scores, ... Also presumably header information in the original BAM would need to be carried forward... Not that I have anything better to offer (other than filterBam for simple filtering of reads). Martin > Thanks, > Yue > > On 2012-05-08, at 9:37 AM, Michael Lawrence wrote: > >> Good point. We should add GappedAlignments export to BAM into rtracklayer. I recently added BAM import to devel. Without any help from Rsamtools though, we would need to use the strategy that you outline: write out a SAM file and asBam() it. That's not so bad though. Do you think you could submit this as a patch? >> >> Thanks, >> Michael >> >> On Tue, May 8, 2012 at 6:24 AM, Yue Li<gorillayue at="" gmail.com=""> wrote: >> Dear List, >> >> I wonder if there's a way to export a GappedAlignment object to a bam file. >> >> rtracklayer 'export' function exports gff, bed, bed15, bedGraph but not bam. It also does not recognize GappedAlignment class. >> >> One could reformat the GappedAlignment object into a SAM-like table, write.table it to a local disk, and then use 'asBAM' to convert that file to BAM. But that seems a little cumbersome. >> >> Thanks much, >> Yue >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at r-project.org >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >> > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Computational Biology Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: M1-B861 Telephone: 206 667-2793
ADD REPLY

Login before adding your answer.

Traffic: 704 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