Merge branch 'master' of ssh://chartl@ni.broadinstitute.org/humgen/gsa-scr1/gsa-engineering/git/unstable
This commit is contained in:
commit
25d943f706
|
|
@ -11,6 +11,7 @@ import org.broadinstitute.sting.gatk.io.ThreadLocalOutputTracker;
|
||||||
import org.broadinstitute.sting.gatk.walkers.TreeReducible;
|
import org.broadinstitute.sting.gatk.walkers.TreeReducible;
|
||||||
import org.broadinstitute.sting.gatk.walkers.Walker;
|
import org.broadinstitute.sting.gatk.walkers.Walker;
|
||||||
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
||||||
|
import org.broadinstitute.sting.utils.exceptions.StingException;
|
||||||
import org.broadinstitute.sting.utils.threading.ThreadPoolMonitor;
|
import org.broadinstitute.sting.utils.threading.ThreadPoolMonitor;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
@ -101,7 +102,7 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar
|
||||||
while (isShardTraversePending() || isTreeReducePending()) {
|
while (isShardTraversePending() || isTreeReducePending()) {
|
||||||
// Check for errors during execution.
|
// Check for errors during execution.
|
||||||
if(hasTraversalErrorOccurred())
|
if(hasTraversalErrorOccurred())
|
||||||
throw new ReviewedStingException("An error has occurred during the traversal.",getTraversalError());
|
throw getTraversalError();
|
||||||
|
|
||||||
// Too many files sitting around taking up space? Merge them.
|
// Too many files sitting around taking up space? Merge them.
|
||||||
if (isMergeLimitExceeded())
|
if (isMergeLimitExceeded())
|
||||||
|
|
@ -344,10 +345,15 @@ public class HierarchicalMicroScheduler extends MicroScheduler implements Hierar
|
||||||
return error != null;
|
return error != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized Throwable getTraversalError() {
|
private synchronized StingException getTraversalError() {
|
||||||
if(!hasTraversalErrorOccurred())
|
if(!hasTraversalErrorOccurred())
|
||||||
throw new ReviewedStingException("User has attempted to retrieve a traversal error when none exists");
|
throw new ReviewedStingException("User has attempted to retrieve a traversal error when none exists");
|
||||||
return error;
|
|
||||||
|
// If the error is already a StingException, pass it along as is. Otherwise, wrap it.
|
||||||
|
if(error instanceof StingException)
|
||||||
|
return (StingException)error;
|
||||||
|
else
|
||||||
|
return new ReviewedStingException("An error occurred during the traversal.",error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,6 @@ public class LocusIteratorByState extends LocusIterator {
|
||||||
CigarElement curElement = null;
|
CigarElement curElement = null;
|
||||||
int nCigarElements = 0;
|
int nCigarElements = 0;
|
||||||
|
|
||||||
|
|
||||||
int cigarElementCounter = -1; // how far are we into a single cigarElement
|
int cigarElementCounter = -1; // how far are we into a single cigarElement
|
||||||
|
|
||||||
// The logical model for generating extended events is as follows: the "record state" implements the traversal
|
// The logical model for generating extended events is as follows: the "record state" implements the traversal
|
||||||
|
|
@ -468,7 +467,7 @@ public class LocusIteratorByState extends LocusIterator {
|
||||||
|
|
||||||
if (op == CigarOperator.D) {
|
if (op == CigarOperator.D) {
|
||||||
if (readInfo.includeReadsWithDeletionAtLoci()) { // only add deletions to the pileup if we are authorized to do so
|
if (readInfo.includeReadsWithDeletionAtLoci()) { // only add deletions to the pileup if we are authorized to do so
|
||||||
pile.add(new PileupElement(read, readOffset, true, nextOp == CigarOperator.I, false));
|
pile.add(new PileupElement(read, readOffset, true, nextOp == CigarOperator.I, nextOp == CigarOperator.S || (state.getGenomeOffset() == 0 && read.getSoftStart() != read.getAlignmentStart())));
|
||||||
size++;
|
size++;
|
||||||
nDeletions++;
|
nDeletions++;
|
||||||
if (read.getMappingQuality() == 0)
|
if (read.getMappingQuality() == 0)
|
||||||
|
|
@ -477,7 +476,7 @@ public class LocusIteratorByState extends LocusIterator {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!filterBaseInRead(read, location.getStart())) {
|
if (!filterBaseInRead(read, location.getStart())) {
|
||||||
pile.add(new PileupElement(read, readOffset, false, nextOp == CigarOperator.I, op == CigarOperator.S));
|
pile.add(new PileupElement(read, readOffset, false, nextOp == CigarOperator.I, nextOp == CigarOperator.S || (state.getGenomeOffset() == 0 && read.getSoftStart() != read.getAlignmentStart())));
|
||||||
size++;
|
size++;
|
||||||
if (read.getMappingQuality() == 0)
|
if (read.getMappingQuality() == 0)
|
||||||
nMQ0Reads++;
|
nMQ0Reads++;
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ public class TraverseActiveRegions <M,T> extends TraversalEngine<M,T,ActiveRegio
|
||||||
// band-pass filter the list of isActive probabilities and turn into active regions
|
// band-pass filter the list of isActive probabilities and turn into active regions
|
||||||
private ArrayList<ActiveRegion> integrateActiveList( final ArrayList<Double> activeList, final GenomeLoc firstIsActiveStart, final int activeRegionExtension ) {
|
private ArrayList<ActiveRegion> integrateActiveList( final ArrayList<Double> activeList, final GenomeLoc firstIsActiveStart, final int activeRegionExtension ) {
|
||||||
|
|
||||||
final double ACTIVE_PROB_THRESHOLD = 0.2;
|
final double ACTIVE_PROB_THRESHOLD = 0.2; // BUGBUG: needs to be set-able by the walker author
|
||||||
final ArrayList<ActiveRegion> returnList = new ArrayList<ActiveRegion>();
|
final ArrayList<ActiveRegion> returnList = new ArrayList<ActiveRegion>();
|
||||||
if( activeList.size() == 0 ) {
|
if( activeList.size() == 0 ) {
|
||||||
return returnList;
|
return returnList;
|
||||||
|
|
@ -227,8 +227,8 @@ public class TraverseActiveRegions <M,T> extends TraversalEngine<M,T,ActiveRegio
|
||||||
} else {
|
} else {
|
||||||
final Double[] activeProbArray = activeList.toArray(new Double[activeList.size()]);
|
final Double[] activeProbArray = activeList.toArray(new Double[activeList.size()]);
|
||||||
final double[] filteredProbArray = new double[activeProbArray.length];
|
final double[] filteredProbArray = new double[activeProbArray.length];
|
||||||
final int FILTER_SIZE = 10;
|
final int FILTER_SIZE = 50; // BUGBUG: needs to be set-able by the walker author
|
||||||
final int MAX_ACTIVE_REGION = 200;
|
final int MAX_ACTIVE_REGION = 425; // BUGBUG: needs to be set-able by the walker author
|
||||||
for( int iii = 0; iii < activeProbArray.length; iii++ ) {
|
for( int iii = 0; iii < activeProbArray.length; iii++ ) {
|
||||||
double maxVal = 0;
|
double maxVal = 0;
|
||||||
for( int jjj = Math.max(0, iii-FILTER_SIZE); jjj < Math.min(activeList.size(), iii+FILTER_SIZE); jjj++ ) {
|
for( int jjj = Math.max(0, iii-FILTER_SIZE); jjj < Math.min(activeList.size(), iii+FILTER_SIZE); jjj++ ) {
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,7 @@ public class IndelGenotypeLikelihoodsCalculationModel extends GenotypeLikelihood
|
||||||
if (ref.getWindow().getStop() < loc.getStop() + HAPLOTYPE_SIZE)
|
if (ref.getWindow().getStop() < loc.getStop() + HAPLOTYPE_SIZE)
|
||||||
return null;
|
return null;
|
||||||
if (!(priors instanceof DiploidIndelGenotypePriors))
|
if (!(priors instanceof DiploidIndelGenotypePriors))
|
||||||
throw new StingException("Only diploid-based Indel priors are supported in the DINDEL GL model");
|
throw new StingException("Only diploid-based Indel priors are supported in the INDEL GL model");
|
||||||
|
|
||||||
if (alleleList.isEmpty())
|
if (alleleList.isEmpty())
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ public class SNPGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoodsC
|
||||||
|
|
||||||
public class BAQedPileupElement extends PileupElement {
|
public class BAQedPileupElement extends PileupElement {
|
||||||
public BAQedPileupElement( final PileupElement PE ) {
|
public BAQedPileupElement( final PileupElement PE ) {
|
||||||
super(PE.getRead(), PE.getOffset(), PE.isDeletion(), PE.isBeforeInsertion(), PE.isSoftClipped());
|
super(PE.getRead(), PE.getOffset(), PE.isDeletion(), PE.isBeforeInsertion(), PE.isNextToSoftClip());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import org.broadinstitute.sting.utils.variantcontext.VariantContext;
|
||||||
* @Author chartl
|
* @Author chartl
|
||||||
* @Date May 26, 2010
|
* @Date May 26, 2010
|
||||||
*/
|
*/
|
||||||
@Analysis(name = "Indel length histograms", description = "Shows the distrbution of insertion/deletion event lengths (negative for deletion, positive for insertion)")
|
@Analysis(name = "Indel length histograms", description = "Shows the distribution of insertion/deletion event lengths (negative for deletion, positive for insertion)")
|
||||||
public class IndelLengthHistogram extends VariantEvaluator {
|
public class IndelLengthHistogram extends VariantEvaluator {
|
||||||
private static final int SIZE_LIMIT = 100;
|
private static final int SIZE_LIMIT = 100;
|
||||||
@DataPoint(description="Histogram of indel lengths")
|
@DataPoint(description="Histogram of indel lengths")
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ public abstract class AbstractReadBackedPileup<RBP extends AbstractReadBackedPil
|
||||||
|
|
||||||
protected abstract AbstractReadBackedPileup<RBP, PE> createNewPileup(GenomeLoc loc, PileupElementTracker<PE> pileupElementTracker);
|
protected abstract AbstractReadBackedPileup<RBP, PE> createNewPileup(GenomeLoc loc, PileupElementTracker<PE> pileupElementTracker);
|
||||||
|
|
||||||
protected abstract PE createNewPileupElement(GATKSAMRecord read, int offset, boolean isDeletion, boolean isBeforeInsertion, boolean isSoftClipped);
|
protected abstract PE createNewPileupElement(GATKSAMRecord read, int offset, boolean isDeletion, boolean isBeforeInsertion, boolean isNextToSoftClip);
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ public class PileupElement implements Comparable<PileupElement> {
|
||||||
protected final int offset;
|
protected final int offset;
|
||||||
protected final boolean isDeletion;
|
protected final boolean isDeletion;
|
||||||
protected final boolean isBeforeInsertion;
|
protected final boolean isBeforeInsertion;
|
||||||
protected final boolean isSoftClipped;
|
protected final boolean isNextToSoftClip;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -34,13 +34,13 @@ public class PileupElement implements Comparable<PileupElement> {
|
||||||
* @param offset the position in the read for this base. All deletions must be left aligned! (-1 is only allowed for reads starting with insertions)
|
* @param offset the position in the read for this base. All deletions must be left aligned! (-1 is only allowed for reads starting with insertions)
|
||||||
* @param isDeletion whether or not this base is a deletion
|
* @param isDeletion whether or not this base is a deletion
|
||||||
* @param isBeforeInsertion whether or not this base is before an insertion
|
* @param isBeforeInsertion whether or not this base is before an insertion
|
||||||
* @param isSoftClipped whether or not this base was softclipped
|
* @param isNextToSoftClip whether or not this base is next to a soft clipped base
|
||||||
*/
|
*/
|
||||||
@Requires({
|
@Requires({
|
||||||
"read != null",
|
"read != null",
|
||||||
"offset >= -1",
|
"offset >= -1",
|
||||||
"offset <= read.getReadLength()"})
|
"offset <= read.getReadLength()"})
|
||||||
public PileupElement(final GATKSAMRecord read, final int offset, final boolean isDeletion, final boolean isBeforeInsertion, final boolean isSoftClipped) {
|
public PileupElement(final GATKSAMRecord read, final int offset, final boolean isDeletion, final boolean isBeforeInsertion, final boolean isNextToSoftClip) {
|
||||||
if (offset < 0 && isDeletion)
|
if (offset < 0 && isDeletion)
|
||||||
throw new ReviewedStingException("Pileup Element cannot create a deletion with a negative offset");
|
throw new ReviewedStingException("Pileup Element cannot create a deletion with a negative offset");
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ public class PileupElement implements Comparable<PileupElement> {
|
||||||
this.offset = offset;
|
this.offset = offset;
|
||||||
this.isDeletion = isDeletion;
|
this.isDeletion = isDeletion;
|
||||||
this.isBeforeInsertion = isBeforeInsertion;
|
this.isBeforeInsertion = isBeforeInsertion;
|
||||||
this.isSoftClipped = isSoftClipped;
|
this.isNextToSoftClip = isNextToSoftClip;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDeletion() {
|
public boolean isDeletion() {
|
||||||
|
|
@ -59,8 +59,8 @@ public class PileupElement implements Comparable<PileupElement> {
|
||||||
return isBeforeInsertion;
|
return isBeforeInsertion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSoftClipped() {
|
public boolean isNextToSoftClip() {
|
||||||
return isSoftClipped;
|
return isNextToSoftClip;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInsertionAtBeginningOfRead() {
|
public boolean isInsertionAtBeginningOfRead() {
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ public class ReadBackedExtendedEventPileupImpl extends AbstractReadBackedPileup<
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ExtendedEventPileupElement createNewPileupElement(GATKSAMRecord read, int offset, boolean isDeletion, boolean isBeforeInsertion, boolean isSoftClipped) {
|
protected ExtendedEventPileupElement createNewPileupElement(GATKSAMRecord read, int offset, boolean isDeletion, boolean isBeforeInsertion, boolean isNextToSoftClip) {
|
||||||
throw new UnsupportedOperationException("Not enough information provided to create a new pileup element");
|
throw new UnsupportedOperationException("Not enough information provided to create a new pileup element");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ public class ReadBackedPileupImpl extends AbstractReadBackedPileup<ReadBackedPil
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PileupElement createNewPileupElement(GATKSAMRecord read, int offset, boolean isDeletion, boolean isBeforeInsertion, boolean isSoftClipped) {
|
protected PileupElement createNewPileupElement(GATKSAMRecord read, int offset, boolean isDeletion, boolean isBeforeInsertion, boolean isNextToSoftClip) {
|
||||||
return new PileupElement(read, offset, isDeletion, isBeforeInsertion, isSoftClipped);
|
return new PileupElement(read, offset, isDeletion, isBeforeInsertion, isNextToSoftClip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue