Get the coverage after read alignment with bwa-mem2
1
0
Entering edit mode
2.7 years ago

Hi,

I have aligned genomic reads to a reference genome using bwa-mem2 (using bwa-mem2 mem). From what I understood, if a read map to 2 different locations in the genome with the same score, bwa-mem2 will choose at random one of the location and this will have a MAPQ score of 0 (I did not run mem with the -a option).

What I want to do then is to get the mean read coverage at different part of the genome using bedtools (Thats why I absolutely need reads to be mapped to only 1 genomic location) and compare these different coverages.

However, I have several questions :

  • Is my first asumption about bwa-mem correct ?
  • Will bedtools coverage take into account reads flagged with a MAPQ of 0 ?

Thanks for any help and tips !

Maxime

coverage alignment bwa-mem2 MAPQ • 1.3k views
ADD COMMENT
0
Entering edit mode

You may check out deeptools.

ADD REPLY
2
Entering edit mode
2.7 years ago

1) yes

2)

$ samtools depth -a -r "chr1:123-456" in.bam -q 0  | awk '{D+=int($3)} END{print D/(NR*1.0);}'
ADD COMMENT
0
Entering edit mode

Thanks a lot for your answer :D

ADD REPLY

Login before adding your answer.

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