Merge branch 'develop' into releases/Release_2_11_2_Branch
authorJim Procter <j.procter@dundee.ac.uk>
Tue, 5 Apr 2022 17:15:28 +0000 (18:15 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Tue, 5 Apr 2022 17:15:28 +0000 (18:15 +0100)
help/help/html/releases.html
src/jalview/datamodel/Sequence.java
src/jalview/gui/PopupMenu.java
src/jalview/gui/structurechooser/TDBResultAnalyser.java
src/jalview/io/SequenceAnnotationReport.java
test/jalview/fts/service/pdb/PDBFTSRestClientTest.java
test/jalview/gui/structurechooser/StructureChooserQuerySourceTest.java

index 1137b03..d13a435 100755 (executable)
@@ -58,8 +58,8 @@ li:before {
     </tr>
     <tr>
       <td width="60" align="center" nowrap><strong><a
-          id="Jalview.2.11.2">2.11.2</a><a id="Jalview.2.11.2.0">.1</a><br />
-          <em>31/03/2022</em></strong></td>
+          id="Jalview.2.11.2">2.11.2</a><a id="Jalview.2.11.2.1">.1</a><br />
+          <em>05/04/2022</em></strong></td>
       <td align="left" valign="top">
         <ul>
           <li>
@@ -83,6 +83,11 @@ li:before {
             containing '414' [URL too long]
           </li>
           <li>
+          <!-- JAL-3980 JAL-3981 -->Sequence ID tooltip not shown during
+            long running retrieval/crossref operations (affects at least
+            2.11.1 onwards)
+          </li>
+          <li>
             <!-- JAL-3973 -->Cannot build Jalview 2.11.2.0 via gradle
             from its source tarball
           </li>
@@ -98,9 +103,9 @@ li:before {
             2.11.2.0)
           </li>
           <li>
-            <!-- JAL-3980 --> Sequence ID tooltip not showing during
-            long running retrieval/crossref operations (affects at least
-            2.11.1 onwards)
+            <!-- JAL-3981 --> Sequence Details report can take a long
+            time to be displayed for heavily annotated sequences (such
+            as single genome contigs for highly studied organisms)
           </li>
           <li>
             <!-- JAL-3886 -->Pfam and Rfam alignment retrieval as
index d52e049..f8e70b1 100755 (executable)
@@ -1415,6 +1415,7 @@ public class Sequence extends ASequence implements SequenceI
   @Override
   public void addDBRef(DBRefEntry entry)
   {
+    // TODO JAL-3980 maintain as sorted list
     if (datasetSequence != null)
     {
       datasetSequence.addDBRef(entry);
@@ -1425,6 +1426,7 @@ public class Sequence extends ASequence implements SequenceI
     {
       dbrefs = new DBModList<>();
     }
+    // TODO JAL-3979 LOOK UP RATHER THAN SWEEP FOR EFFICIENCY
 
     for (int ib = 0, nb = dbrefs.size(); ib < nb; ib++)
     {
index fcd8171..6903034 100644 (file)
@@ -1817,7 +1817,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
       contents.append("<p><h2>" + MessageManager.formatMessage(
               "label.create_sequence_details_report_annotation_for",
               new Object[]
-              { seq.getDisplayId(true) }) + "</h2></p><p>");
+              { seq.getDisplayId(true) }) + "</h2></p>\n<p>");
       new SequenceAnnotationReport(false).createSequenceAnnotationReport(
               contents, seq, true, true, ap.getSeqPanel().seqCanvas.fr);
       contents.append("</p>");
index 02d4bda..2408d7a 100644 (file)
@@ -131,7 +131,8 @@ public class TDBResultAnalyser
     // ignore anything outside the sequence region
     for (FTSData row : collectedResults)
     {
-      if (row.getSummaryData() != null && row.getSummaryData()[idx_ups]!=null)
+      if (row.getSummaryData() != null
+              && row.getSummaryData()[idx_ups] != null)
       {
         int up_s = (Integer) row.getSummaryData()[idx_ups];
         int up_e = (Integer) row.getSummaryData()[idx_upe];
index c5bc902..c831366 100644 (file)
 package jalview.io;
 
 import java.util.Locale;
-
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Comparator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.Lists;
+
 import jalview.api.FeatureColourI;
 import jalview.datamodel.DBRefEntry;
 import jalview.datamodel.DBRefSource;
@@ -493,6 +496,7 @@ public class SequenceAnnotationReport
       sb.append(tmp);
       maxWidth = Math.max(maxWidth, tmp.length());
     }
+    sb.append("\n");
     SequenceI ds = sequence;
     while (ds.getDatasetSequence() != null)
     {
@@ -503,6 +507,7 @@ public class SequenceAnnotationReport
     {
       maxWidth = Math.max(maxWidth, appendDbRefs(sb, ds, summary));
     }
+    sb.append("\n");
 
     /*
      * add non-positional features if wanted
@@ -534,12 +539,19 @@ public class SequenceAnnotationReport
   protected int appendDbRefs(final StringBuilder sb, SequenceI ds,
           boolean summary)
   {
-    List<DBRefEntry> dbrefs = ds.getDBRefs();
-    if (dbrefs == null)
+    List<DBRefEntry> dbrefs, dbrefset = ds.getDBRefs();
+
+    if (dbrefset == null)
     {
       return 0;
     }
 
+    // PATCH for JAL-3980 defensive copy
+
+    dbrefs = new ArrayList<DBRefEntry>();
+
+    dbrefs.addAll(dbrefset);
+
     // note this sorts the refs held on the sequence!
     dbrefs.sort(comparator);
     boolean ellipsis = false;
@@ -576,7 +588,7 @@ public class SequenceAnnotationReport
       countForSource++;
       if (countForSource == 1 || !summary)
       {
-        sb.append("<br/>");
+        sb.append("<br/>\n");
       }
       if (countForSource <= MAX_REFS_PER_SOURCE || !summary)
       {
@@ -584,7 +596,7 @@ public class SequenceAnnotationReport
         lineLength += accessionId.length() + 1;
         if (countForSource > 1 && summary)
         {
-          sb.append(", ").append(accessionId);
+          sb.append(",\n ").append(accessionId);
           lineLength++;
         }
         else
@@ -602,11 +614,11 @@ public class SequenceAnnotationReport
     }
     if (moreSources)
     {
-      sb.append("<br/>").append(source).append(COMMA).append(ELLIPSIS);
+      sb.append("<br/>\n").append(source).append(COMMA).append(ELLIPSIS);
     }
     if (ellipsis)
     {
-      sb.append("<br/>(");
+      sb.append("<br/>\n(");
       sb.append(MessageManager.getString("label.output_seq_details"));
       sb.append(")");
     }
index b91466b..355eae5 100644 (file)
@@ -736,10 +736,10 @@ public class PDBFTSRestClientTest
               new String[]
               { readJsonStringFromFile(
                       "test/jalview/fts/threedbeacons/p01308_pdbfts_query.txt")
-                      .trim(),
+                              .trim(),
                   readJsonStringFromFile(
                           "test/jalview/fts/threedbeacons/p01308_pdbfts_resp.txt")
-                          .trim() });
+                                  .trim() });
       for (int i = 1; i < 5; i++)
       {
         mocks.add(
@@ -747,12 +747,10 @@ public class PDBFTSRestClientTest
                 new String[]
                 { readJsonStringFromFile(
                         "test/jalview/fts/threedbeacons/p0dtd1_pdbfts_fts_query_pt"
-                                + i + ".txt")
-                        .trim(),
+                                + i + ".txt").trim(),
                     readJsonStringFromFile(
                             "test/jalview/fts/threedbeacons/p0dtd1_pdbfts_fts_query_pt"
-                                    + i + "_resp.txt")
-                            .trim() });
+                                    + i + "_resp.txt").trim() });
       }
     } catch (Throwable e)
     {
index 73ba4df..7107448 100644 (file)
@@ -239,8 +239,7 @@ public class StructureChooserQuerySourceTest
   }
 
   @SuppressWarnings("deprecation")
-  @Test(groups =
-  { "Functional" })
+  @Test(groups = { "Functional" })
   public void buildPDBQueryTest()
   {
     System.out.println("seq >>>> " + seq);
@@ -288,8 +287,7 @@ public class StructureChooserQuerySourceTest
   }
 
   @SuppressWarnings("deprecation")
-  @Test(groups =
-  { "Functional" })
+  @Test(groups = { "Functional" })
   public void buildThreeDBQueryTest()
   {
     System.out.println("seq >>>> " + upSeq);