1
$\begingroup$

I am using bedtools coverage to compute the sequencing depth at every positions of a chromosome but it didn't work as I expected. Instead it reported 0 coverage at every positions.

This is how I did it :

I made a chr1.bed bedfile :

chr start   end 
1   1   158534110

I ran this command :

coverageBed -a -d chr1.bed -b aln.bam -s > coverage.perposition_chr1.tsv

However I don't find any position in the output that is actually covered :

chr start end 1-pos depth
1   1   158534110   1   0
1   1   158534110   2   0
1   1   158534110   3   0
1   1   158534110   4   0
1   1   158534110   5   0
1   1   158534110   6   0
1   1   158534110   7   0
1   1   158534110   8   0
(...)
1   1   158534110   158534109   0

I must do something wrong because I already computed depth at specific pattern positions using the same aln.bam and it was working fine...

Suggestions and tries :

  • Swapping -a & -d parameters produces the same results
  • Adding a strand column to the bedfile still gives 0 coverage.

chr1.bed

1       1       158534110       .       0       +
1       1       158534110       .       0       -

output


1       1       158534110       .       0       +       1       0
1       1       158534110       .       0       +       2       0
(...)
1       1       158534110       .       0       -       158534108       0
1       1       158534110       .       0       -       158534109       0
```
$\endgroup$
5
  • 1
    $\begingroup$ In your .bam file (and the original reference you used) are the chromosomes called '1' '2'; etc, or 'Chr1', 'Chr2' etc? Also, you could try swapping the -a and -d - maybe the -a needs to be immediately before the .bed file. $\endgroup$ – Jonathan Moore Nov 12 '19 at 17:18
  • $\begingroup$ @JonathanMoore I bet you're right. The -a expects a string, so that would take -d as the value for -a. Probably worth an answer already. $\endgroup$ – terdon Nov 12 '19 at 17:21
  • $\begingroup$ @JonathanMoore Yes this is the right chromosome name. I tried swipping parameters and it did produce the same file. @terdon wouldn't I expect an error If it indeed took -d as the -a value ? It is not fitting the right format $\endgroup$ – Paul Endymion Nov 12 '19 at 17:42
  • 1
    $\begingroup$ Consider posting 1-2 alignments in sam format, which you would expect to give non-zero coverage as the minimum reproducible example. What is the bedtools version? What happens if you drop -s? $\endgroup$ – Timur Shtatland Nov 12 '19 at 22:52
  • 1
    $\begingroup$ @TimurShtatland Dammit that was it, the bam went blank at some point in my testing. I should have suspected that. It works now. My bad and thanks all for the suggestions.. $\endgroup$ – Paul Endymion Nov 13 '19 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.