From 4340010fc364a8f9a6fcab4f8c416393f5bda21d Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 9 May 2017 16:54:15 +0100 Subject: [PATCH] JAL-2507 output secondary structure regardless of presence of dataset sequence --- src/jalview/io/StockholmFile.java | 57 ++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index a47e1ea..32e6ff7 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -966,46 +966,39 @@ public class StockholmFile extends AlignFile // output annotations while (i < s.length && s[i] != null) { - if (s[i].getDatasetSequence() != null) + AlignmentAnnotation[] alAnot = s[i].getAnnotation(); + if (alAnot != null) { - SequenceI ds = s[i].getDatasetSequence(); - AlignmentAnnotation[] alAnot; Annotation[] ann; - Annotation annot; - alAnot = s[i].getAnnotation(); - String feature = ""; - if (alAnot != null) + for (int j = 0; j < alAnot.length; j++) { - for (int j = 0; j < alAnot.length; j++) - { - String key = type2id(alAnot[j].label); - boolean isrna = alAnot[j].isValidStruc(); + String key = type2id(alAnot[j].label); + boolean isrna = alAnot[j].isValidStruc(); - if (isrna) - { - // hardwire to secondary structure if there is RNA secondary - // structure on the annotation - key = "SS"; - } - if (key == null) - { + if (isrna) + { + // hardwire to secondary structure if there is RNA secondary + // structure on the annotation + key = "SS"; + } + if (key == null) + { - continue; - } + continue; + } - // out.append("#=GR "); - out.append(new Format("%-" + maxid + "s").form("#=GR " - + printId(s[i], jvSuffix) + " " + key + " ")); - ann = alAnot[j].annotations; - String seq = ""; - for (int k = 0; k < ann.length; k++) - { - seq += outputCharacter(key, k, isrna, ann, s[i]); - } - out.append(seq); - out.append(newline); + // out.append("#=GR "); + out.append(new Format("%-" + maxid + "s").form("#=GR " + + printId(s[i], jvSuffix) + " " + key + " ")); + ann = alAnot[j].annotations; + String seq = ""; + for (int k = 0; k < ann.length; k++) + { + seq += outputCharacter(key, k, isrna, ann, s[i]); } + out.append(seq); + out.append(newline); } } -- 1.7.10.2