Merge branch 'Jalview-JS/develop' into merge_js_develop
[jalview.git] / src / jalview / io / SequenceAnnotationReport.java
index 4d0bec7..d5c3ed3 100644 (file)
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Map;
 
 import jalview.api.FeatureColourI;
+import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.DBRefEntry;
 import jalview.datamodel.DBRefSource;
 import jalview.datamodel.GeneLociI;
@@ -480,12 +481,27 @@ public class SequenceAnnotationReport
       sb.append(tmp);
       maxWidth = Math.max(maxWidth, tmp.length());
     }
+
     SequenceI ds = sequence;
     while (ds.getDatasetSequence() != null)
     {
       ds = ds.getDatasetSequence();
     }
 
+    /*
+     * add any annotation scores
+     */
+    AlignmentAnnotation[] anns = ds.getAnnotation();
+    for (int i = 0; anns != null && i < anns.length; i++)
+    {
+      AlignmentAnnotation aa = anns[i];
+      if (aa != null && aa.hasScore() && aa.sequenceRef != null)
+      {
+        sb.append("<br>").append(aa.label).append(": ")
+                .append(aa.getScore());
+      }
+    }
+
     if (showDbRefs)
     {
       maxWidth = Math.max(maxWidth, appendDbRefs(sb, ds, summary));
@@ -505,7 +521,24 @@ public class SequenceAnnotationReport
         maxWidth = Math.max(maxWidth, sz);
       }
     }
+
+
+    if (sequence.getAnnotation("Search Scores") != null)
+    {
+      sb.append("<br>");
+      String eValue = " E-Value: "
+              + sequence.getAnnotation("Search Scores")[0].getEValue();
+      String bitScore = " Bit Score: "
+              + sequence.getAnnotation("Search Scores")[0].getBitScore();
+      sb.append(eValue);
+      sb.append("<br>");
+      sb.append(bitScore);
+      maxWidth = Math.max(maxWidth, eValue.length());
+      maxWidth = Math.max(maxWidth, bitScore.length());
+    }
+    sb.append("<br>");
     sb.append("</i>");
+
     return maxWidth;
   }