Merge branch 'patch/JAL-4298_synchronize_consoledoc' into bug/JAL-4298_java_console_c...
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 19 Oct 2023 20:06:00 +0000 (21:06 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 19 Oct 2023 20:06:00 +0000 (21:06 +0100)
help/help/html/features/viewingpdbs.html
help/markdown/releases/release-2_11_3_0.md
src/jalview/analysis/TreeModel.java
src/jalview/datamodel/ColumnSelection.java
src/jalview/ext/jmol/JalviewJmolBinding.java
src/jalview/gui/Console.java
src/jalview/gui/TreeCanvas.java
src/jalview/structures/models/AAStructureBindingModel.java

index 947b96b..df76f89 100755 (executable)
@@ -87,7 +87,7 @@
     <strong>Structure Viewers in the Jalview Desktop</strong><br /> The
     <a href="jmol.html">Jmol viewer</a> has been included since Jalview
     2.3. Jalview 2.8.2 included support for <a href="chimera.html">Chimera</a>,
-    provided it is installed and can be launched by Jalview. ChimeraX and PyMOL
+    provided it is installed and can be launched by Jalview. ChimeraX and <a href="pymol.html">PyMOL</a>
     support is included from Jalview 2.11.2. The default
     viewer can be configured in the <a href="preferences.html#structure">Structure
       tab</a> in the <strong>Tools&rarr;Preferences</strong> dialog box.
     un-tick the <strong>Superpose Structures</strong> checkbox.
 
   </p>
-  <p>
-    <em>Superposing structures</em><br/>Jalview superposes structures using
-    the visible portions of any associated sequence alignments. A
-    message in the structure viewer's status bar will be shown if not
-    enough aligned columns were available to perform a superposition.
-  </p>
-  <p>
-  See the <a href="jmol.html">Jmol
-    </a> and <a href="chimera.html">Chimera</a> help pages for
-      more information about their capabilities.</p>
-  
-
-  <p>
+       <p>
+               <em>Superposing structures</em><br />Jalview superposes structures
+               using the currently selected columns (if more than 3 columns are
+               selected), or the visible portions of any associated sequence
+               alignments. Depending on the viewer, Root Mean Squared Deviation (RMS
+               or RMSD) for each pair of superpositions may be output in the
+               structure viewer's console.
+       </p>
+       <p>A message in the structure viewer's status bar will be shown if
+               not enough aligned columns were available to perform a superposition.
+       </p>
+       <p>
+               See the <a href="jmol.html">Jmol</a>, <a href="chimera.html">Chimera/X</a>
+               and <a href="pymol.html">Pymol</a> help pages for more information
+               about their individual capabilities.
+       </p>
+       <p>
     <strong>Retrieving sequences from the PDB</strong><br>You can
     retrieve sequences from the PDB using the <a
       href="pdbsequencefetcher.html">Sequence Fetcher</a>. The sequences
index 80f8cf4..8847eb2 100644 (file)
@@ -88,6 +88,8 @@ channel: "release"
 - <!-- JAL-2910 --> HeadlessException in console in headless mode (actually fixed in 2.11.{0,1,2))
 
 ## New Known defects
+- <!-- JAL-4303 --> EBI-AlphaFold PLDDT colours cannot be overlaid on alignment via 'Colour by annotation' unless the alignment's colourscheme has been set to 'None' via the Colours menu.
+- <!-- JAL-4302 --> Tree renderer doesn't show bottom-most leaves of tree when Fit-To-Window is enabled.
 - <!-- JAL-4178 --> Cannot cancel structure view open action once it has been started via the structure chooser dialog
 - <!-- JAL-4142 --> Example project's multiple views do not open in distinct locations when eXpand views is used to show them all separately
 - <!-- JAL-4127 --> 'Reload' for a jalview project results in all windows being duplicated
index 90fe089..ce79a65 100644 (file)
@@ -353,6 +353,7 @@ public class TreeModel
 
     if ((nd.left() == null) && (nd.right() == null))
     {
+       // TODO FIX FOR COLUMN TREES
       jalview.bin.Console.outPrintln("Leaf = " + ((SequenceI) nd.element()).getName());
       jalview.bin.Console.outPrintln("Dist " + nd.dist);
       jalview.bin.Console.outPrintln("Boot " + nd.getBootstrap());
@@ -430,7 +431,7 @@ public class TreeModel
 
     if ((nd.left() == null) && (nd.right() == null))
     {
-      nd.height = ((BinaryNode) nd.parent()).height + nd.dist;
+      nd.height = nd.parent().height + nd.dist;
 
       if (nd.height > maxheight)
       {
@@ -445,7 +446,7 @@ public class TreeModel
     {
       if (nd.parent() != null)
       {
-        nd.height = ((BinaryNode) nd.parent()).height + nd.dist;
+        nd.height = nd.parent().height + nd.dist;
       }
       else
       {
index 4a38ec0..b427739 100644 (file)
@@ -340,10 +340,12 @@ public class ColumnSelection
 
   /**
    * Returns a read-only view of the (possibly empty) list of selected columns
+   * (base 1)
    * <p>
-   * The list contains no duplicates but is not necessarily ordered. It also may
-   * include columns hidden from the current view. To modify (for example sort)
-   * the list, you should first make a copy.
+   * The list contains no duplicates but is not necessarily ordered. Columns are
+   * reported in alignment coordinates (base 1), so may also include columns
+   * hidden from the current view. To modify (for example sort) the list, you
+   * should first make a copy.
    * <p>
    * The list is not thread-safe: iterating over it could result in
    * ConcurrentModificationException if it is modified by another thread.
index 870db65..dc18369 100644 (file)
@@ -267,16 +267,30 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
   {
     if (atoms != null)
     {
-      boolean useScriptWait = atoms.size() > 1;
       if (resetLastRes.length() > 0)
       {
-        jmolScript(resetLastRes.toString(), useScriptWait);
+        jmolScript(resetLastRes.toString());
         resetLastRes.setLength(0);
       }
+      StringBuilder highlightCommands=null;
       for (AtomSpec atom : atoms)
       {
-        highlightAtom(atom.getAtomIndex(), atom.getPdbResNum(),
-                atom.getChain(), atom.getPdbFile(), useScriptWait);
+        StringBuilder thisAtom = highlightAtom(atom.getAtomIndex(), atom.getPdbResNum(),
+                atom.getChain(), atom.getPdbFile());
+        if (thisAtom!=null) {
+          if (highlightCommands==null)
+          {
+            highlightCommands=thisAtom;                  
+          } else {
+            highlightCommands.append(thisAtom);
+          }
+        }
+      }
+      if (highlightCommands!=null)
+      {
+        jmolHistory(false);
+        jmolScript(highlightCommands.toString());
+        jmolHistory(true);
       }
       // Highlight distances between atoms with a 'measure' command - not yet
       // working
@@ -306,17 +320,15 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
   }
 
   // jmol/ssm only
-  public void highlightAtom(int atomIndex, int pdbResNum, String chain,
-          String pdbfile, boolean useScriptWait)
+  private StringBuilder highlightAtom(int atomIndex, int pdbResNum, String chain,
+          String pdbfile)
   {
     String modelId = getModelIdForFile(pdbfile);
     if (modelId.isEmpty())
     {
-      return;
+      return null;
     }
 
-    jmolHistory(false, useScriptWait);
-
     StringBuilder selection = new StringBuilder(32);
     StringBuilder cmd = new StringBuilder(64);
     selection.append("select ").append(String.valueOf(pdbResNum));
@@ -333,8 +345,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel
     resetLastRes.append(selection).append(";wireframe 0;").append(selection)
             .append(" and not hetero; spacefill 0;");
 
-    jmolScript(cmd.toString(), useScriptWait);
-    jmolHistory(true, useScriptWait);
+    return cmd;
   }
 
   private boolean debug = true;
index 631e0a2..7e8cbc6 100644 (file)
@@ -713,12 +713,16 @@ public class Console extends WindowAdapter
               displayPipe = tmp;
             }
             // simply append whole buffer
-            textArea.append(replace.toString()); // ##### implicated BLOCKED
-            count += replace.length();
-            if (count > byteslim)
+            synchronized (textArea.getDocument())
             {
-              trimBuffer(false);
+              textArea.append(replace.toString());
+              count += replace.length();
+              if (count > byteslim)
+              {
+                trimBuffer(false);
+              }
             }
+
           }
           if (displayPipe.length() == 0)
           {
index 6fbd422..2d4bdc8 100755 (executable)
@@ -406,9 +406,9 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
       }
 
       int ystart = (node.left() == null ? 0
-              : (int) (((BinaryNode) node.left()).ycount * chunk)) + offy;
+              : (int) (node.left().ycount * chunk)) + offy;
       int yend = (node.right() == null ? 0
-              : (int) (((BinaryNode) node.right()).ycount * chunk)) + offy;
+              : (int) (node.right().ycount * chunk)) + offy;
 
       Rectangle pos = new Rectangle(xend - 2, ypos - 2, 5, 5);
       nodeHash.put(node, pos);
@@ -791,11 +791,11 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
 
     if (top.count == 0)
     {
-      top.count = ((BinaryNode) top.left()).count
-              + ((BinaryNode) top.right()).count;
+      top.count = top.left().count
+              + top.right().count;
     }
 
-    double chunk = (double) (height - (offy)) / (double)top.count;
+    float chunk = (float) (height - (offy)) / top.count;
 
     drawNode(g2, tree.getTopNode(), chunk, wscale, width, offx, offy);
 
index 4b11494..dcedafa 100644 (file)
@@ -884,14 +884,7 @@ public abstract class AAStructureBindingModel
       {
         for (int s : cs.getSelected())
         {
-          if (hiddenCols == null)
-          {
             matched.set(s);
-          }
-          else
-          {
-            matched.set(hiddenCols.visibleToAbsoluteColumn(s));
-          }
         }
       }
       else