bedToBAM strand

26 views
Skip to first unread message

Colin

unread,
Feb 27, 2012, 1:15:54 PM2/27/12
to bedtools-discuss
Unless I'm doing something wrong, I noticed that converting a bedfile
that looks like this:


read0 3734 3758 DUMMY1 1000 +
read1 3735 3759 DUMMY1 1000 -
read2 3736 3760 DUMMY1 1000 +

to BAM format results in losing the strand information. I've worked
around this using other tools, but keeping strand information in the
conversion would be a nice feature for the tool.

cheers,
Colin

Aaron Quinlan

unread,
Feb 28, 2012, 9:20:45 AM2/28/12
to bedtools...@googlegroups.com
Hi Colin,

What version are you using? Your file works for me with the latest version (2.15.0). Note that FLAG==16 for the second alignment. One problem I see is that you are using "read0", "read1", etc. for your chroms. Unless these are present in your genome file when running bedtobam, you may get odd results.

$ cat colin.bed


read0 3734 3758 DUMMY1 1000 +
read1 3735 3759 DUMMY1 1000 -
read2 3736 3760 DUMMY1 1000 +

$ bedtools bedtobam -i colin.bed -g human.hg19.genome | samtools view -
DUMMY1 0 chr1 3735 255 24M * 0 0 * *
DUMMY1 16 chr1 3736 255 24M * 0 0 * *
DUMMY1 0 chr1 3737 255 24M * 0 0 * *

Best,
Aaron

Reply all
Reply to author
Forward
0 new messages