From: TZVanaalten Date: Mon, 14 Aug 2017 10:41:04 +0000 (+0100) Subject: JAL-2629 fix incorrect gap insertions on HMM sequence X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=03f7ae1897aba3a6fc6b091b78eec39a08706222;p=jalview.git JAL-2629 fix incorrect gap insertions on HMM sequence --- diff --git a/src/jalview/datamodel/HiddenMarkovModel.java b/src/jalview/datamodel/HiddenMarkovModel.java index e74d826..d5e93e3 100644 --- a/src/jalview/datamodel/HiddenMarkovModel.java +++ b/src/jalview/datamodel/HiddenMarkovModel.java @@ -993,8 +993,8 @@ public class HiddenMarkovModel start = getNodeAlignmentColumn(1); modelLength = getLength(); end = getNodeAlignmentColumn(modelLength); - char[] sequence = new char[end]; - for (int index = 0; index < end; index++) + char[] sequence = new char[end + 1]; + for (int index = 0; index < end + 1; index++) { Character character; @@ -1011,7 +1011,8 @@ public class HiddenMarkovModel } - Sequence seq = new Sequence(getName() + "_HMM", sequence, start, end); + Sequence seq = new Sequence(getName() + "_HMM", sequence, start, + end); return seq; } diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 4f3d026..9f46494 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -403,7 +403,7 @@ public class FileLoader implements Runnable if (sg != null) { seq.insertCharAt(0, sg.getStartRes(), '-'); - seq.insertCharAt(sg.getEndRes(), + seq.insertCharAt(sg.getEndRes() + 1, alignment.getWidth() - sg.getEndRes(), '-'); SequenceI topSeq = sg.getSequencesInOrder(alignment)[0]; int topIndex = alignment.findIndex(topSeq);