From 5f2df50328b5b4e3ca082b8bf27360aaabc69e3a Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Wed, 28 Oct 2015 11:45:20 +0000 Subject: [PATCH] JAL-1952 bugfix --- src/jalview/analysis/AlignSeq.java | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index 3e4a82b..369721d 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -577,18 +577,21 @@ public class AlignSeq } } int len = 72 - maxid - 1; - int nochunks = ((aseq1.length - count) / len) + 1; + int nochunks = ((aseq1.length - count) / len) + + ((aseq1.length - count) % len > 0 ? 1 : 0); pid = 0; - output.append("Sequence \u27f7 Structure mapping details: ") - .append(NEWLINE); + output.append("Score = ").append(score[maxi][maxj]).append(NEWLINE); + output.append("Length of alignment = ") + .append(String.valueOf(aseq1.length - count)).append(NEWLINE); + output.append("Sequence "); output.append(new Format("%" + maxid + "s").form(s1.getName())); output.append(" : ").append(String.valueOf(s1.getStart())) .append(" - ").append(String.valueOf(s1.getEnd())); output.append(" (Sequence length = ") .append(String.valueOf(s1str.length())).append(")") .append(NEWLINE); - // output.append("Sequence "); + output.append("Sequence "); output.append(new Format("%" + maxid + "s").form(s2.getName())); output.append(" : ").append(String.valueOf(s2.getStart())) .append(" - ").append(String.valueOf(s2.getEnd())); @@ -596,7 +599,6 @@ public class AlignSeq .append(String.valueOf(s2str.length())).append(")") .append(NEWLINE).append(NEWLINE); - // output mappings for (int j = 0; j < nochunks; j++) { // Print the first aligned sequence @@ -660,16 +662,9 @@ public class AlignSeq output.append(NEWLINE).append(NEWLINE); } - output.append("Length of alignment = ") - .append(String.valueOf(aseq1.length - count)).append(NEWLINE); - output.append("Score = ").append(score[maxi][maxj]).append(NEWLINE); - pid = pid / (aseq1.length - count) * 100; - output = output.append(new Format("Percentage ID = %2.2f\n\n") + output = output.append(new Format("Percentage ID = %2.2f\n") .form(pid)); - - output.append(NEWLINE).append( - "Mapping method: Needleman & Wunsch Alignment"); try { os.print(output.toString()); -- 1.7.10.2