Skip to content

Commit 9f935c0

Browse files
committed
Square with David's fix and more comments
1 parent 0a7c7d3 commit 9f935c0

File tree

3 files changed

+114
-122
lines changed

3 files changed

+114
-122
lines changed

src/main/java/org/broadinstitute/hellbender/tools/walkers/annotator/RMSMappingQuality.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public final class RMSMappingQuality extends InfoFieldAnnotation implements Stan
6161
@Override
6262
public List<String> getRawKeyNames() { return Arrays.asList(GATKVCFConstants.RAW_MAPPING_QUALITY_WITH_DEPTH_KEY);} //new key for the two-value MQ data to prevent version mismatch catastrophes
6363

64-
public static String getDeprecatedRawKeyName() { return GATKVCFConstants.RAW_RMS_MAPPING_QUALITY_KEY;} //new key for the two-value MQ data to prevent version mismatch catastrophes
64+
public static String getDeprecatedRawKeyName() { return GATKVCFConstants.RAW_RMS_MAPPING_QUALITY_KEY;} //old key that used the janky depth estimation method
6565

6666
@Override
6767
public List<String> getKeyNames() {
@@ -135,7 +135,7 @@ public Map<String, Object> finalizeRawData(final VariantContext vc, final Varian
135135
else if (vc.hasAttribute(getDeprecatedRawKeyName())) {
136136
if (!allowOlderRawKeyValues) {
137137
throw new UserException.BadInput("Presence of '-"+getDeprecatedRawKeyName()+"' annotation is detected. This GATK version expects key "
138-
+ getRawKeyNames() + " with a tuple of sum of squared MQ values and total reads over variant "
138+
+ getRawKeyNames().get(0) + " with a tuple of sum of squared MQ values and total reads over variant "
139139
+ "genotypes as the value. This could indicate that the provided input was produced with an older version of GATK. " +
140140
"Use the argument '--"+RMS_MAPPING_QUALITY_OLD_BEHAVIOR_OVERRIDE_ARGUMENT+"' to override and attempt the deprecated MQ calculation. There " +
141141
"may be differences in how newer GATK versions calculate DP and MQ that may result in worse MQ results. Use at your own risk.");
@@ -155,7 +155,7 @@ else if (vc.hasAttribute(getDeprecatedRawKeyName())) {
155155
}
156156
else {
157157
logger.warn("MQ annotation data is not properly formatted. This GATK version expects key "
158-
+ getRawKeyNames() + " with a tuple of sum of squared MQ values and total reads over variant "
158+
+ getRawKeyNames().get(0) + " with a tuple of sum of squared MQ values and total reads over variant "
159159
+ "genotypes as the value. Attempting to use deprecated MQ calculation.");
160160
final long numOfReads = getNumOfReads(vc, null);
161161
rawMQdata = Math.round(Double.parseDouble(rawMQdata)) + "," + numOfReads; //deprecated format was double so it needs to be converted to long

src/main/java/org/broadinstitute/hellbender/tools/walkers/annotator/VariantAnnotatorEngine.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public Map<String, Object> combineAnnotations(final List<Allele> allelesList, Ma
205205
final List<ReducibleAnnotationData<?>> annotationValue = (List<ReducibleAnnotationData<?>>) annotationMap.get(currentASannotation.getRawKeyNames().get(0));
206206
final Map<String, Object> annotationsFromCurrentType = currentASannotation.combineRawData(allelesList, annotationValue);
207207
combinedAnnotations.putAll(annotationsFromCurrentType);
208-
//remove the combined annotations so that the next method only processes the non-reducible ones
208+
//remove all the raw keys for the annotation because we already used all of them in combineRawData
209209
for (final String rk : currentASannotation.getRawKeyNames()) {
210210
annotationMap.remove(rk);
211211
}

0 commit comments

Comments
 (0)