From d35ca06fbba0a776b65bc733ebd00b48eaf1ace6 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 10 May 2006 12:57:21 +0000 Subject: [PATCH] Annotations must createSequenceMapping if seqRef not null --- src/jalview/io/AnnotationReader.java | 32 +++++++++++++++++++++----------- src/jalview/ws/JPredClient.java | 9 ++++++++- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/jalview/io/AnnotationReader.java b/src/jalview/io/AnnotationReader.java index 4325dae..d42167a 100755 --- a/src/jalview/io/AnnotationReader.java +++ b/src/jalview/io/AnnotationReader.java @@ -35,11 +35,13 @@ public class AnnotationReader String line, label, description, token; int graphStyle, index; SequenceI refSeq = null; - int refSeqIndex = 0; + int refSeqIndex = 1; int existingAnnotations = 0; if(al.getAlignmentAnnotation()!=null) existingAnnotations = al.getAlignmentAnnotation().length; + int alWidth = al.getWidth(); + StringTokenizer st; Annotation[] annotations; AlignmentAnnotation annotation = null; @@ -100,28 +102,32 @@ public class AnnotationReader } catch(Exception ex) { - refSeqIndex = 0; + refSeqIndex = 1; } continue; } + graphStyle = AlignmentAnnotation.getGraphValueFromString(token); label = description = st.nextToken(); line = st.nextToken(); + st = new StringTokenizer(line, "|", true); - annotations = new Annotation[st.countTokens()+refSeqIndex]; - index = refSeqIndex; + annotations = new Annotation[alWidth]; + + index = 0; boolean emptyColumn = true; - while (st.hasMoreElements()) + + + while (st.hasMoreElements() && index