Skip to content

Commit

Permalink
Fix rare bug in exporting of imputed features.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoslavskySV committed May 8, 2019
1 parent e1965c1 commit 54e81d4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/main/java/com/milaboratory/mixcr/basictypes/VDJCObject.java
Expand Up @@ -464,8 +464,11 @@ public CaseSensitiveNucleotideSequence getIncompleteFeature(GeneFeature geneFeat
if (lHit == rHit) { if (lHit == rHit) {
Alignment<NucleotideSequence> lAl = lHit.getAlignment(lLast.iTarget); Alignment<NucleotideSequence> lAl = lHit.getAlignment(lLast.iTarget);
if (lAl.getSequence1Range().contains(rPositionInRef)) { if (lAl.getSequence1Range().contains(rPositionInRef)) {
IncompleteSequencePart part = new IncompleteSequencePart(lHit, false, lLast.iTarget, lLast.begin, int aabs = aabs(lAl.convertToSeq2Position(rPositionInRef));
aabs(lAl.convertToSeq2Position(rPositionInRef))); if (aabs < lLast.begin)
return null;

IncompleteSequencePart part = new IncompleteSequencePart(lHit, false, lLast.iTarget, lLast.begin, aabs);
if (part.begin == part.end) if (part.begin == part.end)
leftParts.remove(leftParts.size() - 1); leftParts.remove(leftParts.size() - 1);
else else
Expand All @@ -481,8 +484,11 @@ public CaseSensitiveNucleotideSequence getIncompleteFeature(GeneFeature geneFeat


Alignment<NucleotideSequence> rAl = lHit.getAlignment(rLast.iTarget); Alignment<NucleotideSequence> rAl = lHit.getAlignment(rLast.iTarget);
if (rAl.getSequence1Range().contains(lPositionInRef)) { if (rAl.getSequence1Range().contains(lPositionInRef)) {
IncompleteSequencePart part = new IncompleteSequencePart(rHit, false, rLast.iTarget, int aabs = aabs(rAl.convertToSeq2Position(lPositionInRef));
aabs(rAl.convertToSeq2Position(lPositionInRef)), rLast.end); if (aabs > rLast.end)
return null;

IncompleteSequencePart part = new IncompleteSequencePart(rHit, false, rLast.iTarget, aabs, rLast.end);
if (part.begin == part.end) if (part.begin == part.end)
rightParts.remove(0); rightParts.remove(0);
else else
Expand Down Expand Up @@ -567,7 +573,7 @@ private static final class IncompleteSequencePart {
final int begin, end; final int begin, end;


IncompleteSequencePart(VDJCHit hit, boolean germline, int iTarget, int begin, int end) { IncompleteSequencePart(VDJCHit hit, boolean germline, int iTarget, int begin, int end) {
assert begin <= end; assert begin <= end : "" + begin + " - " + end;
this.hit = hit; this.hit = hit;
this.germline = germline; this.germline = germline;
this.iTarget = iTarget; this.iTarget = iTarget;
Expand Down

0 comments on commit 54e81d4

Please sign in to comment.