X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FAlignSeq.java;h=2ef1c766fd3603ec72fdfbb6845b9d56c1a17fdd;hb=fecc0f8bab5ea8327eb8602fce11a3177ecfd38e;hp=c546310dd50ede5f5d74ae83d813096cd2ace242;hpb=8fc03b5f923a6b80e2a7fc22f6fdd2c5c7ad9de9;p=jalview.git diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index c546310..2ef1c76 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -1020,22 +1020,29 @@ public class AlignSeq if (allowmismatch || c1 == c2) { - lastmatch = true; - // extend mapping interval. + // extend mapping interval if (lp1 + 1 != alignpos || lp2 + 1 != pdbpos) { as1.add(Integer.valueOf(alignpos)); as2.add(Integer.valueOf(pdbpos)); } + lastmatch = true; lp1 = alignpos; lp2 = pdbpos; } else { + // extend mapping interval + if (lastmatch) + { + as1.add(Integer.valueOf(lp1)); + as2.add(Integer.valueOf(lp2)); + } lastmatch = false; } } // construct range pairs + int[] mapseq1 = new int[as1.size() + (lastmatch ? 1 : 0)], mapseq2 = new int[as2 .size() + (lastmatch ? 1 : 0)]; int i = 0; @@ -1146,9 +1153,10 @@ public class AlignSeq ap++; } } - if (sq.getAnnotation() != null) + if (sq.getAnnotation() != null && sq.getAnnotation().length > 0) { - annotations.addAll(inspos, Arrays.asList(sq.getAnnotation())); + annotations.addAll(inspos == -1 ? annotations.size() : inspos, + Arrays.asList(sq.getAnnotation())); } } }