Fixing problem reported on forum for VF: DP couldn't be filtered from the FORMAT field, only from the INFO field. Fixed and added integration test.
This commit is contained in:
parent
e93ff3ea6e
commit
91f2c847a3
|
|
@ -193,6 +193,8 @@ class JEXLMap implements Map<VariantContextUtils.JexlVCMatchExp, Boolean> {
|
|||
infoMap.put("isHet", g.isHet() ? "1" : "0");
|
||||
infoMap.put("isHomVar", g.isHomVar() ? "1" : "0");
|
||||
infoMap.put(VCFConstants.GENOTYPE_QUALITY_KEY, g.getGQ());
|
||||
if ( g.hasDP() )
|
||||
infoMap.put(VCFConstants.DEPTH_KEY, g.getDP());
|
||||
for ( Map.Entry<String, Object> e : g.getExtendedAttributes().entrySet() ) {
|
||||
if ( e.getValue() != null && !e.getValue().equals(VCFConstants.MISSING_VALUE_v4) )
|
||||
infoMap.put(e.getKey(), e.getValue());
|
||||
|
|
|
|||
|
|
@ -108,4 +108,22 @@ public class VariantFiltrationIntegrationTest extends WalkerTest {
|
|||
Arrays.asList("8ed32a2272bab8043a255362335395ef"));
|
||||
executeTest("testUnfilteredBecomesFilteredAndPass", spec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFilteringDPfromINFO() {
|
||||
WalkerTestSpec spec = new WalkerTestSpec(
|
||||
"-T VariantFiltration -o %s --no_cmdline_in_header -R " + b37KGReference
|
||||
+ " --filterExpression 'DP < 8' --filterName lowDP -V " + privateTestDir + "filteringDepthInFormat.vcf", 1,
|
||||
Arrays.asList("a01f7cce53ea556c9741aa60b6124c41"));
|
||||
executeTest("testFilteringDPfromINFO", spec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFilteringDPfromFORMAT() {
|
||||
WalkerTestSpec spec = new WalkerTestSpec(
|
||||
"-T VariantFiltration -o %s --no_cmdline_in_header -R " + b37KGReference
|
||||
+ " --genotypeFilterExpression 'DP < 8' --genotypeFilterName lowDP -V " + privateTestDir + "filteringDepthInFormat.vcf", 1,
|
||||
Arrays.asList("e10485c7c33d9211d0c1294fd7858476"));
|
||||
executeTest("testFilteringDPfromFORMAT", spec);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue