From e1138429961fa5e88f89b66ba9a413a003328e02 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 26 Apr 2007 17:15:13 +0000 Subject: [PATCH] use hasScore method to test presence of score in annotation. --- src/jalview/gui/AnnotationLabels.java | 2 +- src/jalview/gui/Jalview2XML.java | 5 ++--- src/jalview/io/AnnotationFile.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 0ea7730..54263aa 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -380,7 +380,7 @@ public class AnnotationLabels { desc.append(aa.description+"
"); } - if(!Float.isNaN(aa.score)) + if(aa.hasScore()) { desc.append("Score: "+aa.score); } diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index b90f497..45c76ee 100755 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -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() diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index a936dac..463e922 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -169,7 +169,7 @@ public class AnnotationFile text.append("|"); } - if(!Float.isNaN(row.score)) + if(row.hasScore()) text.append("\t"+row.score); text.append("\n"); -- 1.7.10.2