From ec174dc0ba695fab37f93b3724811cf48578dcf1 Mon Sep 17 00:00:00 2001 From: ebanks Date: Fri, 3 Dec 2010 16:37:08 +0000 Subject: [PATCH] As per Menachem's last commit, there's a minimally more efficient way of doing the MQ cap. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4782 348d0f76-0448-11de-a6fe-93d51630548a --- .../gatk/walkers/genotyper/UnifiedGenotyperEngine.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java index 52c101683..8c7c38a9e 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java @@ -117,7 +117,10 @@ public class UnifiedGenotyperEngine { } private void initialize(GenomeAnalysisEngine toolkit, UnifiedArgumentCollection UAC, Logger logger, PrintStream verboseWriter, VariantAnnotatorEngine engine, int numSamples) { - this.UAC = UAC; + // note that, because we cap the base quality by the mapping quality, minMQ cannot be less than minBQ + this.UAC = UAC.clone(); + this.UAC.MIN_MAPPING_QUALTY_SCORE = Math.max(UAC.MIN_MAPPING_QUALTY_SCORE, UAC.MIN_BASE_QUALTY_SCORE); + this.logger = logger; this.verboseWriter = verboseWriter; this.annotationEngine = engine; @@ -575,10 +578,8 @@ public class UnifiedGenotyperEngine { // all bits are set to false by default BitSet bitset = new BitSet(record.getReadLength()); - // if the mapping quality is too low or the mate is bad, we can just zero out the whole read and continue. - // note that, because we cap the base quality by the mapping quality, if MQ < minBQ then we can filter this read. + // if the mapping quality is too low or the mate is bad, we can just zero out the whole read and continue if ( record.getMappingQuality() < UAC.MIN_MAPPING_QUALTY_SCORE || - record.getMappingQuality() < UAC.MIN_BASE_QUALTY_SCORE || (!UAC.USE_BADLY_MATED_READS && BadMateFilter.hasBadMate(record)) ) { return bitset; }