Merge pull request #1539 from broadinstitute/rhl_hc_disable_badmatefilter_1443
Allow disabling of BadMateFilter in HaplotypeCaller
This commit is contained in:
commit
7c0e51396f
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue