From: kiramt Date: Wed, 28 Feb 2018 19:43:55 +0000 (+0000) Subject: JAL-2909 Fixed a bug in the insertions code X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1cb2e57ec271b4a6747471c9f4eaf03a982230c6;p=jalview.git JAL-2909 Fixed a bug in the insertions code --- diff --git a/src/jalview/datamodel/CigarParser.java b/src/jalview/datamodel/CigarParser.java index 786896b..fd5694c 100644 --- a/src/jalview/datamodel/CigarParser.java +++ b/src/jalview/datamodel/CigarParser.java @@ -194,11 +194,12 @@ public class CigarParser StringBuilder newRead = new StringBuilder(); String read = rec.getReadString(); - int nextPos = next; + int nextPos = next; // location of next position in read while (nextPos < next + length) { - int insertPos = next + length; - int insertLen = 0; + int insertPos = next + length; // location of next insert in read (or end + // of read) + int insertLen = 0; // no of gaps to insert after insertPos if (it.hasNext()) { // account for sequence already having insertion @@ -220,6 +221,11 @@ public class CigarParser { insertPos = rec.getReadPositionAtReferencePosition(key) - 1; } + else + { + insertPos = nextPos; // bugfix - trigger by override + insertions in + // same M stretch + } } newRead.append(read.substring(nextPos, insertPos)); nextPos = insertPos;