From 78c75d17d486be63f023a9eed386a0b40954d95b Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 1 Dec 2014 21:49:16 +0000 Subject: [PATCH 1/1] JAL-1199 JAL-1569 incremental patch allow non-standard annotation to be output --- src/jalview/io/StockholmFile.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index 96c462c..3b9fb00 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -1027,13 +1027,21 @@ public class StockholmFile extends AlignFile } else { - label = (key = type2id(aa.label.toLowerCase())) + "_cons"; + key = type2id(aa.label.toLowerCase()); + if (key == null) + { + label = aa.label; + } + else + { + label = key + "_cons"; + } } - if (label == null) { label = aa.label; } + label = label.replace(" ", "_"); out.append(new Format("%-" + maxid + "s").form("#=GC " + label + " ")); @@ -1067,7 +1075,7 @@ public class StockholmFile extends AlignFile String ch = (annot == null) ? ((sequenceI == null) ? "-" : Character .toString(sequenceI.getCharAt(k))) : annot.displayCharacter; - if (key.equals("SS")) + if (key != null && key.equals("SS")) { if (annot == null) { -- 1.7.10.2