JAL-3551 the correct PyMOL colour by chain command
[jalview.git] / src / jalview / ext / pymol / PymolCommands.java
index 1638644..910aae1 100644 (file)
@@ -10,19 +10,19 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * A class that generates commands to send to PyMol
+ * A class that generates commands to send to PyMol over its XML-RPC interface.
+ * <p>
+ * Note that because the xml-rpc interface can only accept one command at a
+ * time, we can't concatenate commands, and must instead form and send them
+ * individually.
  * 
  * @see https://pymolwiki.org/index.php/Category:Commands
+ * @see https://pymolwiki.org/index.php/RPC
  */
 public class PymolCommands extends StructureCommandsBase
 {
-  private static final StructureCommandI COLOUR_BY_CHAIN = new StructureCommand(
-          "util.cbc");
+  private static final StructureCommand COLOUR_BY_CHAIN = new StructureCommand("spectrum", "chain");
 
-  /*
-   * because the xml-rpc interface can only accept one command at a time, we can't
-   * concatenate commands and must instead form and send them individually
-   */
   private static final List<StructureCommandI> COLOR_BY_CHARGE = new ArrayList<>();
 
   private static final List<StructureCommandI> SHOW_BACKBONE = new ArrayList<>();
@@ -33,7 +33,8 @@ public class PymolCommands extends StructureCommandsBase
             .add(new StructureCommand("color", "red", "resn ASP resn GLU"));
     COLOR_BY_CHARGE.add(
             new StructureCommand("color", "blue", "resn LYS resn ARG"));
-    COLOR_BY_CHARGE.add(new StructureCommand("color"));
+    COLOR_BY_CHARGE
+            .add(new StructureCommand("color", "yellow", "resn CYS"));
     SHOW_BACKBONE.add(new StructureCommand("hide", "everything"));
     SHOW_BACKBONE.add(new StructureCommand("show", "ribbon"));
   }
@@ -41,8 +42,6 @@ public class PymolCommands extends StructureCommandsBase
   @Override
   public StructureCommandI colourByChain()
   {
-    // https://pymolwiki.org/index.php/CBC
-    // TODO this doesn't execute as an xml-rpc command
     return COLOUR_BY_CHAIN;
   }