Question: How to interpret the outputs generated from bamtobed using BedTools?
0
gravatar for Louis Kok
3.8 years ago by
Louis Kok10
Singapore
Louis Kok10 wrote:

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.

bamtobed bam bed bedtools • 2.6k views
ADD COMMENTlink modified 3.8 years ago by Sukhdeep Singh9.7k • written 3.8 years ago by Louis Kok10
1
gravatar for Sukhdeep Singh
3.8 years ago by
Sukhdeep Singh9.7k
Netherlands
Sukhdeep Singh9.7k wrote:

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 COMMENTlink modified 3.8 years ago • written 3.8 years ago by Sukhdeep Singh9.7k

@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 REPLYlink written 3.8 years ago by Louis Kok10

Hey , thats 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 REPLYlink written 3.8 years ago by Sukhdeep Singh9.7k

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

ADD REPLYlink written 3.8 years ago by Louis Kok10

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

ADD REPLYlink written 3.8 years ago by Sukhdeep Singh9.7k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1705 users visited in the last hour