use hasScore method to test presence of score in annotation.
authorjprocter <Jim Procter>
Thu, 26 Apr 2007 17:15:13 +0000 (17:15 +0000)
committerjprocter <Jim Procter>
Thu, 26 Apr 2007 17:15:13 +0000 (17:15 +0000)
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/Jalview2XML.java
src/jalview/io/AnnotationFile.java

index 0ea7730..54263aa 100755 (executable)
@@ -380,7 +380,7 @@ public class AnnotationLabels
       {
         desc.append(aa.description+"<br>");
       }
-      if(!Float.isNaN(aa.score))
+      if(aa.hasScore())
       {
         desc.append("Score: "+aa.score);
       }
index b90f497..45c76ee 100755 (executable)
@@ -534,7 +534,7 @@ public class Jalview2XML
         }
 
         an.setLabel(aa[i].label);
-        if (!Float.isNaN(aa[i].score))
+        if (aa[i].hasScore())
         {
           an.setScore(aa[i].getScore());
         }
@@ -1338,12 +1338,11 @@ public class Jalview2XML
 
           for (int aa = 0; aa < ae.length && aa < anot.length; aa++)
           {
-
             anot[ae[aa].getPosition()] = new jalview.datamodel.Annotation(
 
                     ae[aa].getDisplayCharacter(),
                     ae[aa].getDescription(),
-                    ae[aa].getSecondaryStructure()==null ? ' ' :
+                    (ae[aa].getSecondaryStructure()==null || ae[aa].getSecondaryStructure().length() == 0) ? ' ' :
                       ae[aa].getSecondaryStructure().charAt(0),
                       ae[aa].getValue()
 
index a936dac..463e922 100755 (executable)
@@ -169,7 +169,7 @@ public class AnnotationFile
           text.append("|");\r
         }\r
 \r
-        if(!Float.isNaN(row.score))\r
+        if(row.hasScore())\r
           text.append("\t"+row.score);\r
 \r
         text.append("\n");\r