From 390461d621255f960721a8370ee8fb06ba20aec9 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 1 May 2007 16:33:27 +0000 Subject: [PATCH] Make sure annots are alignment width --- src/jalview/io/AMSAFile.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jalview/io/AMSAFile.java b/src/jalview/io/AMSAFile.java index 1f3fca0..e7e6d97 100644 --- a/src/jalview/io/AMSAFile.java +++ b/src/jalview/io/AMSAFile.java @@ -45,9 +45,12 @@ public class AMSAFile AlignmentAnnotation aa; if (al.getAlignmentAnnotation() != null) { + for (int i = 0; i < al.getAlignmentAnnotation().length; i++) { aa = al.getAlignmentAnnotation()[i]; + + if (aa.autoCalculated || !aa.visible) { continue; @@ -61,7 +64,8 @@ public class AMSAFile out.append("\n"); - int nochunks = (aa.annotations.length / len) + 1; + int nochunks = Math.min(aa.annotations.length, al.getWidth()) + / len + 1; for (int j = 0; j < nochunks; j++) { -- 1.7.10.2