Renaming PileupElement.isBeforeDeletion() to PileupElement.isBeforeDeletedBase() so that it's more clear that it can still be true while inside a deletion. Added PileupElement.isBeforeDeletionStart() to cover the case that I want where we only trigger before the actual deletion event. Similarly for after a deletion. Updated counting code in ConsensusAlleleCounter accordingly.

This commit is contained in:
Eric Banks 2012-03-29 17:08:25 -04:00
parent e4469a83ee
commit c2e27729c7
4 changed files with 21 additions and 13 deletions

View File

@ -216,7 +216,7 @@ public class ConsensusAlleleCounter {
}
}
else if ( p.isBeforeDeletion() ) {
else if ( p.isBeforeDeletedBase() ) {
indelString = String.format("D%d",p.getEventLength());
int cnt = consensusIndelStrings.containsKey(indelString)? consensusIndelStrings.get(indelString):0;
consensusIndelStrings.put(indelString,cnt+1);

View File

@ -208,7 +208,7 @@ public class SNPGenotypeLikelihoodsCalculationModel extends GenotypeLikelihoodsC
public class BAQedPileupElement extends PileupElement {
public BAQedPileupElement( final PileupElement PE ) {
super(PE.getRead(), PE.getOffset(), PE.isDeletion(), PE.isBeforeDeletion(), PE.isAfterDeletion(), PE.isBeforeInsertion(), PE.isAfterInsertion(), PE.isNextToSoftClip());
super(PE.getRead(), PE.getOffset(), PE.isDeletion(), PE.isBeforeDeletedBase(), PE.isAfterDeletedBase(), PE.isBeforeInsertion(), PE.isAfterInsertion(), PE.isNextToSoftClip());
}
@Override

View File

@ -876,8 +876,8 @@ public abstract class AbstractReadBackedPileup<RBP extends AbstractReadBackedPil
@Override
public int getNumberOfDeletionsAfterThisElement() {
int count = 0;
for (PileupElement p: this) {
if (p.isBeforeDeletion())
for (PileupElement p : this) {
if (p.isBeforeDeletionStart())
count++;
}
return count;
@ -886,7 +886,7 @@ public abstract class AbstractReadBackedPileup<RBP extends AbstractReadBackedPil
@Override
public int getNumberOfInsertionsAfterThisElement() {
int count = 0;
for (PileupElement p: this) {
for (PileupElement p : this) {
if (p.isBeforeInsertion())
count++;
}

View File

@ -24,8 +24,8 @@ public class PileupElement implements Comparable<PileupElement> {
protected final GATKSAMRecord read; // the read this base belongs to
protected final int offset; // the offset in the bases array for this base
protected final boolean isDeletion; // is this base a deletion
protected final boolean isBeforeDeletion; // is the base to the right of this base an deletion
protected final boolean isAfterDeletion; // is the base to the left of this base a deletion
protected final boolean isBeforeDeletedBase; // is the base to the right of this base an deletion
protected final boolean isAfterDeletedBase; // is the base to the left of this base a deletion
protected final boolean isBeforeInsertion; // is the base to the right of this base an insertion
protected final boolean isAfterInsertion; // is the base to the left of this base an insertion
protected final boolean isNextToSoftClip; // is this base either before or after a soft clipped base
@ -59,8 +59,8 @@ public class PileupElement implements Comparable<PileupElement> {
this.read = read;
this.offset = offset;
this.isDeletion = isDeletion;
this.isBeforeDeletion = isBeforeDeletion;
this.isAfterDeletion = isAfterDeletion;
this.isBeforeDeletedBase = isBeforeDeletion;
this.isAfterDeletedBase = isAfterDeletion;
this.isBeforeInsertion = isBeforeInsertion;
this.isAfterInsertion = isAfterInsertion;
this.isNextToSoftClip = isNextToSoftClip;
@ -81,12 +81,20 @@ public class PileupElement implements Comparable<PileupElement> {
return isDeletion;
}
public boolean isBeforeDeletion() {
return isBeforeDeletion;
public boolean isBeforeDeletedBase() {
return isBeforeDeletedBase;
}
public boolean isAfterDeletion() {
return isAfterDeletion;
public boolean isAfterDeletedBase() {
return isAfterDeletedBase;
}
public boolean isBeforeDeletionStart() {
return isBeforeDeletedBase && !isDeletion;
}
public boolean isAfterDeletionEnd() {
return isAfterDeletedBase && !isDeletion;
}
public boolean isBeforeInsertion() {