Package org.broadinstitute.gatk.engine.downsampling

Examples of org.broadinstitute.gatk.engine.downsampling.DownsamplingMethod


        final ThreadAllocation ta = new ThreadAllocation();
        final Integer numFileHandles = 1; // I believe that any value would do but need to confirm.
        final boolean useOriginalBaseQualities = true;
        final ValidationStringency strictness = ValidationStringency.LENIENT;
        final Integer readBufferSize = 1; // not relevant.
        final DownsamplingMethod downsamplingMethod = DownsamplingMethod.NONE;
        final ValidationExclusion exclusionList = composeValidationExclusion();
        final Collection<ReadFilter> supplementalFilters = Collections.EMPTY_SET;
        final boolean includeReadsWithDeletionAtLoci = true;

        final GenomeLocParser glp = new GenomeLocParser(header.getSequenceDictionary());
View Full Code Here


     */
    public DownsamplingMethod getDownsamplingMethod() {
        if ( downsamplingType == null && downsampleFraction == null && downsampleCoverage == null )
            return null;

        return new DownsamplingMethod(downsamplingType, downsampleCoverage, downsampleFraction);
    }
View Full Code Here

    }

    protected DownsamplingMethod getDownsamplingMethod() {
        GATKArgumentCollection argCollection = this.getArguments();

        DownsamplingMethod commandLineMethod = argCollection.getDownsamplingMethod();
        DownsamplingMethod walkerMethod = WalkerManager.getDownsamplingMethod(walker);

        DownsamplingMethod method = commandLineMethod != null ? commandLineMethod : walkerMethod;
        method.checkCompatibilityWithWalker(walker);
        return method;
    }
View Full Code Here

     * @param intervals intervals
     * @return the sharding strategy
     */
    protected Iterable<Shard> getShardStrategy(SAMDataSource readsDataSource, ReferenceSequenceFile drivingDataSource, GenomeLocSortedSet intervals) {
        ValidationExclusion exclusions = (readsDataSource != null ? readsDataSource.getReadsInfo().getValidationExclusionList() : null);
        DownsamplingMethod downsamplingMethod = readsDataSource != null ? readsDataSource.getReadsInfo().getDownsamplingMethod() : null;
        ReferenceDataSource referenceDataSource = this.getReferenceDataSource();

        // If reads are present, assume that accessing the reads is always the dominant factor and shard based on that supposition.
        if(!readsDataSource.isEmpty()) {
            if(!readsDataSource.hasIndex() && !exclusions.contains(ValidationExclusion.TYPE.ALLOW_UNINDEXED_BAM))
View Full Code Here

     * @param refReader reader
     * @return A data source for the given set of reads.
     */
    private SAMDataSource createReadsDataSource(final GATKArgumentCollection argCollection, final GenomeLocParser genomeLocParser,
                                                final IndexedFastaSequenceFile refReader, final Map<String, String> sampleRenameMap) {
        DownsamplingMethod downsamplingMethod = getDownsamplingMethod();

        // Synchronize the method back into the collection so that it shows up when
        // interrogating for the downsampling method during command line recreation.
        setDownsamplingMethod(downsamplingMethod);

View Full Code Here

     * be used instead.
     * @param walkerClass The class of the walker to interrogate.
     * @return The downsampling method, as specified by the walker.  Null if none exists.
     */
    public static DownsamplingMethod getDownsamplingMethod( Class<? extends Walker> walkerClass ) {
        DownsamplingMethod downsamplingMethod = null;

        if( walkerClass.isAnnotationPresent(Downsample.class) ) {
            Downsample downsampleParameters = walkerClass.getAnnotation(Downsample.class);
            DownsampleType type = downsampleParameters.by();
            Integer toCoverage = downsampleParameters.toCoverage() >= 0 ? downsampleParameters.toCoverage() : null;
            Double toFraction = downsampleParameters.toFraction() >= 0.0d ? downsampleParameters.toFraction() : null;
            downsamplingMethod = new DownsamplingMethod(type, toCoverage, toFraction);
        }

        return downsamplingMethod;
    }
View Full Code Here

                                            final int downsampleTo) {
        //logger.warn(String.format("testLIBSKeepSubmittedReads %d %d %d %b %b %b", nReadsPerLocus, nLoci, nSamples, keepReads, grabReadsAfterEachCycle, downsample));
        final int readLength = 10;

        final boolean downsample = downsampleTo != -1;
        final DownsamplingMethod downsampler = downsample
                ? new DownsamplingMethod(DownsampleType.BY_SAMPLE, downsampleTo, null)
                : new DownsamplingMethod(DownsampleType.NONE, null, null);

        final ArtificialBAMBuilder bamBuilder = new ArtificialBAMBuilder(header.getSequenceDictionary(), nReadsPerLocus, nLoci);
        bamBuilder.createAndSetHeader(nSamples).setReadLength(readLength).setAlignmentStart(1);

        final List<GATKSAMRecord> reads = bamBuilder.makeReads();
View Full Code Here

            rg.setPlatform(NGSPlatform.ILLUMINA.getDefaultPlatform());
            header.addReadGroup(rg);
        }

        final boolean downsample = downsampleTo != -1;
        final DownsamplingMethod downsampler = downsample
                ? new DownsamplingMethod(DownsampleType.BY_SAMPLE, downsampleTo, null)
                : new DownsamplingMethod(DownsampleType.NONE, null, null);

        // final List<GATKSAMRecord> reads = ArtificialSAMUtils.createReadStream(nReadsPerLocus, nLoci, header, 1, readLength);

        final WeakReadTrackingIterator iterator = new WeakReadTrackingIterator(nReadsPerLocus, readLength, payloadInBytes, header);
View Full Code Here

            this.numContigs = numContigs;
            this.numStacksPerContig = numStacksPerContig;
            this.stackSize = stackSize;
            this.numUnmappedReads = numUnmappedReads;

            this.downsamplingMethod = new DownsamplingMethod(DownsampleType.BY_SAMPLE, downsamplingTargetCoverage, null);
            this.expectedReadCount = Math.min(stackSize, downsamplingTargetCoverage) * numStacksPerContig * numContigs + numUnmappedReads;

            setName(String.format("%s: numContigs=%d numStacksPerContig=%d stackSize=%d numUnmappedReads=%d downsamplingTargetCoverage=%d",
                                  getClass().getSimpleName(), numContigs, numStacksPerContig, stackSize, numUnmappedReads, downsamplingTargetCoverage));
        }
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.engine.downsampling.DownsamplingMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.