X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2FStockholmFile.java;h=a850ff17a68e5be092d7c355333a7e1ed6869225;hb=304e64fb34b32659be1bbfd39fb4e15b2f79586e;hp=50112c82d95cedaac2415de8426b2828ccf8eff5;hpb=cfb79b69d9fa44595560659bd95d1d1cd27677ad;p=jalview.git diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index 50112c8..a850ff1 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -48,6 +48,7 @@ import java.util.Enumeration; import java.util.Hashtable; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Vector; @@ -88,7 +89,6 @@ public class StockholmFile extends AlignFile public static final int REGEX_STOCKHOLM = 0; public static final int REGEX_BRACKETS = 1; - // use the following regex to decide an annotations (whole) line is NOT an RNA // SS (it contains only E,H,e,h and other non-brace/non-alpha chars) public static final int REGEX_NOT_RNASS = 2; @@ -932,7 +932,6 @@ public class StockholmFile extends AlignFile type = id2type(type); boolean isrnass = false; - if (type.equalsIgnoreCase("secondary structure")) { ss = true; @@ -950,6 +949,7 @@ public class StockholmFile extends AlignFile for (int i = 0; i < annots.length(); i++) { String pos = annots.substring(i, i + 1); + // TODO 2.12 release: verify this Stockholm IO behaviour change in release notes if (UNDERSCORE == pos.charAt(0)) { pos = " "; @@ -1039,7 +1039,6 @@ public class StockholmFile extends AlignFile return ref.getSource().toString() + " ; " + ref.getAccessionId().toString(); } - @Override public String print(SequenceI[] s, boolean jvSuffix) { @@ -1145,6 +1144,7 @@ public class StockholmFile extends AlignFile Annotation[] ann; for (int j = 0; j < alAnot.length; j++) { + if (alAnot[j].annotations != null) { String key = type2id(alAnot[j].label); @@ -1174,7 +1174,6 @@ public class StockholmFile extends AlignFile out.append(newline); } } - } out.append(new Format("%-" + maxid + "s") @@ -1239,7 +1238,6 @@ public class StockholmFile extends AlignFile return out.toString(); } - /** * add an annotation character to the output row * @@ -1364,6 +1362,7 @@ public class StockholmFile extends AlignFile } } + protected static String id2type(String id) {