Use 0f rather than NaN to specify non-valued annotation elements.
authorjprocter <Jim Procter>
Wed, 20 Aug 2008 15:54:22 +0000 (15:54 +0000)
committerjprocter <Jim Procter>
Wed, 20 Aug 2008 15:54:22 +0000 (15:54 +0000)
src/jalview/io/AnnotationFile.java
src/jalview/io/StockholmFile.java

index 13cfc38..288ce2f 100755 (executable)
@@ -190,7 +190,7 @@ public class AnnotationFile
               }\r
 \r
               color = row.annotations[j].colour;\r
-              if (row.annotations[j].value != 0f)\r
+              if (row.annotations[j].value != 0f && row.annotations[j].value!=Float.NaN) \r
               {\r
                 text.append(comma + row.annotations[j].value);\r
               }\r
index d5f3cc2..ccbe818 100644 (file)
@@ -480,18 +480,18 @@ public class StockholmFile extends AlignFile
     {\r
       String pos = annots.substring(i, i + 1);\r
       Annotation ann;\r
-      ann = new Annotation(pos, "", ' ', Float.NaN);\r
+      ann = new Annotation(pos, "", ' ', 0f); // 0f is 'valid' null - will not be written out \r
       if (ss)\r
       {\r
         ann.secondaryStructure = jalview.schemes.ResidueProperties\r
                 .getDssp3state(pos).charAt(0);\r
         if (ann.secondaryStructure == pos.charAt(0) || pos.charAt(0) == 'C')\r
         {\r
-          ann.displayCharacter = "";\r
+          ann.displayCharacter = ""; // null; // " ";\r
         }\r
         else\r
         {\r
-          ann.displayCharacter += " ";\r
+          ann.displayCharacter = " "+ann.displayCharacter;\r
         }\r
       }\r
 \r