X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAnnotationFile.java;h=b3b2111540fecc0a369da12f8d9dce01630bf5d1;hb=b81d4d7d46ea8b1c89df086fb847baab6b69d427;hp=d4284a24e8612682f3b7492c856a3bc332c5f8e6;hpb=e601d78bc7762386f570e346a803684c43a66ff1;p=jalview.git diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index d4284a2..b3b2111 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle * * This file is part of Jalview. * @@ -68,14 +68,14 @@ public class AnnotationFile * columns or hidden row keywords. * * @param annotations - * @param groups + * @param list * @param properties * @return feature file as a string. */ public String printAnnotations(AlignmentAnnotation[] annotations, - Vector groups, Hashtable properties) + List list, Hashtable properties) { - return printAnnotations(annotations, groups, properties, null); + return printAnnotations(annotations, list, properties, null); } @@ -110,13 +110,13 @@ public class AnnotationFile * properties and views. * * @param annotations - * @param groups + * @param list * @param properties * @param views * @return annotation file */ public String printAnnotations(AlignmentAnnotation[] annotations, - Vector groups, Hashtable properties, ViewDef[] views) + List list, Hashtable properties, ViewDef[] views) { // TODO: resolve views issue : annotationFile could contain visible region, // or full data + hidden region specifications for a view. @@ -393,9 +393,9 @@ public class AnnotationFile text.append(rowprops.toString()); } - if (groups != null) + if (list != null) { - printGroups(groups); + printGroups(list); } if (properties != null) @@ -419,13 +419,11 @@ public class AnnotationFile return text.toString(); } - public void printGroups(Vector sequenceGroups) + public void printGroups(List list) { - SequenceGroup sg; SequenceI seqrep = null; - for (int i = 0; i < sequenceGroups.size(); i++) + for (SequenceGroup sg:list) { - sg = (SequenceGroup) sequenceGroups.elementAt(i); if (!sg.hasSeqrep()) { text.append("SEQUENCE_GROUP\t" + sg.getName() + "\t" @@ -889,17 +887,14 @@ public class AnnotationFile } // Finally, resolve the groupRefs Enumeration en = groupRefRows.keys(); - SequenceGroup theGroup = null; - + while (en.hasMoreElements()) { groupRef = (String) en.nextElement(); boolean matched = false; // Resolve group: TODO: add a getGroupByName method to alignments - Vector grps = al.getGroups(); - for (int g = 0, gSize = grps.size(); g < gSize; g++) + for (SequenceGroup theGroup : al.getGroups()) { - theGroup = (SequenceGroup) grps.elementAt(g); if (theGroup.getName().equals(groupRef)) { if (matched) @@ -1018,7 +1013,7 @@ public class AnnotationFile } } if (hasSymbols - && (token.equals("H") || token.equals("E") || token + && (token.equals("H") || token.equals("E") || token.equals("S") || token .equals(" "))) { // Either this character represents a helix or sheet @@ -1293,15 +1288,12 @@ public class AnnotationFile { return; } - SequenceGroup sg = null; - + String name = st.nextToken(); - - Vector groups = al.getGroups(); - for (int i = 0; i < groups.size(); i++) + SequenceGroup sg=null; + for (SequenceGroup _sg:al.getGroups()) { - sg = (SequenceGroup) groups.elementAt(i); - if (sg.getName().equals(name)) + if ((sg=_sg).getName().equals(name)) { break; } @@ -1343,7 +1335,7 @@ public class AnnotationFile sg.getStartRes(), sg.getEndRes() + 1); c.calculate(); - c.verdict(false, 25); + c.verdict(false, 25); // TODO: refer to conservation percent threshold sg.cs.setConservation(c);