Search in sources :

Example 6 with WellformedReadFilter

use of org.broadinstitute.hellbender.engine.filters.WellformedReadFilter in project gatk by broadinstitute.

the class BaseRecalibrator method getStandardBQSRReadFilterList.

/**
     * Return the full list of raw read filters used for BQSR contexts, including WellFormed.
     * @return List of raw read filters not yet primed with a header
     */
public static List<ReadFilter> getStandardBQSRReadFilterList() {
    final List<ReadFilter> bqsrFilters = getBQSRSpecificReadFilterList();
    bqsrFilters.add(new WellformedReadFilter());
    return bqsrFilters;
}
Also used : WellformedReadFilter(org.broadinstitute.hellbender.engine.filters.WellformedReadFilter) ReadFilter(org.broadinstitute.hellbender.engine.filters.ReadFilter) WellformedReadFilter(org.broadinstitute.hellbender.engine.filters.WellformedReadFilter)

Example 7 with WellformedReadFilter

use of org.broadinstitute.hellbender.engine.filters.WellformedReadFilter in project gatk by broadinstitute.

the class IntervalAlignmentContextIteratorUnitTest method getAlignmentContexts.

private List<AlignmentContext> getAlignmentContexts(final List<SimpleInterval> locusIntervals, final String bamPath) {
    final List<String> sampleNames = Collections.singletonList("NA12878");
    final ReadsDataSource gatkReads = new ReadsDataSource(IOUtils.getPath(bamPath));
    final SAMFileHeader header = gatkReads.getHeader();
    final Stream<GATKRead> filteredReads = Utils.stream(gatkReads).filter(new WellformedReadFilter(header).and(new ReadFilterLibrary.MappedReadFilter()));
    final SAMSequenceDictionary dictionary = header.getSequenceDictionary();
    final LocusIteratorByState locusIteratorByState = new LocusIteratorByState(filteredReads.iterator(), LocusIteratorByState.NO_DOWNSAMPLING, false, sampleNames, header, true);
    List<SimpleInterval> relevantIntervals = locusIntervals;
    if (relevantIntervals == null) {
        relevantIntervals = IntervalUtils.getAllIntervalsForReference(dictionary);
    }
    final IntervalLocusIterator intervalLocusIterator = new IntervalLocusIterator(relevantIntervals.iterator());
    final IntervalAlignmentContextIterator intervalAlignmentContextIterator = new IntervalAlignmentContextIterator(locusIteratorByState, intervalLocusIterator, dictionary);
    return StreamSupport.stream(Spliterators.spliteratorUnknownSize(intervalAlignmentContextIterator, Spliterator.ORDERED), false).collect(Collectors.toList());
}
Also used : GATKRead(org.broadinstitute.hellbender.utils.read.GATKRead) WellformedReadFilter(org.broadinstitute.hellbender.engine.filters.WellformedReadFilter) SAMSequenceDictionary(htsjdk.samtools.SAMSequenceDictionary) LocusIteratorByState(org.broadinstitute.hellbender.utils.locusiterator.LocusIteratorByState) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval) ReadsDataSource(org.broadinstitute.hellbender.engine.ReadsDataSource) SAMFileHeader(htsjdk.samtools.SAMFileHeader)

Example 8 with WellformedReadFilter

use of org.broadinstitute.hellbender.engine.filters.WellformedReadFilter in project gatk by broadinstitute.

the class InsertSizeMetricsCollector method getDefaultReadFilters.

/**
     * Return the read filter for InsertSizeMetrics collector.
     * @return ReadFilter to be used to filter records
     */
public List<ReadFilter> getDefaultReadFilters() {
    List<ReadFilter> readFilters = new ArrayList<>();
    readFilters.add(new WellformedReadFilter());
    readFilters.add(ReadFilterLibrary.MAPPED);
    readFilters.add(ReadFilterLibrary.PAIRED);
    readFilters.add(ReadFilterLibrary.NONZERO_FRAGMENT_LENGTH_READ_FILTER);
    readFilters.add(ReadFilterLibrary.FIRST_OF_PAIR);
    readFilters.add(ReadFilterLibrary.PROPERLY_PAIRED);
    readFilters.add(ReadFilterLibrary.NOT_DUPLICATE);
    readFilters.add(ReadFilterLibrary.NOT_SECONDARY_ALIGNMENT);
    readFilters.add(ReadFilterLibrary.NOT_SUPPLEMENTARY_ALIGNMENT);
    readFilters.add(new MappingQualityReadFilter(0));
    return readFilters;
}
Also used : WellformedReadFilter(org.broadinstitute.hellbender.engine.filters.WellformedReadFilter) ArrayList(java.util.ArrayList) MappingQualityReadFilter(org.broadinstitute.hellbender.engine.filters.MappingQualityReadFilter) ReadFilter(org.broadinstitute.hellbender.engine.filters.ReadFilter) WellformedReadFilter(org.broadinstitute.hellbender.engine.filters.WellformedReadFilter) MappingQualityReadFilter(org.broadinstitute.hellbender.engine.filters.MappingQualityReadFilter)

Example 9 with WellformedReadFilter

use of org.broadinstitute.hellbender.engine.filters.WellformedReadFilter in project gatk-protected by broadinstitute.

the class HaplotypeCallerEngine method makeStandardHCReadFilters.

/**
     * @return the default set of read filters for use with the HaplotypeCaller
     */
public static List<ReadFilter> makeStandardHCReadFilters() {
    List<ReadFilter> filters = new ArrayList<>();
    filters.add(new MappingQualityReadFilter(READ_QUALITY_FILTER_THRESHOLD));
    filters.add(ReadFilterLibrary.MAPPING_QUALITY_AVAILABLE);
    filters.add(ReadFilterLibrary.MAPPED);
    filters.add(ReadFilterLibrary.PRIMARY_ALIGNMENT);
    filters.add(ReadFilterLibrary.NOT_DUPLICATE);
    filters.add(ReadFilterLibrary.PASSES_VENDOR_QUALITY_CHECK);
    filters.add(ReadFilterLibrary.NON_ZERO_REFERENCE_LENGTH_ALIGNMENT);
    filters.add(ReadFilterLibrary.GOOD_CIGAR);
    filters.add(new WellformedReadFilter());
    return filters;
}
Also used : WellformedReadFilter(org.broadinstitute.hellbender.engine.filters.WellformedReadFilter) MappingQualityReadFilter(org.broadinstitute.hellbender.engine.filters.MappingQualityReadFilter) ReadFilter(org.broadinstitute.hellbender.engine.filters.ReadFilter) WellformedReadFilter(org.broadinstitute.hellbender.engine.filters.WellformedReadFilter) MappingQualityReadFilter(org.broadinstitute.hellbender.engine.filters.MappingQualityReadFilter)

Example 10 with WellformedReadFilter

use of org.broadinstitute.hellbender.engine.filters.WellformedReadFilter in project gatk-protected by broadinstitute.

the class Mutect2Engine method makeStandardMutect2ReadFilters.

/**
     * @return the default set of read filters for use with Mutect2
     */
public static List<ReadFilter> makeStandardMutect2ReadFilters() {
    // The order in which we apply filters is important. Cheap filters come first so we fail fast
    List<ReadFilter> filters = new ArrayList<>();
    filters.add(new MappingQualityReadFilter(READ_QUALITY_FILTER_THRESHOLD));
    filters.add(ReadFilterLibrary.MAPPING_QUALITY_AVAILABLE);
    filters.add(ReadFilterLibrary.MAPPING_QUALITY_NOT_ZERO);
    filters.add(ReadFilterLibrary.MAPPED);
    filters.add(ReadFilterLibrary.PRIMARY_ALIGNMENT);
    filters.add(ReadFilterLibrary.NOT_DUPLICATE);
    filters.add(ReadFilterLibrary.PASSES_VENDOR_QUALITY_CHECK);
    filters.add(ReadFilterLibrary.NON_ZERO_REFERENCE_LENGTH_ALIGNMENT);
    filters.add(GOOD_READ_LENGTH_FILTER);
    filters.add(ReadFilterLibrary.MATE_ON_SAME_CONTIG_OR_NO_MAPPED_MATE);
    filters.add(ReadFilterLibrary.GOOD_CIGAR);
    filters.add(new WellformedReadFilter());
    return filters;
}
Also used : WellformedReadFilter(org.broadinstitute.hellbender.engine.filters.WellformedReadFilter) MappingQualityReadFilter(org.broadinstitute.hellbender.engine.filters.MappingQualityReadFilter) ReadFilter(org.broadinstitute.hellbender.engine.filters.ReadFilter) WellformedReadFilter(org.broadinstitute.hellbender.engine.filters.WellformedReadFilter) MappingQualityReadFilter(org.broadinstitute.hellbender.engine.filters.MappingQualityReadFilter)

Aggregations

WellformedReadFilter (org.broadinstitute.hellbender.engine.filters.WellformedReadFilter)12 ReadFilter (org.broadinstitute.hellbender.engine.filters.ReadFilter)10 MappingQualityReadFilter (org.broadinstitute.hellbender.engine.filters.MappingQualityReadFilter)6 ArrayList (java.util.ArrayList)4 CountingReadFilter (org.broadinstitute.hellbender.engine.filters.CountingReadFilter)3 ReadFilterLibrary (org.broadinstitute.hellbender.engine.filters.ReadFilterLibrary)3 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)2 SAMFileHeader (htsjdk.samtools.SAMFileHeader)1 SAMSequenceDictionary (htsjdk.samtools.SAMSequenceDictionary)1 IndexedFastaSequenceFile (htsjdk.samtools.reference.IndexedFastaSequenceFile)1 File (java.io.File)1 Path (java.nio.file.Path)1 Pair (org.apache.commons.lang3.tuple.Pair)1 ReadsDataSource (org.broadinstitute.hellbender.engine.ReadsDataSource)1 ActivityProfileState (org.broadinstitute.hellbender.utils.activityprofile.ActivityProfileState)1 CachingIndexedFastaSequenceFile (org.broadinstitute.hellbender.utils.fasta.CachingIndexedFastaSequenceFile)1 LocusIteratorByState (org.broadinstitute.hellbender.utils.locusiterator.LocusIteratorByState)1 GATKRead (org.broadinstitute.hellbender.utils.read.GATKRead)1 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)1 Test (org.testng.annotations.Test)1