Merge pull request #231 from broadinstitute/md_combinevariants_bugfix
CombineVariants no longer adds PASS to unfiltered records
This commit is contained in:
commit
71bbb25c9e
|
|
@ -189,4 +189,15 @@ public class CombineVariantsIntegrationTest extends WalkerTest {
|
||||||
Arrays.asList("aa926eae333208dc1f41fe69dc95d7a6"));
|
Arrays.asList("aa926eae333208dc1f41fe69dc95d7a6"));
|
||||||
cvExecuteTest("combineDBSNPDuplicateSites:", spec, true);
|
cvExecuteTest("combineDBSNPDuplicateSites:", spec, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void combineLeavesUnfilteredRecordsUnfiltered() {
|
||||||
|
WalkerTestSpec spec = new WalkerTestSpec(
|
||||||
|
"-T CombineVariants --no_cmdline_in_header -o %s "
|
||||||
|
+ " -R " + b37KGReference
|
||||||
|
+ " -V " + privateTestDir + "combineVariantsLeavesRecordsUnfiltered.vcf",
|
||||||
|
1,
|
||||||
|
Arrays.asList("f8c014d0af7e014475a2a448dc1f9cef"));
|
||||||
|
cvExecuteTest("combineLeavesUnfilteredRecordsUnfiltered: ", spec, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -697,6 +697,7 @@ public class GATKVariantContextUtils {
|
||||||
int maxAC = -1;
|
int maxAC = -1;
|
||||||
final Map<String, Object> attributesWithMaxAC = new LinkedHashMap<String, Object>();
|
final Map<String, Object> attributesWithMaxAC = new LinkedHashMap<String, Object>();
|
||||||
double log10PError = CommonInfo.NO_LOG10_PERROR;
|
double log10PError = CommonInfo.NO_LOG10_PERROR;
|
||||||
|
boolean anyVCHadFiltersApplied = false;
|
||||||
VariantContext vcWithMaxAC = null;
|
VariantContext vcWithMaxAC = null;
|
||||||
GenotypesContext genotypes = GenotypesContext.create();
|
GenotypesContext genotypes = GenotypesContext.create();
|
||||||
|
|
||||||
|
|
@ -729,6 +730,7 @@ public class GATKVariantContextUtils {
|
||||||
log10PError = vc.getLog10PError();
|
log10PError = vc.getLog10PError();
|
||||||
|
|
||||||
filters.addAll(vc.getFilters());
|
filters.addAll(vc.getFilters());
|
||||||
|
anyVCHadFiltersApplied |= vc.filtersWereApplied();
|
||||||
|
|
||||||
//
|
//
|
||||||
// add attributes
|
// add attributes
|
||||||
|
|
@ -841,7 +843,9 @@ public class GATKVariantContextUtils {
|
||||||
builder.alleles(alleles);
|
builder.alleles(alleles);
|
||||||
builder.genotypes(genotypes);
|
builder.genotypes(genotypes);
|
||||||
builder.log10PError(log10PError);
|
builder.log10PError(log10PError);
|
||||||
builder.filters(filters.isEmpty() ? filters : new TreeSet<String>(filters));
|
if ( anyVCHadFiltersApplied ) {
|
||||||
|
builder.filters(filters.isEmpty() ? filters : new TreeSet<>(filters));
|
||||||
|
}
|
||||||
builder.attributes(new TreeMap<String, Object>(mergeInfoWithMaxAC ? attributesWithMaxAC : attributes));
|
builder.attributes(new TreeMap<String, Object>(mergeInfoWithMaxAC ? attributesWithMaxAC : attributes));
|
||||||
|
|
||||||
// Trim the padded bases of all alleles if necessary
|
// Trim the padded bases of all alleles if necessary
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ public class SymbolicAllelesIntegrationTest extends WalkerTest {
|
||||||
WalkerTestSpec spec = new WalkerTestSpec(
|
WalkerTestSpec spec = new WalkerTestSpec(
|
||||||
baseTestString(b36KGReference, "symbolic_alleles_2.vcf"),
|
baseTestString(b36KGReference, "symbolic_alleles_2.vcf"),
|
||||||
1,
|
1,
|
||||||
Arrays.asList("bf5a09f783ab1fa44774c81f91d10921"));
|
Arrays.asList("30f66a097987330d42e87da8bcd6be21"));
|
||||||
executeTest("Test symbolic alleles mixed in with non-symbolic alleles", spec);
|
executeTest("Test symbolic alleles mixed in with non-symbolic alleles", spec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue