X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FSequenceAnnotationReport.java;h=3a7ee65defabe116cf0a68a17f606a774e74fb85;hb=b8cd52fe7bed59130e5b080acfd42c3ef2effdbb;hp=a855aa2094030fcd1526f551262df25982b40ccf;hpb=6849cc1cb983a45b4b8fd840f5ffc7d31ca80f33;p=jalview.git diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java index a855aa2..3a7ee65 100644 --- a/src/jalview/io/SequenceAnnotationReport.java +++ b/src/jalview/io/SequenceAnnotationReport.java @@ -22,6 +22,7 @@ package jalview.io; import jalview.datamodel.DBRefEntry; import jalview.datamodel.DBRefSource; +import jalview.datamodel.DynamicData; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; @@ -450,15 +451,71 @@ public class SequenceAnnotationReport } } sb.append(""); + List pdbEntries = ds.getAllPDBEntries(); + sb.append(getToolTipTextFromPDBEntries(pdbEntries)); + return maxWidth; + } - for (PDBEntry pdb : ds.getAllPDBEntries()) + private String getToolTipTextFromPDBEntries(List pdbEntries) + { + String tooltip = ""; + if (pdbEntries.isEmpty()) { - if (pdb != null && pdb.getProperty("PHYRE2_MODEL_INFO") != null) + return tooltip; + } + if (pdbEntries.size() > 1) + { + int x = 0; + PDBEntry bestRanked = null; + for (PDBEntry pdb : pdbEntries) { - sb.append(pdb.getProperty("PHYRE2_MODEL_INFO")); + if (pdb.getProperty("DYNAMIC_DATA_PHYRE2") != null) + { + x++; + } + // best ranked entry must be from a Phyre + if (x > 0 && bestRanked == null) + { + bestRanked = pdb; + } } + tooltip = (x > 0) ? "" + + "
Contains " + + x + + " Phyre2 model structure(s)
Best ranked Phyre2 model is " + + bestRanked.getId() + "
" + : ""; } - return maxWidth; + else + { + PDBEntry pdb = pdbEntries.iterator().next(); + if (pdb.getProperty("DYNAMIC_DATA_PHYRE2") != null) + { + tooltip = getPhyreToolTipFromDynamicData((List) pdb + .getProperty("DYNAMIC_DATA_PHYRE2")); + } + } + return tooltip; + } + + private String getPhyreToolTipFromDynamicData( + List dynamicDataList) + { + StringBuilder phyre2InfoBuilder = new StringBuilder(); + phyre2InfoBuilder + .append("") + .append(""); + for (DynamicData data : dynamicDataList) + { + if (data.isDisplay()) + { + phyre2InfoBuilder.append(""); + } + } + phyre2InfoBuilder.append("
Phyre2 Template Info
").append(data.getFieldTitle()) + .append("").append(data.getFieldValue()) + .append("
"); + return phyre2InfoBuilder.toString(); } public void createTooltipAnnotationReport(final StringBuilder tip,