- remove separate BQ cutoff for het sensitivity in WGS metrics. This … (
#577)
* - remove separate BQ cutoff for het sensitivity in WGS metrics. This causes incorrect depth and therefore sensitivity results whenever it's relevant. Also, the 17 cutoff in GATK onl refers to the graph building, for the pair HMM there is no minimum quality.
- added a test to verify that the base-based exclusions affect the coverage and base-quality distributions correctly
* fixed broken test. problem was that by using a separate histogram for the het sensitivity, exclusions were not taken into account in the base-distribution, but they were in the depth.
Loading branch information...
1 parent
4ac84f6commit e4b234df5d0cb0ffb35dae246442d238fe2d37acyfarjoun
committed
on GitHubJun 28, 2016
@Option(shortName="MQ", doc="Minimum mapping quality for a read to contribute coverage.", overridable=true)
publicintMINIMUM_MAPPING_QUALITY=20;
- @Option(shortName="Q", doc="Minimum base quality for a base to contribute coverage.", overridable=true)
+ @Option(shortName="Q", doc="Minimum base quality for a base to contribute coverage. N bases will be treated as having a base quality "+
+ "of negative infinity and will therefore be excluded from coverage regardless of the value of this parameter.", overridable=true)
publicintMINIMUM_BASE_QUALITY=20;
@Option(shortName="CAP", doc="Treat positions with coverage exceeding this value as if they had coverage at this value (but calculate the difference for PCT_EXC_CAPPED).", overridable=true)
@@ -253,7 +255,7 @@ protected int doWork() {
// Check that the reference is not N
finalbyte base = ref.getBases()[info.getPosition() -1];
- if (base=='N') continue;
+ if (SequenceUtil.isNoCall(base)) continue;
// add to the collector
collector.addInfo(info, ref);
@@ -297,19 +299,17 @@ protected WgsMetricsCollector getCollector(final int coverageCap) {
protectedclassWgsMetricsCollector {
- protectedfinallong[] histogramArray;
- privatefinallong[] baseQHistogramArray;
- privatefinallong[] baseQHetSensHistogram;
+ protectedfinallong[] depthHistogramArray;
+ privatefinallong[] baseQHistogramArray;
privatelong basesExcludedByBaseq =0;
privatelong basesExcludedByOverlap =0;
privatelong basesExcludedByCapping =0;
protectedfinalint coverageCap;
publicWgsMetricsCollector(finalintcoverageCap) {
- histogramArray=newlong[coverageCap +1];
+ depthHistogramArray=newlong[coverageCap +1];
baseQHistogramArray =newlong[Byte.MAX_VALUE];
- baseQHetSensHistogram =newlong[Byte.MAX_VALUE];
this.coverageCap = coverageCap;
}
@@ -318,14 +318,10 @@ public void addInfo(final SamLocusIterator.LocusInfo info, final ReferenceSequen
// Figure out the coverage while not counting overlapping reads twice, and excluding various things
0 comments on commit
e4b234d