Bug fix: annotation values ar parsed as Doubles when they should be parsed as Integers due to implicit conversion.
* Updated expected test data in which an integer annotation (MQ0) was formatted as a double.
This commit is contained in:
parent
5bbad75402
commit
5113e21437
|
|
@ -194,7 +194,7 @@ public class CombineVariantsIntegrationTest extends WalkerTest {
|
||||||
" --excludeNonVariants -combineAnnotations -setKey null" +
|
" --excludeNonVariants -combineAnnotations -setKey null" +
|
||||||
" -L 20:10,000,000-10,001,000", b37KGReference),
|
" -L 20:10,000,000-10,001,000", b37KGReference),
|
||||||
1,
|
1,
|
||||||
Arrays.asList("2e15db35359144683f1e58e147362679"));
|
Arrays.asList("0413f0725fc5ec3a4f1ee246f6cb3a2a"));
|
||||||
cvExecuteTest("combineSingleSamplePipelineGVCF", spec, true);
|
cvExecuteTest("combineSingleSamplePipelineGVCF", spec, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -891,7 +891,11 @@ public class GATKVariantContextUtils {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
final String stringValue = value.toString();
|
final String stringValue = value.toString();
|
||||||
values.add(stringValue.contains(".") ? Double.parseDouble(stringValue) : Integer.parseInt(stringValue));
|
// Branch to avoid unintentional, implicit type conversions that occur with the ? operator.
|
||||||
|
if (stringValue.contains("."))
|
||||||
|
values.add(Double.parseDouble(stringValue));
|
||||||
|
else
|
||||||
|
values.add(Integer.parseInt(stringValue));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
badAnnotation = true;
|
badAnnotation = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue