Allow disabling of BadMateFilter in HaplotypeCaller

This commit is contained in:
Ron Levine 2017-01-06 09:19:21 -05:00
parent bb87730ddc
commit f092e1438d
2 changed files with 14 additions and 3 deletions

View File

@ -530,7 +530,6 @@ public class HaplotypeCaller extends ActiveRegionWalker<List<VariantContext>, In
*/
private static final int MINIMUM_PUTATIVE_PLOIDY_FOR_ACTIVE_REGION_DISCOVERY = 2;
/**
* Reads with length lower than this number, after clipping off overhands outside the active region,
* won't be considered for genotyping.
@ -550,6 +549,11 @@ public class HaplotypeCaller extends ActiveRegionWalker<List<VariantContext>, In
ReferenceConfidenceModel referenceConfidenceModel = null;
/*
* Is the bad mate filter disabled by the argument -drf BadMate?
*/
private boolean isBadMateFilterDisabled = false;
////////////////////////////////////////////////////////////////////////
//// Deprecated Arguments ////
@ -735,6 +739,8 @@ public class HaplotypeCaller extends ActiveRegionWalker<List<VariantContext>, In
trimmer.initialize(getToolkit().getGenomeLocParser(), HCAC.DEBUG,
HCAC.genotypingOutputMode == GenotypingOutputMode.GENOTYPE_GIVEN_ALLELES,emitReferenceConfidence());
isBadMateFilterDisabled = toolkit.getArguments().disabledReadFilters.contains("BadMate");
}
private void initializeReferenceConfidenceModel(final SampleList samples, final Set<VCFHeaderLine> headerInfo) {
@ -1226,7 +1232,7 @@ public class HaplotypeCaller extends ActiveRegionWalker<List<VariantContext>, In
private Set<GATKSAMRecord> filterNonPassingReads( final ActiveRegion activeRegion ) {
final Set<GATKSAMRecord> readsToRemove = new LinkedHashSet<>();
for( final GATKSAMRecord rec : activeRegion.getReads() ) {
if( rec.getReadLength() < READ_LENGTH_FILTER_THRESHOLD || rec.getMappingQuality() < READ_QUALITY_FILTER_THRESHOLD || BadMateFilter.hasBadMate(rec) || (keepRG != null && !rec.getReadGroup().getId().equals(keepRG)) ) {
if( rec.getReadLength() < READ_LENGTH_FILTER_THRESHOLD || rec.getMappingQuality() < READ_QUALITY_FILTER_THRESHOLD || (!isBadMateFilterDisabled && BadMateFilter.hasBadMate(rec)) || (keepRG != null && !rec.getReadGroup().getId().equals(keepRG)) ) {
readsToRemove.add(rec);
}
}

View File

@ -117,6 +117,11 @@ public class HaplotypeCallerIntegrationTest extends WalkerTest {
HCTest(CEUTRIO_BAM, "", "ad472fbd63864caacf5bc018dcae9df9");
}
@Test
public void testHaplotypeCallerMultiSampleNoBadMateFilter() throws IOException {
HCTest(CEUTRIO_BAM, "-drf BadMate", "bb6b14675d62ff5b86430508ed688776");
}
@Test
public void testHaplotypeCallerSingleSample() throws IOException {
@ -471,7 +476,7 @@ public class HaplotypeCallerIntegrationTest extends WalkerTest {
1, UserException.CommandLineException.class));
}
@Test
@Test
public void testHaplotypeCallerMergeVariantsViaLDException(){
executeTest("HaplotypeCallerMergeVariantsViaLDException",
new WalkerTest.WalkerTestSpec(