How to interpret the outputs generated from bamtobed using BedTools?
1
0
Entering edit mode
8.8 years ago
Louis Kok ▴ 30

Hi All, I have generated a bed file from a BAM file using bamtobed commands from BedTools. I am not sure how to interpret the meaning of each column. There is also bed12 option which generates 12 columns output. Appreciate if anyone can help me out to understand what those are. Thank you.

bed Bedtools BAM bamtobed • 6.0k views
ADD COMMENT
1
Entering edit mode
8.8 years ago

From the manual, http://bedtools.readthedocs.org/en/latest/content/tools/bamtobed.html

Default behavior

By default, each alignment in the BAM file is converted to a 6 column BED. The BED "name" field is comprised of the RNAME field in the BAM alignment. If mate information is available, the mate (e.g., "/1" or "/2") field will be appended to the name.

$ bedtools bamtobed -i reads.bam | head -3
chr7   118970079   118970129   TUPAC_0001:3:1:0:1452#0/1   37   -
chr7   118965072   118965122   TUPAC_0001:3:1:0:1452#0/2   37   +
chr11  46769934    46769984    TUPAC_0001:3:1:0:1472#0/1   37   -

If you are still confused, read about the SAM format https://samtools.github.io/hts-specs/SAMv1.pdf

ADD COMMENT
0
Entering edit mode

@Sukhdeep Singh Thanks for the information. What I don't understand is the 5th column. Some of number are zero which I am not sure what it means. Does it mean the coverage number of the reads at particular reference position?

ADD REPLY
2
Entering edit mode

Hey, that's the MAPQ (mapping quality) score, it has a range of [0,2^8 -1]. o represents either the unmapped read or the unvailability of mapping quality. Check the percentage of how many reads in the file are like this. awk '$5=="0"' file | wc -l

If you want more filterting check the post How To Filter Mapped Reads With Samtools

ADD REPLY
0
Entering edit mode

Thanks a lot. This info is really useful. :)

ADD REPLY
0
Entering edit mode

You thanks by upvoting and accepting the answers on Biostars. This motivates us and keeps the system running :)
Good Luck

ADD REPLY

Login before adding your answer.

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