當前位置: 首頁>>代碼示例>>Java>>正文


Java WellformedReadFilter類代碼示例

本文整理匯總了Java中org.broadinstitute.hellbender.engine.filters.WellformedReadFilter的典型用法代碼示例。如果您正苦於以下問題:Java WellformedReadFilter類的具體用法?Java WellformedReadFilter怎麽用?Java WellformedReadFilter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WellformedReadFilter類屬於org.broadinstitute.hellbender.engine.filters包,在下文中一共展示了WellformedReadFilter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: makeStandardMutect2ReadFilters

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
/**
 * @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;
}
 
開發者ID:broadinstitute,項目名稱:gatk-protected,代碼行數:22,代碼來源:Mutect2Engine.java

示例2: getDefaultReadFilters

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
/**
 * 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;
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:21,代碼來源:InsertSizeMetricsCollector.java

示例3: getDefaultReadFilters

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
@Override
public List<ReadFilter> getDefaultReadFilters() {
    final List<ReadFilter> filters = new ArrayList<>();
    filters.add(new MappingQualityReadFilter(MAPPING_QUALITY_THRESHOLD));
    filters.add(ReadFilterLibrary.MAPPING_QUALITY_AVAILABLE);
    filters.add(ReadFilterLibrary.MAPPING_QUALITY_NOT_ZERO);
    filters.add(ReadFilterLibrary.MAPPED);
    filters.add(ReadFilterLibrary.PRIMARY_LINE);
    filters.add(ReadFilterLibrary.NOT_DUPLICATE);
    filters.add(ReadFilterLibrary.PASSES_VENDOR_QUALITY_CHECK);
    filters.add(ReadFilterLibrary.NON_ZERO_REFERENCE_LENGTH_ALIGNMENT);
    filters.add(ReadFilterLibrary.MATE_ON_SAME_CONTIG_OR_NO_MAPPED_MATE);
    filters.add(ReadFilterLibrary.GOOD_CIGAR);
    filters.add(new WellformedReadFilter());
    return filters;
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:17,代碼來源:GetPileupSummaries.java

示例4: makeStandardMutect2ReadFilters

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
/**
 * @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.NOT_SECONDARY_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;
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:22,代碼來源:Mutect2Engine.java

示例5: makeStandardHCReadFilters

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
/**
 * @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;
}
 
開發者ID:broadinstitute,項目名稱:gatk-protected,代碼行數:18,代碼來源:HaplotypeCallerEngine.java

示例6: makeGenomeReadFilter

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
/**
 * Filter reads based on marked parameters
 * @return never {@code null}
 */
private ReadFilter makeGenomeReadFilter() {
    return new WellformedReadFilter(getHeaderForReads())
            .and(ReadFilterLibrary.MAPPED)
            .and(ReadFilterLibrary.NOT_DUPLICATE)
            .and(ReadFilterLibrary.NON_ZERO_REFERENCE_LENGTH_ALIGNMENT)
            .and(ReadFilterLibrary.PASSES_VENDOR_QUALITY_CHECK);
}
 
開發者ID:broadinstitute,項目名稱:gatk-protected,代碼行數:12,代碼來源:SparkGenomeReadCounts.java

示例7: getDefaultReadFilters

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
@Override
public List<ReadFilter> getDefaultReadFilters() {
    final List<ReadFilter> defaultFilters = new ArrayList<>(2);
    defaultFilters.add(new WellformedReadFilter());
    defaultFilters.add(new ReadFilterLibrary.MappedReadFilter());
    return defaultFilters;
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:8,代碼來源:AssemblyRegionWalkerSpark.java

示例8: makeStandardHCReadFilters

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
/**
 * @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.NOT_SECONDARY_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;
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:18,代碼來源:HaplotypeCallerEngine.java

示例9: getDefaultReadFilters

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
@Override
public List<ReadFilter> getDefaultReadFilters() {
    List<ReadFilter> filterList = new ArrayList<>(5);
    filterList.add(ReadFilterLibrary.MAPPED);
    filterList.add(ReadFilterLibrary.NOT_DUPLICATE);
    filterList.add(ReadFilterLibrary.PASSES_VENDOR_QUALITY_CHECK);
    filterList.add(ReadFilterLibrary.NOT_SECONDARY_ALIGNMENT);
    filterList.add(new WellformedReadFilter());
    return filterList;
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:11,代碼來源:PileupSpark.java

示例10: testIncludeReadsWithDeletionsInIsActivePileups

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
@Test(dataProvider = "testIncludeReadsWithDeletionsInIsActivePileupsData")
public void testIncludeReadsWithDeletionsInIsActivePileups(final String reads, final String reference, final SimpleInterval deletionInterval, final boolean includeReadsWithDeletionsInIsActivePileups, final int expectedNumDeletions) {
    try ( final ReadsDataSource readsSource = new ReadsDataSource(IOUtils.getPath(reads));
          final ReferenceDataSource refSource = ReferenceDataSource.of(IOUtils.getPath(reference)) ) {
        final SAMSequenceDictionary readsDictionary = readsSource.getSequenceDictionary();
        final SimpleInterval shardInterval = deletionInterval.expandWithinContig(50, readsDictionary);
        final MultiIntervalLocalReadShard readShard = new MultiIntervalLocalReadShard(Arrays.asList(shardInterval), 50, readsSource);

        // Set up our fake AssemblyRegionEvaluator to check that the deletionInterval locus contains
        // expectedNumDeletions reads with deletions in its pileup during the call to isActive()
        final AssemblyRegionEvaluator evaluator = new FakeAssertingAssemblyRegionEvaluator(deletionInterval, expectedNumDeletions);

        final List<ReadFilter> readFilters = new ArrayList<>(2);
        readFilters.add(new WellformedReadFilter());
        readFilters.add(new ReadFilterLibrary.MappedReadFilter());
        final CountingReadFilter combinedReadFilter = CountingReadFilter.fromList(readFilters, readsSource.getHeader());
        readShard.setReadFilter(combinedReadFilter);

        final AssemblyRegionIterator iter = new AssemblyRegionIterator(readShard, readsSource.getHeader(), refSource, null, evaluator, 50, 300, 50, 0.002, 50, includeReadsWithDeletionsInIsActivePileups);

        // Pull from the AssemblyRegionIterator to trigger the call into the FakeAssertingAssemblyRegionEvaluator,
        // which does the actual assert on the pileups passed to isActive()
        while ( iter.hasNext() ) {
            final AssemblyRegion region = iter.next();
        }
    }
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:28,代碼來源:AssemblyRegionIteratorUnitTest.java

示例11: getReadFilters

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
@Override
protected ImmutableList<ReadFilter> getReadFilters( SAMFileHeader header ){
    return ImmutableList.of(new WellformedReadFilter(header));
}
 
開發者ID:broadinstitute,項目名稱:gatk-dataflow,代碼行數:5,代碼來源:FlagStatDataflow.java

示例12: getReadFilters

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
@Override
protected ImmutableList<ReadFilter> getReadFilters( final SAMFileHeader header ){
    return ImmutableList.of(new WellformedReadFilter(header));
}
 
開發者ID:broadinstitute,項目名稱:gatk-dataflow,代碼行數:5,代碼來源:CountBasesDataflow.java

示例13: getStandardBQSRReadFilterList

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
/**
 * 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;
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:10,代碼來源:BaseRecalibrator.java

示例14: testRegionsHaveCorrectReadsAndSize

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
@Test(dataProvider = "testCorrectRegionsHaveCorrectReadsAndSizeData")
public void testRegionsHaveCorrectReadsAndSize( final String reads, final String reference, final List<SimpleInterval> shardIntervals, final int minRegionSize, final int maxRegionSize, final int assemblyRegionPadding ) throws IOException {
    try ( final ReadsDataSource readsSource = new ReadsDataSource(IOUtils.getPath(reads));
          final ReferenceDataSource refSource = ReferenceDataSource.of(IOUtils.getPath(reference)) ) {
        final SAMSequenceDictionary readsDictionary = readsSource.getSequenceDictionary();
        final MultiIntervalLocalReadShard readShard = new MultiIntervalLocalReadShard(shardIntervals, assemblyRegionPadding, readsSource);
        final AssemblyRegionEvaluator evaluator = new HaplotypeCallerEngine(new HaplotypeCallerArgumentCollection(), false, false, readsSource.getHeader(), new CachingIndexedFastaSequenceFile(IOUtils.getPath(b37_reference_20_21)));
        final ReadCoordinateComparator readComparator = new ReadCoordinateComparator(readsSource.getHeader());

        final List<ReadFilter> readFilters = new ArrayList<>(2);
        readFilters.add(new WellformedReadFilter());
        readFilters.add(new ReadFilterLibrary.MappedReadFilter());
        final CountingReadFilter combinedReadFilter = CountingReadFilter.fromList(readFilters, readsSource.getHeader());
        readShard.setReadFilter(combinedReadFilter);

        final AssemblyRegionIterator iter = new AssemblyRegionIterator(readShard, readsSource.getHeader(), refSource, null, evaluator, minRegionSize, maxRegionSize, assemblyRegionPadding, 0.002, 50, true);

        AssemblyRegion previousRegion = null;
        while ( iter.hasNext() ) {
            final AssemblyRegion region = iter.next();

            Assert.assertTrue(region.getSpan().size() <= maxRegionSize, "region size " + region.getSpan().size() + " exceeds the configured maximum: " + maxRegionSize);

            final int regionContigLength = readsDictionary.getSequence(region.getSpan().getContig()).getSequenceLength();
            final int expectedLeftRegionPadding = region.getSpan().getStart() - assemblyRegionPadding > 0 ? assemblyRegionPadding : region.getSpan().getStart() - 1;
            final int expectedRightRegionPadding = region.getSpan().getEnd() + assemblyRegionPadding <= regionContigLength ? assemblyRegionPadding : regionContigLength - region.getSpan().getEnd();
            Assert.assertEquals(region.getSpan().getStart() - region.getExtendedSpan().getStart(), expectedLeftRegionPadding, "Wrong amount of padding on the left side of the region");
            Assert.assertEquals(region.getExtendedSpan().getEnd() - region.getSpan().getEnd(), expectedRightRegionPadding, "Wrong amount of padding on the right side of the region");
            final SimpleInterval regionInterval = region.getExtendedSpan();
            final List<GATKRead> regionActualReads = region.getReads();

            if ( previousRegion != null ) {
                Assert.assertTrue(IntervalUtils.isBefore(previousRegion.getSpan(), region.getSpan(), readsDictionary), "Previous assembly region's span is not before the current assembly region's span");
                Assert.assertEquals(previousRegion.getSpan().getEnd(), region.getSpan().getStart() - 1, "previous and current regions are not contiguous");
            }

            GATKRead previousRead = null;
            for ( final GATKRead currentRead : regionActualReads ) {
                if ( previousRead != null ) {
                    Assert.assertTrue(readComparator.compare(previousRead, currentRead) <= 0, "Reads are out of order within the assembly region");
                }
                previousRead = currentRead;
            }

            try ( final ReadsDataSource innerReadsSource = new ReadsDataSource(IOUtils.getPath(reads)) ) {
                final List<GATKRead> regionExpectedReads = Lists.newArrayList(innerReadsSource.query(regionInterval)).stream().filter(combinedReadFilter).collect(Collectors.toList());

                final List<GATKRead> actualNotInExpected = new ArrayList<>();
                final List<GATKRead> expectedNotInActual = new ArrayList<>();
                for ( final GATKRead expectedRead : regionExpectedReads ) {
                    if ( ! regionActualReads.contains(expectedRead) ) {
                        expectedNotInActual.add(expectedRead);
                    }
                }

                for ( final GATKRead actualRead : regionActualReads ) {
                    if ( ! regionExpectedReads.contains(actualRead) ) {
                        actualNotInExpected.add(actualRead);
                    }
                }

                Assert.assertEquals(regionActualReads.size(), regionExpectedReads.size(), "Wrong number of reads in region " + region + " for extended interval " + regionInterval +
                        ". Expected reads not in actual reads: " + expectedNotInActual + ". Actual reads not in expected reads: " + actualNotInExpected);

                Assert.assertEquals(regionActualReads, regionExpectedReads, "Wrong reads in region " + region + " for extended interval " + regionInterval +
                        ". Expected reads not in actual reads: " + expectedNotInActual + ". Actual reads not in expected reads: " + actualNotInExpected);
            }
        }
    }
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:71,代碼來源:AssemblyRegionIteratorUnitTest.java

示例15: getAlignmentContexts

import org.broadinstitute.hellbender.engine.filters.WellformedReadFilter; //導入依賴的package包/類
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());
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:23,代碼來源:IntervalAlignmentContextIteratorUnitTest.java


注:本文中的org.broadinstitute.hellbender.engine.filters.WellformedReadFilter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。