Support for detecting and automatically excluding reads reading into the adaptor sequence and, if desired, also only showing the first pair when two reads overlap in the fragment. Not enabled, an intermediate check in before updating and verifying the impact on locus walkers everywhere.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3465 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
beb8a83ca4
commit
2b02324587
|
|
@ -180,6 +180,10 @@ public class GATKArgumentCollection {
|
|||
@Argument(fullName = "enable_threaded_debugging",shortName="etd", doc="Enable debugging of threaded apps by applying exception catching in the threaded version of the GATK.", required = false)
|
||||
public boolean enableThreadedDebugging = false;
|
||||
|
||||
@Element(required = false)
|
||||
@Argument(fullName = "enable_overlap_filters",shortName="eof", doc="Enable automatic removal of bases that overlap adaptor sequence or that overlap their mate pair", required = false)
|
||||
public boolean enableOverlapFilters = false;
|
||||
|
||||
/**
|
||||
* marshal the data out to a object
|
||||
*
|
||||
|
|
@ -340,6 +344,9 @@ public class GATKArgumentCollection {
|
|||
if (enableThreadedDebugging != other.enableThreadedDebugging) {
|
||||
return false;
|
||||
}
|
||||
if (enableOverlapFilters != other.enableOverlapFilters) {
|
||||
return false;
|
||||
}
|
||||
if ((other.RODToInterval == null && RODToInterval != null) ||
|
||||
(other.RODToInterval != null && !other.RODToInterval.equals(RODToInterval))) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.broadinstitute.sting.gatk.datasources.shards.ShardStrategy;
|
|||
import org.broadinstitute.sting.gatk.datasources.simpleDataSources.ReferenceOrderedDataSource;
|
||||
import org.broadinstitute.sting.gatk.datasources.simpleDataSources.SAMDataSource;
|
||||
import org.broadinstitute.sting.gatk.walkers.Walker;
|
||||
import org.broadinstitute.sting.gatk.walkers.LocusWalker;
|
||||
import org.broadinstitute.sting.gatk.io.DirectOutputTracker;
|
||||
import org.broadinstitute.sting.gatk.io.OutputTracker;
|
||||
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
|
||||
|
|
@ -57,7 +58,8 @@ public class LinearMicroScheduler extends MicroScheduler {
|
|||
for (Shard shard : shardStrategy) {
|
||||
// New experimental code for managing locus intervals.
|
||||
if(shard.getShardType() == Shard.ShardType.LOCUS || shard.getShardType() == Shard.ShardType.LOCUS_INTERVAL) {
|
||||
WindowMaker windowMaker = new WindowMaker(getReadIterator(shard), shard.getGenomeLocs(), walker.getMandatoryReadFilters());
|
||||
LocusWalker lWalker = (LocusWalker)walker;
|
||||
WindowMaker windowMaker = new WindowMaker(getReadIterator(shard), shard.getGenomeLocs(), walker.getMandatoryReadFilters(), lWalker.getDiscards());
|
||||
for(WindowMaker.WindowMakerIterator iterator: windowMaker) {
|
||||
ShardDataProvider dataProvider = new LocusShardDataProvider(shard,iterator.getSourceInfo(),iterator.getLocus(),iterator,reference,rods);
|
||||
Object result = traversalEngine.traverse(walker, dataProvider, accumulator.getReduceInit());
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import org.broadinstitute.sting.gatk.datasources.shards.Shard;
|
|||
import org.broadinstitute.sting.gatk.traversals.TraversalEngine;
|
||||
import org.broadinstitute.sting.gatk.io.ThreadLocalOutputTracker;
|
||||
import org.broadinstitute.sting.gatk.walkers.Walker;
|
||||
import org.broadinstitute.sting.gatk.walkers.LocusWalker;
|
||||
import org.broadinstitute.sting.gatk.iterators.StingSAMIterator;
|
||||
import org.broadinstitute.sting.utils.StingException;
|
||||
|
||||
|
|
@ -59,7 +60,8 @@ public class ShardTraverser implements Callable {
|
|||
long startTime = System.currentTimeMillis();
|
||||
|
||||
Object accumulator = walker.reduceInit();
|
||||
WindowMaker windowMaker = new WindowMaker(microScheduler.getReadIterator(shard),shard.getGenomeLocs(),walker.getMandatoryReadFilters());
|
||||
LocusWalker lWalker = (LocusWalker)walker;
|
||||
WindowMaker windowMaker = new WindowMaker(microScheduler.getReadIterator(shard),shard.getGenomeLocs(),walker.getMandatoryReadFilters(), lWalker.getDiscards());
|
||||
ShardDataProvider dataProvider = null;
|
||||
try {
|
||||
for(WindowMaker.WindowMakerIterator iterator: windowMaker) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.broadinstitute.sting.gatk.executive;
|
||||
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.StingException;
|
||||
import org.broadinstitute.sting.gatk.iterators.*;
|
||||
import org.broadinstitute.sting.gatk.Reads;
|
||||
import org.broadinstitute.sting.gatk.DownsampleType;
|
||||
|
|
@ -61,17 +62,19 @@ public class WindowMaker implements Iterable<WindowMaker.WindowMakerIterator>, I
|
|||
* @param iterator The data source for this window.
|
||||
* @param intervals The set of intervals over which to traverse.
|
||||
*/
|
||||
public WindowMaker(StingSAMIterator iterator, List<GenomeLoc> intervals, List<SamRecordFilter> filters) {
|
||||
public WindowMaker(StingSAMIterator iterator, List<GenomeLoc> intervals, List<SamRecordFilter> filters, EnumSet<LocusIteratorByState.Discard> discards ) {
|
||||
this.sourceInfo = iterator.getSourceInfo();
|
||||
this.readIterator = iterator;
|
||||
|
||||
LocusIterator locusIterator;
|
||||
Iterator<SAMRecord> wrappedIterator = TraversalEngine.addMandatoryFilteringIterators(iterator, filters);
|
||||
if(sourceInfo.getDownsamplingMethod() != null &&
|
||||
(sourceInfo.getDownsamplingMethod().type == DownsampleType.EXPERIMENTAL_BY_SAMPLE || sourceInfo.getDownsamplingMethod().type == DownsampleType.EXPERIMENTAL_NAIVE_DUPLICATE_ELIMINATOR))
|
||||
(sourceInfo.getDownsamplingMethod().type == DownsampleType.EXPERIMENTAL_BY_SAMPLE || sourceInfo.getDownsamplingMethod().type == DownsampleType.EXPERIMENTAL_NAIVE_DUPLICATE_ELIMINATOR)) {
|
||||
if ( discards.size() > 0 )
|
||||
throw new StingException("Experimental downsampling iterator doesn't support base discarding at this point; complain to Matt Hanna");
|
||||
locusIterator = new DownsamplingLocusIteratorByState(wrappedIterator,sourceInfo);
|
||||
else
|
||||
locusIterator = new LocusIteratorByState(wrappedIterator,sourceInfo);
|
||||
} else
|
||||
locusIterator = new LocusIteratorByState(wrappedIterator,sourceInfo, discards);
|
||||
|
||||
this.locusOverflowTracker = locusIterator.getLocusOverflowTracker();
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ import java.util.*;
|
|||
public class DownsamplingLocusIteratorByState extends LocusIterator {
|
||||
|
||||
/** our log, which we want to capture anything from this class */
|
||||
private static Logger logger = Logger.getLogger(LocusIteratorByState.class);
|
||||
private static Logger logger = Logger.getLogger(DownsamplingLocusIteratorByState.class);
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
|
|
|
|||
|
|
@ -28,8 +28,10 @@ package org.broadinstitute.sting.gatk.iterators;
|
|||
import net.sf.samtools.*;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.broadinstitute.sting.gatk.Reads;
|
||||
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
import org.broadinstitute.sting.utils.*;
|
||||
import org.broadinstitute.sting.utils.sam.ReadUtils;
|
||||
import org.broadinstitute.sting.utils.pileup.PileupElement;
|
||||
import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
|
||||
import org.broadinstitute.sting.utils.pileup.ExtendedEventPileupElement;
|
||||
|
|
@ -39,6 +41,12 @@ import java.util.*;
|
|||
|
||||
/** Iterator that traverses a SAM File, accumulating information on a per-locus basis */
|
||||
public class LocusIteratorByState extends LocusIterator {
|
||||
private static long discarded_adaptor_bases = 0L;
|
||||
private static long discarded_overlapped_bases = 0L;
|
||||
private static long observed_bases = 0L;
|
||||
|
||||
public enum Discard { ADAPTOR_BASES, SECOND_READ_OVERLAPPING_BASES }
|
||||
public static final EnumSet<Discard> NO_DISCARDS = EnumSet.noneOf(Discard.class);
|
||||
|
||||
/**
|
||||
* the overflow tracker, which makes sure we get a limited number of warnings for locus pile-ups that
|
||||
|
|
@ -251,15 +259,21 @@ public class LocusIteratorByState extends LocusIterator {
|
|||
//final boolean DEBUG2 = false && DEBUG;
|
||||
private Reads readInfo;
|
||||
private AlignmentContext nextAlignmentContext;
|
||||
private EnumSet<Discard> discards;
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// constructors and other basic operations
|
||||
//
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
public LocusIteratorByState(final Iterator<SAMRecord> samIterator, Reads readInformation) {
|
||||
public LocusIteratorByState(final Iterator<SAMRecord> samIterator, Reads readInformation ) {
|
||||
this(samIterator, readInformation, NO_DISCARDS);
|
||||
}
|
||||
|
||||
public LocusIteratorByState(final Iterator<SAMRecord> samIterator, Reads readInformation, EnumSet<Discard> discards ) {
|
||||
this.it = new PushbackIterator<SAMRecord>(samIterator);
|
||||
this.readInfo = readInformation;
|
||||
this.discards = discards;
|
||||
overflowTracker = new LocusOverflowTracker(readInformation.getMaxReadsAtLocus());
|
||||
}
|
||||
|
||||
|
|
@ -387,22 +401,36 @@ public class LocusIteratorByState extends LocusIterator {
|
|||
// todo -- performance problem -- should be lazy, really
|
||||
for ( SAMRecordState state : readStates ) {
|
||||
if ( state.getCurrentCigarOperator() != CigarOperator.D && state.getCurrentCigarOperator() != CigarOperator.N ) {
|
||||
size++;
|
||||
PileupElement p = new PileupElement(state.getRead(), state.getReadOffset());
|
||||
pile.add(p);
|
||||
ReadUtils.OverlapType overlapType = ReadUtils.readPairBaseOverlapType(state.getRead(), getLocation().getStart());
|
||||
if (discards.contains(Discard.ADAPTOR_BASES) &&
|
||||
overlapType == ReadUtils.OverlapType.IN_ADAPTOR ) {
|
||||
discarded_adaptor_bases++;
|
||||
//printStatus("Adaptor bases", discarded_adaptor_bases);
|
||||
continue;
|
||||
} else if ( discards.contains(Discard.SECOND_READ_OVERLAPPING_BASES) &&
|
||||
overlapType == ReadUtils.OverlapType.OVERLAPPING &&
|
||||
state.getRead().getSecondOfPairFlag() ) {
|
||||
// only discard second bases in the base pair
|
||||
discarded_overlapped_bases++;
|
||||
//printStatus("Overlapping bases", discarded_overlapped_bases);
|
||||
continue;
|
||||
} else {
|
||||
observed_bases++;
|
||||
pile.add(new PileupElement(state.getRead(), state.getReadOffset()));
|
||||
size++;
|
||||
}
|
||||
} else if ( readInfo.includeReadsWithDeletionAtLoci() && state.getCurrentCigarOperator() != CigarOperator.N ) {
|
||||
size++;
|
||||
pile.add(new PileupElement(state.getRead(), -1));
|
||||
nDeletions++;
|
||||
}
|
||||
|
||||
// todo -- this looks like a bug w.r.t. including reads with deletion at loci -- MAD 05/27/10
|
||||
if ( state.getRead().getMappingQuality() == 0 ) {
|
||||
nMQ0Reads++;
|
||||
}
|
||||
|
||||
// if ( state.hadIndel() ) System.out.println("Indel at "+getLocation()+" in read "+state.getRead().getReadName()) ;
|
||||
|
||||
}
|
||||
|
||||
GenomeLoc loc = getLocation();
|
||||
updateReadStates(); // critical - must be called after we get the current state offsets and location
|
||||
// if we got reads with non-D/N over the current position, we are done
|
||||
|
|
@ -411,44 +439,12 @@ public class LocusIteratorByState extends LocusIterator {
|
|||
}
|
||||
}
|
||||
|
||||
// old implementation -- uses lists of reads and offsets
|
||||
// public AlignmentContext next() {
|
||||
// //if (DEBUG) {
|
||||
// // logger.debug("in Next:");
|
||||
// // printState();
|
||||
// //}
|
||||
//
|
||||
// ArrayList<SAMRecord> reads = new ArrayList<SAMRecord>(readStates.size());
|
||||
// ArrayList<Integer> offsets = new ArrayList<Integer>(readStates.size());
|
||||
//
|
||||
// // keep iterating forward until we encounter a reference position that has something "real" hanging over it
|
||||
// // (i.e. either a real base, or a real base or a deletion if includeReadsWithDeletion is true)
|
||||
// while(true) {
|
||||
// collectPendingReads(readInfo.getMaxReadsAtLocus());
|
||||
//
|
||||
// // todo -- performance problem -- should be lazy, really
|
||||
// for ( SAMRecordState state : readStates ) {
|
||||
// if ( state.getCurrentCigarOperator() != CigarOperator.D && state.getCurrentCigarOperator() != CigarOperator.N ) {
|
||||
//// System.out.println("Location: "+getLocation()+"; Read "+state.getRead().getReadName()+"; offset="+state.getReadOffset());
|
||||
// reads.add(state.getRead());
|
||||
// offsets.add(state.getReadOffset());
|
||||
// } else if ( readInfo.includeReadsWithDeletionAtLoci() && state.getCurrentCigarOperator() != CigarOperator.N ) {
|
||||
// reads.add(state.getRead());
|
||||
// offsets.add(-1);
|
||||
// }
|
||||
// }
|
||||
// GenomeLoc loc = getLocation();
|
||||
//
|
||||
// updateReadStates(); // critical - must be called after we get the current state offsets and location
|
||||
//
|
||||
// //if (DEBUG) {
|
||||
// // logger.debug("DONE WITH NEXT, updating read states, current state is:");
|
||||
// // printState();
|
||||
// //}
|
||||
// // if we got reads with non-D/N over the current position, we are done
|
||||
// if ( reads.size() != 0 ) return new AlignmentContext(loc, reads, offsets);
|
||||
// }
|
||||
// }
|
||||
private void printStatus(final String title, long n) {
|
||||
if ( n % 10000 == 0 )
|
||||
System.out.printf("%s %d / %d = %.2f%n", title, n, observed_bases, 100.0 * n / (observed_bases + 1));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void collectPendingReads(int maxReads) {
|
||||
//if (DEBUG) {
|
||||
|
|
@ -483,6 +479,7 @@ public class LocusIteratorByState extends LocusIterator {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
if (location != null)
|
||||
overflowTracker.exceeded(GenomeLocParser.createGenomeLoc(location.getContigIndex(),location.getStart(),rightMostEnd),
|
||||
curSize);
|
||||
|
|
|
|||
|
|
@ -7,11 +7,13 @@ import org.broadinstitute.sting.gatk.traversals.TraversalStatistics;
|
|||
import org.broadinstitute.sting.gatk.filters.UnmappedReadFilter;
|
||||
import org.broadinstitute.sting.gatk.filters.NotPrimaryAlignmentReadFilter;
|
||||
import org.broadinstitute.sting.gatk.filters.DuplicateReadFilter;
|
||||
import org.broadinstitute.sting.gatk.iterators.LocusIteratorByState;
|
||||
import net.sf.picard.filter.SamRecordFilter;
|
||||
import net.sf.samtools.SAMRecord;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
|
|
@ -52,42 +54,14 @@ public abstract class LocusWalker<MapType, ReduceType> extends Walker<MapType, R
|
|||
}
|
||||
|
||||
/**
|
||||
* Class to filter out un-handle-able reads from the stream. We currently are skipping
|
||||
* unmapped reads, non-primary reads, unaligned reads, and duplicate reads.
|
||||
* Returns the set of locus iterator discards that this walker wants the engine to discard automatically
|
||||
*
|
||||
* By default, locus walkers ignore adaptor bases but still see the both bases in the overlapping but non-adaptor
|
||||
* parts of the reads.
|
||||
* @return
|
||||
*/
|
||||
private static class LocusStreamFilterFunc implements SamRecordFilter {
|
||||
SAMRecord lastRead = null;
|
||||
public boolean filterOut(SAMRecord rec) {
|
||||
boolean result = false;
|
||||
if (rec.getReadUnmappedFlag()) {
|
||||
TraversalStatistics.nUnmappedReads++;
|
||||
result = true;
|
||||
//why = "Unmapped";
|
||||
} else if (rec.getNotPrimaryAlignmentFlag()) {
|
||||
TraversalStatistics.nNotPrimary++;
|
||||
result = true;
|
||||
// why = "Not Primary";
|
||||
} else if (rec.getAlignmentStart() == SAMRecord.NO_ALIGNMENT_START) {
|
||||
TraversalStatistics.nBadAlignments++;
|
||||
result = true;
|
||||
// why = "No alignment start";
|
||||
} else if (rec.getDuplicateReadFlag()) {
|
||||
TraversalStatistics.nDuplicates++;
|
||||
result = true;
|
||||
// why = "Duplicate reads";
|
||||
}
|
||||
else {
|
||||
result = false;
|
||||
}
|
||||
|
||||
if (result) {
|
||||
TraversalStatistics.nSkippedReads++;
|
||||
//System.out.printf(" [filter] %s => %b %s", rec.getReadName(), result, why);
|
||||
} else {
|
||||
TraversalStatistics.nReads++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
public EnumSet<LocusIteratorByState.Discard> getDiscards() {
|
||||
return LocusIteratorByState.NO_DISCARDS;
|
||||
//return EnumSet.of(LocusIteratorByState.Discard.ADAPTOR_BASES);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.broadinstitute.sting.utils.pileup;
|
|||
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
import org.broadinstitute.sting.utils.*;
|
||||
import org.broadinstitute.sting.utils.sam.ReadUtils;
|
||||
import net.sf.samtools.SAMRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import org.broadinstitute.sting.utils.pileup.ExtendedPileupElement;
|
|||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.StingException;
|
||||
import org.broadinstitute.sting.utils.BaseUtils;
|
||||
import org.broadinstitute.sting.utils.sam.ReadUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -350,16 +351,6 @@ public class ReadBackedPileup implements Iterable<PileupElement> {
|
|||
return nMQ0Reads;
|
||||
}
|
||||
|
||||
// public int getNumberOfDeletions() {
|
||||
// int n = 0;
|
||||
//
|
||||
// for ( int i = 0; i < size(); i++ ) {
|
||||
// if ( getOffsets().get(i) != -1 ) { n++; }
|
||||
// }
|
||||
//
|
||||
// return n;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @return the number of elements in this pileup
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -72,6 +72,80 @@ public class ReadUtils {
|
|||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// utilities for detecting overlapping reads
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Detects read pairs where the reads are so long relative to the over fragment size that they are
|
||||
* reading into each other's adaptors.
|
||||
*
|
||||
* Normally, fragments are sufficiently far apart that reads aren't reading into each other.
|
||||
*
|
||||
* |--------------------> first read
|
||||
* <--------------------| second read
|
||||
*
|
||||
* Sometimes, mostly due to lab errors or constraints, fragment library are made too short relative to the
|
||||
* length of the reads. For example, it's possible to have 76bp PE reads with 125 bp inserts, so that ~25 bp of each
|
||||
* read overlaps with its mate.
|
||||
*
|
||||
* |--------OOOOOOOOOOOO> first read
|
||||
* <OOOOOOOOOOOO------------| second read
|
||||
*
|
||||
* This filter deals with the situation where the fragment is so small that the each read actually reads into the
|
||||
* adaptor sequence of its mate, generating mismatches at both ends of the read:
|
||||
*
|
||||
* |----------------XXXX> first read
|
||||
* <XXXX----------------| second read
|
||||
*
|
||||
* The code below returns NOT_OVERLAPPING for the first case, IN_ADAPTOR for the last case, and OVERLAPPING
|
||||
* given a read and a reference aligned base position.
|
||||
*
|
||||
* @author depristo
|
||||
* @version 0.1
|
||||
*/
|
||||
|
||||
public enum OverlapType { NOT_OVERLAPPING, IN_ADAPTOR, OVERLAPPING };
|
||||
|
||||
public static OverlapType readPairBaseOverlapType(final SAMRecord rec, long basePos, final int adaptorLength) {
|
||||
OverlapType state = OverlapType.NOT_OVERLAPPING;
|
||||
long isize = rec.getInferredInsertSize();
|
||||
if ( isize > 0 ) { // we're not an unmapped pair -- cannot filter out
|
||||
long adaptorStart, adaptorEnd;
|
||||
long mateStart = rec.getMateAlignmentStart();
|
||||
long mateEnd = rec.getAlignmentStart() + isize;
|
||||
|
||||
if ( rec.getReadNegativeStrandFlag() ) {
|
||||
// we are on the negative strand, so our mate is on the positive strand
|
||||
adaptorStart = mateStart - adaptorLength - 1;
|
||||
adaptorEnd = mateStart - 1;
|
||||
} else {
|
||||
// we are on the positive strand, so our mate is on the negative strand
|
||||
adaptorStart = mateEnd + 1;
|
||||
adaptorEnd = mateEnd + adaptorLength;
|
||||
}
|
||||
|
||||
boolean inMate = basePos >= mateStart && basePos <= mateEnd;
|
||||
boolean inAdapator = basePos >= adaptorStart && basePos < adaptorEnd;
|
||||
|
||||
|
||||
if ( inAdapator ) state = OverlapType.IN_ADAPTOR;
|
||||
else if ( inMate ) state = OverlapType.OVERLAPPING;
|
||||
|
||||
// if ( inMate || inAdapator )
|
||||
// System.out.printf("baseOverlapState: %s start=%d base=%d mateStart=%d mateStop=%d adaptorStart=%d adaptorEnd=%d => %s%n",
|
||||
// rec.getReadName(), rec.getAlignmentStart(), basePos, mateStart, mateEnd, adaptorStart, adaptorEnd, state);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
private static int DEFAULT_ADAPTOR_SIZE = 100;
|
||||
public static OverlapType readPairBaseOverlapType(final SAMRecord rec, long basePos) {
|
||||
return readPairBaseOverlapType(rec, basePos, DEFAULT_ADAPTOR_SIZE);
|
||||
}
|
||||
|
||||
public static boolean is454Read(SAMRecord read) {
|
||||
return isPlatformRead(read, "454");
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import org.broadinstitute.sting.gatk.executive.WindowMaker;
|
|||
import org.broadinstitute.sting.gatk.datasources.shards.LocusShard;
|
||||
import org.broadinstitute.sting.gatk.datasources.shards.Shard;
|
||||
import org.broadinstitute.sting.gatk.iterators.StingSAMIterator;
|
||||
import org.broadinstitute.sting.gatk.iterators.LocusIteratorByState;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
import org.broadinstitute.sting.utils.GenomeLocParser;
|
||||
import org.junit.BeforeClass;
|
||||
|
|
@ -48,7 +49,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
|
||||
GenomeLoc shardBounds = GenomeLocParser.createGenomeLoc("chr1", 1, 5);
|
||||
Shard shard = new LocusShard(Collections.singletonList(shardBounds));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, null, window.getLocus(), window, null, null);
|
||||
|
||||
|
|
@ -64,7 +65,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
|
||||
GenomeLoc shardBounds = GenomeLocParser.createGenomeLoc("chr1", 1, 5);
|
||||
Shard shard = new LocusShard(Collections.singletonList(shardBounds));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
|
||||
|
|
@ -79,7 +80,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||
|
||||
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
LocusView view = createView(dataProvider);
|
||||
|
|
@ -93,7 +94,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||
|
||||
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
LocusView view = createView(dataProvider);
|
||||
|
|
@ -107,7 +108,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||
|
||||
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
LocusView view = createView(dataProvider);
|
||||
|
|
@ -121,7 +122,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||
|
||||
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 6, 15)));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
LocusView view = createView(dataProvider);
|
||||
|
|
@ -135,7 +136,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
SAMRecordIterator iterator = new SAMRecordIterator(read);
|
||||
|
||||
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
LocusView view = createView(dataProvider);
|
||||
|
|
@ -150,7 +151,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2);
|
||||
|
||||
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
LocusView view = createView(dataProvider);
|
||||
|
|
@ -169,7 +170,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2, read3, read4);
|
||||
|
||||
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
LocusView view = createView(dataProvider);
|
||||
|
|
@ -188,7 +189,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2, read3, read4);
|
||||
|
||||
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
LocusView view = createView(dataProvider);
|
||||
|
|
@ -209,7 +210,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
SAMRecordIterator iterator = new SAMRecordIterator(read1, read2, read3, read4, read5, read6);
|
||||
|
||||
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 1, 10)));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
LocusView view = createView(dataProvider);
|
||||
|
|
@ -237,7 +238,7 @@ public abstract class LocusViewTemplate extends BaseTest {
|
|||
read07, read08, read09, read10, read11, read12);
|
||||
|
||||
Shard shard = new LocusShard(Collections.singletonList(GenomeLocParser.createGenomeLoc("chr1", 6, 15)));
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>());
|
||||
WindowMaker windowMaker = new WindowMaker(iterator,shard.getGenomeLocs(),new ArrayList<SamRecordFilter>(), LocusIteratorByState.NO_DISCARDS);
|
||||
WindowMaker.WindowMakerIterator window = windowMaker.next();
|
||||
LocusShardDataProvider dataProvider = new LocusShardDataProvider(shard, window.getSourceInfo(), window.getLocus(), window, null, null);
|
||||
LocusView view = createView(dataProvider);
|
||||
|
|
|
|||
Loading…
Reference in New Issue