Added check in VariantContext.validate to ensure that getEnd() == END value when present
-- Fixed bug in VariantDataManager that this validation mode was intended to detect going forward -- Still no VariantRecalibrationWalkersIntegrationTest for indels with BCF2 but that's because LowQual is missing from test VCF
This commit is contained in:
parent
893630af53
commit
385a3c630f
|
|
@ -298,7 +298,7 @@ public class VariantDataManager {
|
||||||
attributes.put(VariantRecalibrator.VQS_LOD_KEY, String.format("%.4f", datum.lod));
|
attributes.put(VariantRecalibrator.VQS_LOD_KEY, String.format("%.4f", datum.lod));
|
||||||
attributes.put(VariantRecalibrator.CULPRIT_KEY, (datum.worstAnnotation != -1 ? annotationKeys.get(datum.worstAnnotation) : "NULL"));
|
attributes.put(VariantRecalibrator.CULPRIT_KEY, (datum.worstAnnotation != -1 ? annotationKeys.get(datum.worstAnnotation) : "NULL"));
|
||||||
|
|
||||||
VariantContextBuilder builder = new VariantContextBuilder("VQSR", datum.loc.getContig(), datum.loc.getStart(), datum.loc.getStart(), alleles).attributes(attributes);
|
VariantContextBuilder builder = new VariantContextBuilder("VQSR", datum.loc.getContig(), datum.loc.getStart(), datum.loc.getStop(), alleles).attributes(attributes);
|
||||||
recalWriter.add(builder.make());
|
recalWriter.add(builder.make());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1126,6 +1126,7 @@ public class VariantContext implements Feature { // to enable tribble integratio
|
||||||
// ---------------------------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
private boolean validate(final EnumSet<Validation> validationToPerform) {
|
private boolean validate(final EnumSet<Validation> validationToPerform) {
|
||||||
|
validateStop();
|
||||||
for (final Validation val : validationToPerform ) {
|
for (final Validation val : validationToPerform ) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case ALLELES: validateAlleles(); break;
|
case ALLELES: validateAlleles(); break;
|
||||||
|
|
@ -1138,6 +1139,20 @@ public class VariantContext implements Feature { // to enable tribble integratio
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check that getEnd() == END from the info field, if it's present
|
||||||
|
*/
|
||||||
|
private void validateStop() {
|
||||||
|
if ( hasAttribute(VCFConstants.END_KEY) ) {
|
||||||
|
final int end = getAttributeAsInt(VCFConstants.END_KEY, -1);
|
||||||
|
assert end != -1;
|
||||||
|
if ( end != getEnd() )
|
||||||
|
throw new ReviewedStingException("Badly formed variant context at location " + getChr() + ":"
|
||||||
|
+ getStart() + "; getEnd() was " + getEnd()
|
||||||
|
+ " but this VariantContext contains an END key with value " + end);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void validateReferencePadding() {
|
private void validateReferencePadding() {
|
||||||
if ( hasSymbolicAlleles() ) // symbolic alleles don't need padding...
|
if ( hasSymbolicAlleles() ) // symbolic alleles don't need padding...
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ public class VariantRecalibrationWalkersIntegrationTest extends WalkerTest {
|
||||||
" -tranchesFile " + getMd5DB().getMD5FilePath(params.tranchesMD5, null) +
|
" -tranchesFile " + getMd5DB().getMD5FilePath(params.tranchesMD5, null) +
|
||||||
" -recalFile " + getMd5DB().getMD5FilePath(params.recalMD5, null),
|
" -recalFile " + getMd5DB().getMD5FilePath(params.recalMD5, null),
|
||||||
Arrays.asList(params.cutVCFMD5));
|
Arrays.asList(params.cutVCFMD5));
|
||||||
|
spec.disableShadowBCF(); // has to be disabled because the input VCF is missing LowQual annotation
|
||||||
executeTest("testApplyRecalibrationIndel-"+params.inVCF, spec);
|
executeTest("testApplyRecalibrationIndel-"+params.inVCF, spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue