Skip to content
Permalink
Browse files

Fix rare bug in exporting of imputed features.

  • Loading branch information...
PoslavskySV committed May 8, 2019
1 parent e1965c1 commit 54e81d41f33a9b3a1f6ee8e301da53d05350c082
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/main/java/com/milaboratory/mixcr/basictypes/VDJCObject.java
@@ -464,8 +464,11 @@ public CaseSensitiveNucleotideSequence getIncompleteFeature(GeneFeature geneFeat
if (lHit == rHit) {
Alignment<NucleotideSequence> lAl = lHit.getAlignment(lLast.iTarget);
if (lAl.getSequence1Range().contains(rPositionInRef)) {
IncompleteSequencePart part = new IncompleteSequencePart(lHit, false, lLast.iTarget, lLast.begin,
aabs(lAl.convertToSeq2Position(rPositionInRef)));
int aabs = 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)
leftParts.remove(leftParts.size() - 1);
else
@@ -481,8 +484,11 @@ public CaseSensitiveNucleotideSequence getIncompleteFeature(GeneFeature geneFeat

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

IncompleteSequencePart part = new IncompleteSequencePart(rHit, false, rLast.iTarget, aabs, rLast.end);
if (part.begin == part.end)
rightParts.remove(0);
else
@@ -567,7 +573,7 @@ private boolean same(List<IncompleteSequencePart> a, List<IncompleteSequencePart
final int begin, end;

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

0 comments on commit 54e81d4

Please sign in to comment.
You can’t perform that action at this time.