From 9cad9986cac3bc401abae55d574ff64c51e96d5f Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 16 Apr 2010 16:43:38 +0000 Subject: [PATCH] patch for bug #36198 - more to follow on Monday. --- src/jalview/datamodel/AlignmentAnnotation.java | 7 ++++--- src/jalview/io/AnnotationFile.java | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index a3328b3..a821066 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -179,7 +179,7 @@ public class AlignmentAnnotation if (annotations[i].secondaryStructure == 'H' || annotations[i].secondaryStructure == 'E') { - hasIcons = true; + hasIcons |= true; } if (annotations[i].displayCharacter == null) @@ -191,14 +191,15 @@ public class AlignmentAnnotation firstChar = annotations[i].displayCharacter.charAt(0); // check to see if it looks like a sequence or is secondary structure // labelling. - if ( + if (annotations[i].secondaryStructure!=' ' && !hasIcons && // Uncomment to only catch case where displayCharacter==secondary // Structure // to correctly redisplay SS annotation imported from Stockholm, // exported to JalviewXML and read back in again. // && // annotations[i].displayCharacter.charAt(0)==annotations[i].secondaryStructure - firstChar != 'H' + firstChar != ' ' + && firstChar != 'H' && firstChar != 'E' && firstChar != '-' && firstChar < jalview.schemes.ResidueProperties.aaIndex.length) diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 00b7ead..ce1afc2 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -125,7 +125,7 @@ public class AnnotationFile refSeq = row.sequenceRef; text.append("\nSEQUENCE_REF\t" + refSeq.getName() + "\n"); } - boolean hasGlyphs = false, hasLabels = false, hasValues = false, hasText = false; + boolean hasGlyphs = row.hasIcons, hasLabels = row.hasText, hasValues = row.hasScore, hasText = false; // lookahead to check what the annotation row object actually contains. for (int j = 0; row.annotations != null && j < row.annotations.length @@ -210,7 +210,7 @@ public class AnnotationFile if (row.annotations[j] != null) { comma = ""; - if (hasGlyphs && row.annotations[j].secondaryStructure != ' ') + if (row.annotations[j].secondaryStructure != ' ') // could be also hasGlyphs || ... { text.append(comma + row.annotations[j].secondaryStructure); @@ -748,7 +748,7 @@ public class AnnotationFile } } - if (hasSymbols && (token.equals("H") || token.equals("E"))) + if (hasSymbols && (token.equals("H") || token.equals("E") || token.equals(" "))) { // Either this character represents a helix or sheet // or an integer which can be displayed -- 1.7.10.2