From 4c36db52fa7bc52e22befa30abc8eabce5742e1b Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 5 Jun 2018 09:34:08 +0100 Subject: [PATCH] JAL-3011 include annotation scores in sequence id tooltip and sequence details report --- src/jalview/gui/CutAndPasteHtmlTransfer.java | 1 + src/jalview/io/SequenceAnnotationReport.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/jalview/gui/CutAndPasteHtmlTransfer.java b/src/jalview/gui/CutAndPasteHtmlTransfer.java index 2e51bce..1d7d1c9 100644 --- a/src/jalview/gui/CutAndPasteHtmlTransfer.java +++ b/src/jalview/gui/CutAndPasteHtmlTransfer.java @@ -143,6 +143,7 @@ public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer { textarea.setDocument(textarea.getEditorKit().createDefaultDocument()); textarea.setText(text); + textarea.setCaretPosition(0); } @Override diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java index 6b82671..5ada355 100644 --- a/src/jalview/io/SequenceAnnotationReport.java +++ b/src/jalview/io/SequenceAnnotationReport.java @@ -21,6 +21,7 @@ package jalview.io; import jalview.api.FeatureColourI; +import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.DBRefEntry; import jalview.datamodel.DBRefSource; import jalview.datamodel.SequenceFeature; @@ -353,12 +354,27 @@ public class SequenceAnnotationReport sb.append("
").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("
").append(aa.label).append(": ") + .append(aa.getScore()); + } + } + if (showDbRefs) { maxWidth = Math.max(maxWidth, appendDbRefs(sb, ds, summary)); -- 1.7.10.2