X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FStockholmFile.java;h=ab80ffa8f3bf15678a792de78abac19567b50861;hb=d63bbc2d56c86d7dca68e76104a8682b5e38c763;hp=6490d28ab1c28329b28314c350be798632002e81;hpb=be32c14cd8e48fe0a207cd7030cb9cd46f894678;p=jalview.git diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index 6490d28..ab80ffa 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -101,6 +101,7 @@ public class StockholmFile extends AlignFile super(source); } + @Override public void initData() { super.initData(); @@ -178,6 +179,7 @@ public class StockholmFile extends AlignFile * @throws IOException * If there is an error with the input file */ + @Override public void parse() throws IOException { StringBuffer treeString = new StringBuffer(); @@ -420,8 +422,8 @@ public class StockholmFile extends AlignFile { // logger.error("Could not parse sequence line: " + line); throw new IOException(MessageManager.formatMessage( - "exception.couldnt_parse_sequence_line", new String[] - { line })); + "exception.couldnt_parse_sequence_line", + new String[] { line })); } String ns = seqs.get(x.stringMatched(1)); if (ns == null) @@ -533,9 +535,8 @@ public class StockholmFile extends AlignFile } else { - throw new IOException(MessageManager.formatMessage( - "exception.error_parsing_line", new String[] - { line })); + // throw new IOException("Error parsing " + line); + System.err.println(">> missing annotation: " + line); } } else if (annType.equals("GC")) @@ -665,8 +666,8 @@ public class StockholmFile extends AlignFile else { throw new IOException(MessageManager.formatMessage( - "exception.unknown_annotation_detected", new String[] - { annType, annContent })); + "exception.unknown_annotation_detected", new String[] { + annType, annContent })); } } } @@ -779,9 +780,8 @@ public class StockholmFile extends AlignFile { for (DBRefEntry d : dbrs) { - jalview.util.MapList mp = new jalview.util.MapList(new int[] - { seqO.getStart(), seqO.getEnd() }, new int[] - { st, en }, 1, 1); + jalview.util.MapList mp = new jalview.util.MapList(new int[] { + seqO.getStart(), seqO.getEnd() }, new int[] { st, en }, 1, 1); jalview.datamodel.Mapping mping = new Mapping(mp); d.setMap(mping); } @@ -826,7 +826,7 @@ public class StockholmFile extends AlignFile // be written out if (ss) { - //if (" .-_".indexOf(pos) == -1) + // if (" .-_".indexOf(pos) == -1) { if (detectbrackets.search(pos)) { @@ -848,7 +848,7 @@ public class StockholmFile extends AlignFile ann.displayCharacter = " " + ann.displayCharacter; } } - + } els[i] = ann; @@ -901,18 +901,18 @@ public class StockholmFile extends AlignFile { maxid = tmp.length(); } - if (s[in].getDBRef() != null) + if (s[in].getDBRefs() != null) { - for (int idb = 0; idb < s[in].getDBRef().length; idb++) + for (int idb = 0; idb < s[in].getDBRefs().length; idb++) { if (dataRef == null) { dataRef = new Hashtable(); } - String datAs1 = s[in].getDBRef()[idb].getSource().toString() + String datAs1 = s[in].getDBRefs()[idb].getSource().toString() + " ; " - + s[in].getDBRef()[idb].getAccessionId().toString(); + + s[in].getDBRefs()[idb].getAccessionId().toString(); dataRef.put(tmp, datAs1); } } @@ -1068,21 +1068,19 @@ public class StockholmFile extends AlignFile * @param ann * @param sequenceI */ - private char outputCharacter(String key, int k, - boolean isrna, Annotation[] ann, SequenceI sequenceI) + private char outputCharacter(String key, int k, boolean isrna, + Annotation[] ann, SequenceI sequenceI) { char seq = ' '; Annotation annot = ann[k]; String ch = (annot == null) ? ((sequenceI == null) ? "-" : Character - .toString(sequenceI.getCharAt(k))) - : annot.displayCharacter; + .toString(sequenceI.getCharAt(k))) : annot.displayCharacter; if (key != null && key.equals("SS")) { if (annot == null) { // sensible gap character if one is available or make one up - return sequenceI == null ? '-' : sequenceI - .getCharAt(k); + return sequenceI == null ? '-' : sequenceI.getCharAt(k); } else { @@ -1109,6 +1107,7 @@ public class StockholmFile extends AlignFile return seq; } + @Override public String print() { out = new StringBuffer();