Home > Community > how to calculate coverage of each base of mapped reads?
Upvote

25

Downvote
+ Rna
+ Bioinformatics
Posted by
Martin Brilliant

how to calculate coverage of each base of mapped reads?

David Beckham  Follow

You are looking for bedtools genomecov, specifically -d option. See https://bedtools.readthedocs.io/en/latest/content/tools/genomecov.html , for example:

bedtools genomecov -i A.bed -g my.genome -d

I recommend not reinventing the wheel: use bedtools instead of reimplementing the same functionality in Perl.

More

Upvote

VOTE

Downvote
Jeffrey Engel  Follow
Can you add it from another bam file using samtools? Or add a fake header?More
Upvote

VOTE

Downvote
Idealist  Follow
i did add a header from a different sample to calculate the coverage... just wondering if we can do it using awk.More
Upvote

VOTE

Downvote
Jon Collier  Follow
thanks, but bedtools doesn't work in this case as there is no header info.More
Upvote

VOTE

Downvote