Fix for the indel cleaner: I forgot to "unclip" the cigar string (even though the clipped bases were removed) before using it as an alternate consensus in a particular instance.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3468 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
5f950dcc61
commit
7f0c638653
|
|
@ -719,6 +719,7 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// create the new consensus
|
// create the new consensus
|
||||||
|
ArrayList<CigarElement> elements = new ArrayList<CigarElement>(c.numCigarElements()-1);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (int i = 0; i < indexOnRef; i++)
|
for (int i = 0; i < indexOnRef; i++)
|
||||||
sb.append((char)reference[i]);
|
sb.append((char)reference[i]);
|
||||||
|
|
@ -732,8 +733,9 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
|
||||||
int elementLength = ce.getLength();
|
int elementLength = ce.getLength();
|
||||||
switch( ce.getOperator() ) {
|
switch( ce.getOperator() ) {
|
||||||
case D:
|
case D:
|
||||||
indelCount++;
|
|
||||||
refIdx += elementLength;
|
refIdx += elementLength;
|
||||||
|
indelCount++;
|
||||||
|
elements.add(ce);
|
||||||
break;
|
break;
|
||||||
case M:
|
case M:
|
||||||
altIdx += elementLength;
|
altIdx += elementLength;
|
||||||
|
|
@ -745,6 +747,7 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
|
||||||
sb.append((char)reference[refIdx+j]);
|
sb.append((char)reference[refIdx+j]);
|
||||||
}
|
}
|
||||||
refIdx += elementLength;
|
refIdx += elementLength;
|
||||||
|
elements.add(new CigarElement(elementLength, CigarOperator.M));
|
||||||
break;
|
break;
|
||||||
case I:
|
case I:
|
||||||
for (int j = 0; j < elementLength; j++) {
|
for (int j = 0; j < elementLength; j++) {
|
||||||
|
|
@ -757,6 +760,7 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
|
||||||
}
|
}
|
||||||
altIdx += elementLength;
|
altIdx += elementLength;
|
||||||
indelCount++;
|
indelCount++;
|
||||||
|
elements.add(ce);
|
||||||
break;
|
break;
|
||||||
case S:
|
case S:
|
||||||
default:
|
default:
|
||||||
|
|
@ -771,7 +775,7 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
|
||||||
sb.append((char)reference[i]);
|
sb.append((char)reference[i]);
|
||||||
byte[] altConsensus = StringUtil.stringToBytes(sb.toString()); // alternative consensus sequence we just built from the current read
|
byte[] altConsensus = StringUtil.stringToBytes(sb.toString()); // alternative consensus sequence we just built from the current read
|
||||||
|
|
||||||
return new Consensus(altConsensus, c, indexOnRef);
|
return new Consensus(altConsensus, new Cigar(elements), indexOnRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a Consensus from just the indel string that falls on the reference
|
// create a Consensus from just the indel string that falls on the reference
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue