Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eland-to-Bed algorithm joseph Bioinformatics 27 11-19-2012 07:12 PM
gff3-bed-bam for RNAseq Hagen RNA Sequencing 4 08-20-2012 11:35 AM
help - convert .bed to .bam adurasiwam3 Bioinformatics 5 05-29-2012 08:04 PM
modified Bam to bed algorithm jarwulf Bioinformatics 1 05-02-2012 11:55 PM
BAM to Bed Algorithm jarwulf Bioinformatics 1 04-30-2012 04:34 AM

Thread Tools
Old 09-10-2012, 02:51 PM   #1
Junior Member
Location: US

Join Date: Apr 2012
Posts: 9
Default Need BAM to BED algorithm

Hi, I've been looking for a good quick BAM to bed algorithm/code to integrate into a Java swing gui program. Usually we just use bedtools to do a simple nofrills conversion (no CIGAR or stuff like that) but there are many problems such incompatibility with windows. I've tried the bamtobed converter here

But I'm unsatisfied with the performance. I've thought about converting bedtool's bam converter to java myself but it looks extremely complicated with several files and multiple layers of dependencies. I was wondering if there was any java conversion of bedtools or any other code snippets I could try out.


Last edited by jarwulf; 09-10-2012 at 02:59 PM.
jarwulf is offline   Reply With Quote
Old 09-11-2012, 05:29 AM   #2
Jim Robinson
Location: Boston, MA

Join Date: May 2009
Posts: 75

You should be able to build such a program using the Sam JDK in the Picard package. It would be straightforward, there are examples in the form of unit tests. You want to open a SAMFileReader, then use the "query" method to get an iterator over SAMRecord objects. The SAMRecord has all the info you need. Just remember the coordinates are "1" based and bed is "0".
Jim Robinson is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 07:47 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO