This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to properly get BED regions coverage

I have a sorted bam file and a bed file with chromosome regions. I would like to:

  1. get mean coverage for the regions in my .bed file.
  2. calculate the percentage of these regions covered at 30X, and at 40X

for 1, I tried

coverageBed -abam file.bam  -b region.bed -mean > mean.txt

which gave me a table with multiple columns:

22      17052775        17052926        K00193:107:HFV7CBBXX:6:1228:23054:40666/1       60      +       17052775        17052926        0,0,0   1       151,    0,     
0.0000000 22      17052775        17052926        K00193:107:HFV7CBBXX:6:2228:24718:39822/1       60      +       17052775        17052926        0,0,0   1       151,    0,     
0.0000000 22      17052806        17052957        K00193:107:HFV7CBBXX:6:2126:29183:23540/1       60      +       17052806        17052957        0,0,0   1       151,    0,     
0.0000000

What would be the easiest to get these done? I tried several post on Biostars/google, but couldn't find the solution for these. Any suggestions would be much appreciated!

bedtools

I am pretty sure qualimap does all of that and even gives nice graphics outputs.

@ATpoint qualimap bamqc -bam file.bam -gff file.bed outformat PDF --java-mem-size=4G gives me error: Found 50 regions Filling region references... Failed to run bamqc java.lang.RuntimeException: BED format error, there should be at least 6 fields. Problematic line:

I was provided a bed file with three columns only- Chr Start End. How can I make this work? Thanks for your help!

0 answers

No answers yet.

Log in to answer this question.