CombineVariants no longer adds PASS to unfiltered records

-- [Delivers #49876703]
-- Add integration test and test file
-- Update SymbolicAlleles combine variant tests, which was turning unfiltered records into PASS!
This commit is contained in:
Mark DePristo 2013-05-20 13:36:30 -04:00
parent b239cb76d4
commit 62fc88f92e
3 changed files with 17 additions and 2 deletions

View File

@ -189,4 +189,15 @@ public class CombineVariantsIntegrationTest extends WalkerTest {
Arrays.asList("aa926eae333208dc1f41fe69dc95d7a6"));
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);
}
}

View File

@ -697,6 +697,7 @@ public class GATKVariantContextUtils {
int maxAC = -1;
final Map<String, Object> attributesWithMaxAC = new LinkedHashMap<String, Object>();
double log10PError = CommonInfo.NO_LOG10_PERROR;
boolean anyVCHadFiltersApplied = false;
VariantContext vcWithMaxAC = null;
GenotypesContext genotypes = GenotypesContext.create();
@ -729,6 +730,7 @@ public class GATKVariantContextUtils {
log10PError = vc.getLog10PError();
filters.addAll(vc.getFilters());
anyVCHadFiltersApplied |= vc.filtersWereApplied();
//
// add attributes
@ -841,7 +843,9 @@ public class GATKVariantContextUtils {
builder.alleles(alleles);
builder.genotypes(genotypes);
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));
// Trim the padded bases of all alleles if necessary

View File

@ -57,7 +57,7 @@ public class SymbolicAllelesIntegrationTest extends WalkerTest {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString(b36KGReference, "symbolic_alleles_2.vcf"),
1,
Arrays.asList("bf5a09f783ab1fa44774c81f91d10921"));
Arrays.asList("30f66a097987330d42e87da8bcd6be21"));
executeTest("Test symbolic alleles mixed in with non-symbolic alleles", spec);
}
}