From: jprocter Date: Fri, 16 Apr 2010 16:43:38 +0000 (+0000) Subject: patch for bug #36198 - more to follow on Monday. X-Git-Tag: Release_2_5~65 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9cad9986cac3bc401abae55d574ff64c51e96d5f;p=jalview.git patch for bug #36198 - more to follow on Monday. --- 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