Package org.broadinstitute.gatk.utils

Examples of org.broadinstitute.gatk.utils.GenomeLoc.overlapsP()


            if ( !sawReadInCurrentInterval )
                emit(read);
            else
                readsNotToClean.add(read);
        }
        else if ( readLoc.overlapsP(currentInterval) ) {
            sawReadInCurrentInterval = true;

            if ( doNotTryToClean(read) ) {
                readsNotToClean.add(read);
            } else {
View Full Code Here


                    final int readStop = Math.min(readStart + readSize, contigLength);
                    final int readLength = readStop - readStart + 1;
                    if ( readLength > 0 ) {
                        GATKSAMRecord read = ArtificialSAMUtils.createArtificialRead(header, "read", 0, readStart, readLength);
                        final GenomeLoc readLoc = genomeLocParser.createGenomeLoc(read);
                        if ( readLoc.overlapsP(loc) )
                            tests.add(new Object[]{loc, read});
                    }
                }
            }
        }
View Full Code Here

            final GenomeLoc nextLoc = futureFeatures.peek().getLocation();
            if ( nextLoc.isBefore(loc) ) {
                futureFeatures.next(); // next rod element is before loc, throw it away and keep looking
            } else if ( nextLoc.isPast(loc) ) {
                break; // next element is past loc, stop looking but don't pop it
            } else if ( nextLoc.overlapsP(loc) ) {
                // add overlapping elements to our current features, removing from stream
                for ( final GATKFeature feature : futureFeatures.next() ) {
                    currentFeatures.add(feature);
                }
            }
View Full Code Here

        while ( ! master.isEmpty() ) { // there's still unchecked bases in master
            final GenomeLoc masterHead = master.pop();
            final GenomeLoc testHead = test.pop();

            if ( testHead.overlapsP(masterHead) ) {
                // remove the parts of test that overlap master, and push the remaining
                // parts onto master for further comparison.
                for ( final GenomeLoc masterPart : Utils.reverse(masterHead.subtract(testHead)) ) {
                    master.push(masterPart);
                }
View Full Code Here

     * @param read the read we want to test
     * @return true if read can be added to this region, false otherwise
     */
    public boolean readOverlapsRegion(final GATKSAMRecord read) {
        final GenomeLoc readLoc = genomeLocParser.createGenomeLoc( read );
        return readLoc.overlapsP(extendedLoc);
    }

    /**
     * Add all reads to this active region
     * @param reads a collection of reads to add to this active region
View Full Code Here

        List<SAMRecord> coveredSubset = new ArrayList<SAMRecord>();

        for( SAMRecord read: reads ) {
            GenomeLoc readPosition = genomeLocParser.createGenomeLoc(read);
            if( contained && region.containsP(readPosition) ) coveredSubset.add(read);
            else if( !contained && readPosition.overlapsP(region) ) coveredSubset.add(read);
        }

        final Iterator<SAMRecord> iterator = coveredSubset.iterator();
        return new SAMRecordIterator() {
            public boolean hasNext() { return iterator.hasNext(); }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.