qualimap2 mean mapping quality
0
3
Entering edit mode
3.2 years ago
13751039463 ▴ 30

I’ve done a contrast experiment to see the difference between the bam with BQSR and the bam without BQSR. I use qualimap to evaluate both bams. This is the confusing part. Using hap.py and the giab na12878 truth vcf, shows the bam with BQSR is better than the one without BQSR, but the mean mapping quality with bqsr is only 5.86. The mean mapping quality without bqsr is 27.47. I calculate use the bam: samtools view aln.bam | \ awk '{sum+=$5} END { print "Mean MAPQ =",sum/NR}': the result is around 56. I wonder what is the algorithm theory of the qualimap used to cauculate the mean mapping quality.

alignment • 1.2k views
ADD COMMENT
0
Entering edit mode

mark.........................

ADD REPLY
0
Entering edit mode

I have the same question. The sam bam file but different mean MAPQ value.

qualimap2 mean mapping quality: 46.05

samtools view aln.bam | \ awk '{sum+=$5} END { print "Mean MAPQ =",sum/NR}': 54.8837

my code (pysam): 56.31

import pysam
def read_Bam(bam_file):
    bam = pysam.AlignmentFile(bam_file,'rb')
    return bam
def get_bam_MAPQ(bam):
    MAPQ_list=[]
    for read in bam.fetch():
        MAPQ_list.append(read.mapping_quality)
    return MAPQ_list
bam=read_Bam(bam_file)
MAPQ=get_bam_MAPQ(bam)
mean_MAPQ=float(sum(MAQP))/float(len(MAPQ))
ADD REPLY

Login before adding your answer.

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