X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FStockholmFile.java;fp=src%2Fjalview%2Fio%2FStockholmFile.java;h=c2f3683a491126fb8250edcd50d5bbf626415d89;hb=4ff9ae2e29a4dc41fb5101a5e336809f097b88ae;hp=e4d9f60a6e13c7aa965984f6d40590a0ac274104;hpb=9b4c6a235744a840d6bf31e4fd06e644cebfa65a;p=jalview.git diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index e4d9f60..c2f3683 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -33,6 +33,7 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.schemes.ResidueProperties; +import jalview.util.Comparison; import jalview.util.Format; import jalview.util.MessageManager; @@ -817,12 +818,16 @@ public class StockholmFile extends AlignFile type = (label.indexOf("_cons") == label.length() - 5) ? label .substring(0, label.length() - 5) : label; } - boolean ss = false; + boolean ss = false, posterior = false; type = id2type(type); - if (type.equals("secondary structure")) + if (type.equalsIgnoreCase("secondary structure")) { ss = true; } + if (type.equalsIgnoreCase("posterior probability")) + { + posterior = true; + } // decide on secondary structure or not. Annotation[] els = new Annotation[annots.length()]; for (int i = 0; i < annots.length(); i++) @@ -857,6 +862,25 @@ public class StockholmFile extends AlignFile } } + if (posterior && !ann.isWhitespace() + && !Comparison.isGap(pos.charAt(0))) + { + float val = 0; + // symbol encodes values - 0..*==0..10 + if (pos.charAt(0) == '*') + { + val = 10; + } + else + { + val = pos.charAt(0) - '0'; + if (val > 9) + { + val = 10; + } + } + ann.value = val; + } els[i] = ann; } @@ -1139,10 +1163,10 @@ public class StockholmFile extends AlignFile if (typeIds == null) { typeIds = new Hashtable(); - typeIds.put("SS", "secondary structure"); - typeIds.put("SA", "surface accessibility"); + typeIds.put("SS", "Secondary Structure"); + typeIds.put("SA", "Surface Accessibility"); typeIds.put("TM", "transmembrane"); - typeIds.put("PP", "posterior probability"); + typeIds.put("PP", "Posterior Probability"); typeIds.put("LI", "ligand binding"); typeIds.put("AS", "active site"); typeIds.put("IN", "intron"); @@ -1153,7 +1177,7 @@ public class StockholmFile extends AlignFile typeIds.put("DE", "description"); typeIds.put("DR", "reference"); typeIds.put("LO", "look"); - typeIds.put("RF", "reference positions"); + typeIds.put("RF", "Reference Positions"); } } @@ -1176,7 +1200,7 @@ public class StockholmFile extends AlignFile while (e.hasMoreElements()) { Object ll = e.nextElement(); - if (typeIds.get(ll).toString().equals(type)) + if (typeIds.get(ll).toString().equalsIgnoreCase(type)) { key = (String) ll; break;