JAL-2422 comments updated re ALTLOC handling
[jalview.git] / src / jalview / ext / rbvi / chimera / ChimeraXCommands.java
index 9636a6a..d0c5671 100644 (file)
  */
 package jalview.ext.rbvi.chimera;
 
+import java.awt.Color;
+import java.util.Arrays;
+import java.util.List;
+
 import jalview.structure.AtomSpecModel;
 import jalview.structure.StructureCommand;
 import jalview.structure.StructureCommandI;
 import jalview.util.ColorUtils;
 
-import java.awt.Color;
-import java.util.Arrays;
-import java.util.List;
-
 /**
  * Routines for generating ChimeraX commands for Jalview/ChimeraX binding
  */
 public class ChimeraXCommands extends ChimeraCommands
 {
   private static final StructureCommand SHOW_BACKBONE = new StructureCommand(
-          "~display all;show @CA|P pbonds");
+          "~display all;~ribbon;show @CA|P atoms");
 
   private static final StructureCommand FOCUS_VIEW = new StructureCommand(
           "view");
@@ -63,7 +63,7 @@ public class ChimeraXCommands extends ChimeraCommands
   }
 
   @Override
-  public StructureCommandI getColourCommand(String atomSpec, Color colour)
+  public StructureCommandI colourResidues(String atomSpec, Color colour)
   {
     // https://www.cgl.ucsf.edu/chimerax/docs/user/commands/color.html
     String colourCode = getColourString(colour);
@@ -132,6 +132,10 @@ public class ChimeraXCommands extends ChimeraCommands
    * Returns the range(s) formatted as a ChimeraX atomspec, for example
    * <p>
    * #1/A:2-20,30-40/B:10-20|#2/A:12-30
+   * <p>
+   * Note there is no need to explicitly exclude ALTLOC atoms when
+   * {@code alphaOnly == true}, as this is the default behaviour of ChimeraX (a
+   * change from Chimera)
    * 
    * @return
    */
@@ -150,9 +154,9 @@ public class ChimeraXCommands extends ChimeraCommands
       appendModel(sb, model, atomSpec);
       if (alphaOnly)
       {
-        sb.append("@CA|P");
+        // TODO @P if RNA - add nucleotide flag to AtomSpecModel?
+        sb.append("@CA");
       }
-      // todo: is there ChimeraX syntax to exclude altlocs?
     }
     return sb.toString();
   }
@@ -195,16 +199,15 @@ public class ChimeraXCommands extends ChimeraCommands
   }
 
   @Override
-  public List<StructureCommandI> superposeStructures(AtomSpecModel spec,
-          AtomSpecModel ref)
+  public List<StructureCommandI> superposeStructures(AtomSpecModel ref,
+          AtomSpecModel spec)
   {
     /*
      * Form ChimeraX match command to match spec to ref
      * 
      * match #1/A:2-94 toAtoms #2/A:1-93
      * 
-     * @see
-     * https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/match.html
+     * @see https://www.cgl.ucsf.edu/chimerax/docs/user/commands/align.html
      */
     StringBuilder cmd = new StringBuilder();
     String atomSpec = getAtomSpec(spec, true);