Search in sources :

Example 6 with CountingReadFilter

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

the class AssemblyRegionWalker method traverse.

@Override
public final void traverse() {
    CountingReadFilter countedFilter = makeReadFilter();
    // Since we're processing regions rather than individual reads, tell the progress
    // meter to check the time more frequently (every 10 regions instead of every 1000 regions).
    progressMeter.setRecordsBetweenTimeChecks(10L);
    for (final LocalReadShard readShard : readShards) {
        // Since reads in each shard are lazily fetched, we need to pass the filter to the window
        // instead of filtering the reads directly here
        readShard.setReadFilter(countedFilter);
        readShard.setDownsampler(maxReadsPerAlignmentStart > 0 ? new PositionalDownsampler(maxReadsPerAlignmentStart, getHeaderForReads()) : null);
        currentReadShard = readShard;
        processReadShard(readShard, // use the fully-padded window to fetch overlapping data
        new ReferenceContext(reference, readShard.getPaddedInterval()), new FeatureContext(features, readShard.getPaddedInterval()));
    }
    logger.info(countedFilter.getSummaryLine());
}
Also used : CountingReadFilter(org.broadinstitute.hellbender.engine.filters.CountingReadFilter) PositionalDownsampler(org.broadinstitute.hellbender.utils.downsampling.PositionalDownsampler)

Example 7 with CountingReadFilter

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

the class FeatureWalker method traverse.

/**
     * Implementation of Feature-based traversal.
     * Subclasses can override to provide their own behavior but default implementation should be suitable for most uses.
     */
@Override
public void traverse() {
    CountingReadFilter readFilter = makeReadFilter();
    // Process each feature in the input stream.
    Utils.stream(drivingFeatures).forEach(feature -> {
        final SimpleInterval featureInterval = new SimpleInterval(feature);
        apply(feature, new ReadsContext(reads, featureInterval, readFilter), new ReferenceContext(reference, featureInterval), new FeatureContext(features, featureInterval));
        progressMeter.update(feature);
    });
}
Also used : CountingReadFilter(org.broadinstitute.hellbender.engine.filters.CountingReadFilter) SimpleInterval(org.broadinstitute.hellbender.utils.SimpleInterval)

Aggregations

CountingReadFilter (org.broadinstitute.hellbender.engine.filters.CountingReadFilter)7 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)5 SAMFileHeader (htsjdk.samtools.SAMFileHeader)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 MappingQualityReadFilter (org.broadinstitute.hellbender.engine.filters.MappingQualityReadFilter)1 VariantFilter (org.broadinstitute.hellbender.engine.filters.VariantFilter)1 WellformedReadFilter (org.broadinstitute.hellbender.engine.filters.WellformedReadFilter)1 ActivityProfileState (org.broadinstitute.hellbender.utils.activityprofile.ActivityProfileState)1 PositionalDownsampler (org.broadinstitute.hellbender.utils.downsampling.PositionalDownsampler)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