From: Jim Procter Date: Wed, 29 Jun 2016 16:02:44 +0000 (+0100) Subject: JAL-2137 STRUCTMODEL statement added, logic not yet implemented X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4de772ef30866239786437fbe03d3f877019d459;p=jalview.git JAL-2137 STRUCTMODEL statement added, logic not yet implemented --- diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index d738882..54e96f3 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -734,7 +734,8 @@ public class AnnotationFile String lastread = ""; - private static String GRAPHLINE = "GRAPHLINE", COMBINE = "COMBINE"; + private static String GRAPHLINE = "GRAPHLINE", COMBINE = "COMBINE", + STRUCTMODEL = "STRUCTMODEL"; public boolean parseAnnotationFrom(AlignmentI al, ColumnSelection colSel, BufferedReader in) throws Exception @@ -980,7 +981,42 @@ public class AnnotationFile modified = true; continue; } - + else if (token.equalsIgnoreCase(STRUCTMODEL)) + { + boolean failedtoadd = true; + // expect + // STRUCTMODEL + if (st.hasMoreTokens()) { + refSeq = al.findName(refSeqId = st.nextToken()); + if (refSeq == null) + { + System.err.println("Couldn't locate " + refSeqId + + " in the alignment for STRUCTMODEL"); + refSeqId = null; + } + else + { + String tempId = st.nextToken(); + String urlToModel = st.nextToken(); + String urlToPairwise = st.hasMoreTokens() ? st.nextToken() + : ""; + if (add_structmodel(refSeq, tempId, urlToModel, urlToPairwise)) + { + failedtoadd = false; + } + } + } + if (failedtoadd) + { + System.err + .println("Need [] as tab separated fields after " + + STRUCTMODEL); + } else { + modified = true; + } + continue; + } // Parse out the annotation row graphStyle = AlignmentAnnotation.getGraphValueFromString(token); label = st.nextToken(); @@ -1180,6 +1216,30 @@ public class AnnotationFile return modified; } + /** + * resolve a structural model and generate and add an alignment sequence for + * it + * + * @param refSeq2 + * @param tempId + * @param urlToModel + * @param urlToPairwise + * @return true if model and sequence was added + */ + private boolean add_structmodel(SequenceI refSeq2, String tempId, + String urlToModel, String urlToPairwise) + { + + return false; + } + + private void add_structmodel(StringTokenizer st) + { + + // TODO Auto-generated method stub + + } + private void parseHideCols(ColumnSelection colSel, String nextToken) { StringTokenizer inval = new StringTokenizer(nextToken, ",");