From f9062df1303c1ff071075256cf4b7ad7c9db9658 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 15 Feb 2022 17:35:16 +0000 Subject: [PATCH] JAL-1761 backbone type parameter for configuring which atoms are used for superposition of structures --- src/jalview/ext/jmol/JmolCommands.java | 13 +++--- src/jalview/ext/pymol/PymolCommands.java | 21 +++++---- src/jalview/ext/rbvi/chimera/ChimeraCommands.java | 28 +++++++----- src/jalview/ext/rbvi/chimera/ChimeraXCommands.java | 22 +++++---- src/jalview/structure/StructureCommandsBase.java | 2 +- src/jalview/structure/StructureCommandsI.java | 10 ++-- .../structures/models/AAStructureBindingModel.java | 5 +- test/jalview/ext/jmol/JmolCommandsTest.java | 25 +++++----- test/jalview/ext/pymol/PymolCommandsTest.java | 47 +++++++++---------- .../ext/rbvi/chimera/ChimeraCommandsTest.java | 47 +++++++++---------- .../ext/rbvi/chimera/ChimeraXCommandsTest.java | 48 ++++++++++---------- .../models/AAStructureBindingModelTest.java | 11 +++-- 12 files changed, 150 insertions(+), 129 deletions(-) diff --git a/src/jalview/ext/jmol/JmolCommands.java b/src/jalview/ext/jmol/JmolCommands.java index 3a66349..8b67ad9 100644 --- a/src/jalview/ext/jmol/JmolCommands.java +++ b/src/jalview/ext/jmol/JmolCommands.java @@ -40,6 +40,7 @@ import jalview.structure.StructureCommandI; import jalview.structure.StructureCommandsBase; import jalview.structure.StructureMapping; import jalview.structure.StructureSelectionManager; +import jalview.structure.StructureCommandsI.AtomSpecType; import jalview.util.Comparison; import jalview.util.Platform; @@ -178,7 +179,7 @@ public class JmolCommands extends StructureCommandsBase */ @Override public List superposeStructures(AtomSpecModel refAtoms, - AtomSpecModel atomSpec, boolean isNucleotide) + AtomSpecModel atomSpec, AtomSpecType backbone) { StringBuilder sb = new StringBuilder(64); String refModel = refAtoms.getModels().iterator().next(); @@ -190,16 +191,16 @@ public class JmolCommands extends StructureCommandsBase * command examples don't include modelspec with atoms, getAtomSpec does; * it works, so leave it as it is for simplicity */ - sb.append(getAtomSpec(atomSpec, true)).append("}{"); - sb.append(getAtomSpec(refAtoms, true)).append("}"); + sb.append(getAtomSpec(atomSpec, backbone)).append("}{"); + sb.append(getAtomSpec(refAtoms, backbone)).append("}"); sb.append(" ROTATE TRANSLATE "); sb.append(getCommandSeparator()); /* * show residues used for superposition as ribbon */ - sb.append("select ").append(getAtomSpec(atomSpec, false)).append("|"); - sb.append(getAtomSpec(refAtoms, false)).append(getCommandSeparator()) + sb.append("select ").append(getAtomSpec(atomSpec, AtomSpecType.RESIDUE_ONLY)).append("|"); + sb.append(getAtomSpec(refAtoms, AtomSpecType.RESIDUE_ONLY)).append(getCommandSeparator()) .append("cartoons"); return Arrays.asList(new StructureCommand(sb.toString())); @@ -250,7 +251,7 @@ public class JmolCommands extends StructureCommandsBase * a separate clause in the {@code compare} (superposition) command. */ @Override - public String getAtomSpec(AtomSpecModel model, boolean alphaOnly) + public String getAtomSpec(AtomSpecModel model, AtomSpecType specType) { StringBuilder sb = new StringBuilder(128); diff --git a/src/jalview/ext/pymol/PymolCommands.java b/src/jalview/ext/pymol/PymolCommands.java index ae91aa5..ed64c00 100644 --- a/src/jalview/ext/pymol/PymolCommands.java +++ b/src/jalview/ext/pymol/PymolCommands.java @@ -106,12 +106,13 @@ public class PymolCommands extends StructureCommandsBase @Override public List superposeStructures(AtomSpecModel refAtoms, - AtomSpecModel atomSpec, boolean isNucleotide) + AtomSpecModel atomSpec, AtomSpecType specType) { + // https://pymolwiki.org/index.php/Super List commands = new ArrayList<>(); - String refAtomsAlphaOnly = "("+getAtomSpec(refAtoms, true)+" and (altloc '' or altloc 'a'))"; - String atomSpec2AlphaOnly = "("+getAtomSpec(atomSpec, true)+" and (altloc '' or altloc 'a'))"; + String refAtomsAlphaOnly = "("+getAtomSpec(refAtoms, specType)+" and (altloc '' or altloc 'a'))"; + String atomSpec2AlphaOnly = "("+getAtomSpec(atomSpec, specType)+" and (altloc '' or altloc 'a'))"; // pair_fit mobile -> reference commands.add(new StructureCommand("pair_fit", atomSpec2AlphaOnly, refAtomsAlphaOnly)); @@ -119,8 +120,8 @@ public class PymolCommands extends StructureCommandsBase /* * and show superposed residues as cartoon */ - String refAtomsAll = getAtomSpec(refAtoms, false); - String atomSpec2All = getAtomSpec(atomSpec, false); + String refAtomsAll = getAtomSpec(refAtoms, AtomSpecType.RESIDUE_ONLY); + String atomSpec2All = getAtomSpec(atomSpec, AtomSpecType.RESIDUE_ONLY); commands.add(new StructureCommand("show", "cartoon", refAtomsAll + " " + atomSpec2All)); @@ -154,7 +155,7 @@ public class PymolCommands extends StructureCommandsBase * @see https://pymolwiki.org/index.php/Selection_Macros */ @Override - public String getAtomSpec(AtomSpecModel model, boolean alphaOnly) + public String getAtomSpec(AtomSpecModel model, AtomSpecType specType) { StringBuilder sb = new StringBuilder(64); boolean first = true; @@ -185,10 +186,14 @@ public class PymolCommands extends StructureCommandsBase } } sb.append("/"); - if (alphaOnly) + if (specType == AtomSpecType.ALPHA) { sb.append("CA"); } + if (specType == AtomSpecType.PHOSPHATE) + { + sb.append("P"); + } } } return sb.toString(); @@ -262,7 +267,7 @@ public class PymolCommands extends StructureCommandsBase StringBuilder sb = new StringBuilder(128); sb.append("p.").append(attributeName).append("='") .append(attributeValue).append("'"); - String atomSpec = getAtomSpec(atomSpecModel, false); + String atomSpec = getAtomSpec(atomSpecModel, AtomSpecType.RESIDUE_ONLY); return new StructureCommand("iterate", atomSpec, sb.toString()); } diff --git a/src/jalview/ext/rbvi/chimera/ChimeraCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraCommands.java index bfad8fb..6d4caa2 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraCommands.java @@ -32,6 +32,7 @@ import jalview.structure.AtomSpecModel; import jalview.structure.StructureCommand; import jalview.structure.StructureCommandI; import jalview.structure.StructureCommandsBase; +import jalview.structure.StructureCommandsI.AtomSpecType; import jalview.util.ColorUtils; /** @@ -161,7 +162,7 @@ public class ChimeraCommands extends StructureCommandsBase StringBuilder sb = new StringBuilder(128); sb.append("setattr res ").append(attributeName).append(" '") .append(attributeValue).append("' "); - sb.append(getAtomSpec(atomSpecModel, false)); + sb.append(getAtomSpec(atomSpecModel, AtomSpecType.RESIDUE_ONLY)); return new StructureCommand(sb.toString()); } @@ -259,7 +260,7 @@ public class ChimeraCommands extends StructureCommandsBase @Override public List superposeStructures(AtomSpecModel ref, - AtomSpecModel spec, boolean isNucleotide) + AtomSpecModel spec, AtomSpecType backbone) { /* * Form Chimera match command to match spec to ref @@ -270,15 +271,15 @@ public class ChimeraCommands extends StructureCommandsBase * @see https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/match.html */ StringBuilder cmd = new StringBuilder(); - String atomSpecAlphaOnly = getAtomSpec(spec, true); - String refSpecAlphaOnly = getAtomSpec(ref, true); + String atomSpecAlphaOnly = getAtomSpec(spec, backbone); + String refSpecAlphaOnly = getAtomSpec(ref, backbone); cmd.append("match ").append(atomSpecAlphaOnly).append(" ").append(refSpecAlphaOnly); /* * show superposed residues as ribbon */ - String atomSpec = getAtomSpec(spec, false); - String refSpec = getAtomSpec(ref, false); + String atomSpec = getAtomSpec(spec, AtomSpecType.RESIDUE_ONLY); + String refSpec = getAtomSpec(ref, AtomSpecType.RESIDUE_ONLY); cmd.append("; ribbon "); cmd.append(atomSpec).append("|").append(refSpec).append("; focus"); @@ -319,12 +320,12 @@ public class ChimeraCommands extends StructureCommandsBase *
    * 
    * @param model
-   * @param alphaOnly
+   * @param specType
    * @return
    * @see https://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/midas/frameatom_spec.html
    */
   @Override
-  public String getAtomSpec(AtomSpecModel atomSpec, boolean alphaOnly)
+  public String getAtomSpec(AtomSpecModel atomSpec, AtomSpecType specType)
   {
     StringBuilder sb = new StringBuilder(128);
     boolean firstModel = true;
@@ -335,7 +336,7 @@ public class ChimeraCommands extends StructureCommandsBase
         sb.append("|");
       }
       firstModel = false;
-      appendModel(sb, model, atomSpec, alphaOnly);
+      appendModel(sb, model, atomSpec, specType);
     }
     return sb.toString();
   }
@@ -349,7 +350,7 @@ public class ChimeraCommands extends StructureCommandsBase
    * @param alphaOnly
    */
   protected void appendModel(StringBuilder sb, String model,
-          AtomSpecModel atomSpec, boolean alphaOnly)
+          AtomSpecModel atomSpec, AtomSpecType specType)
   {
     sb.append("#").append(model).append(":");
 
@@ -367,15 +368,18 @@ public class ChimeraCommands extends StructureCommandsBase
         firstPositionForModel = false;
       }
     }
-    if (alphaOnly)
+    if (specType == AtomSpecType.ALPHA)
     {
       /*
        * restrict to alpha carbon, no alternative locations
        * (needed to ensuring matching atom counts for superposition)
        */
-      // TODO @P instead if RNA - add nucleotide flag to AtomSpecModel?
       sb.append("@CA").append(NO_ALTLOCS);
     }
+    if (specType == AtomSpecType.PHOSPHATE)
+    {
+      sb.append("@P").append(NO_ALTLOCS);
+    }
   }
 
   @Override
diff --git a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java
index 74e7f08..780d292 100644
--- a/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java
+++ b/src/jalview/ext/rbvi/chimera/ChimeraXCommands.java
@@ -28,6 +28,7 @@ import java.util.List;
 import jalview.structure.AtomSpecModel;
 import jalview.structure.StructureCommand;
 import jalview.structure.StructureCommandI;
+import jalview.structure.StructureCommandsI.AtomSpecType;
 
 /**
  * Routines for generating ChimeraX commands for Jalview/ChimeraX binding
@@ -119,7 +120,7 @@ public class ChimeraXCommands extends ChimeraCommands
           String attributeValue, AtomSpecModel atomSpecModel)
   {
     StringBuilder sb = new StringBuilder(128);
-    sb.append("setattr ").append(getAtomSpec(atomSpecModel, false));
+    sb.append("setattr ").append(getAtomSpec(atomSpecModel, AtomSpecType.RESIDUE_ONLY));
     sb.append(" res ").append(attributeName).append(" '")
             .append(attributeValue).append("'");
     sb.append(" create true");
@@ -153,7 +154,7 @@ public class ChimeraXCommands extends ChimeraCommands
    * @return
    */
   @Override
-  public String getAtomSpec(AtomSpecModel atomSpec, boolean alphaOnly)
+  public String getAtomSpec(AtomSpecModel atomSpec, AtomSpecType specType)
   {
     StringBuilder sb = new StringBuilder(128);
     boolean firstModel = true;
@@ -165,11 +166,14 @@ public class ChimeraXCommands extends ChimeraCommands
       }
       firstModel = false;
       appendModel(sb, model, atomSpec);
-      if (alphaOnly)
+      if (specType == AtomSpecType.ALPHA)
       {
-        // TODO @P if RNA - add nucleotide flag to AtomSpecModel?
         sb.append("@CA");
       }
+      if (specType == AtomSpecType.PHOSPHATE)
+      {
+        sb.append("@P");
+      }
     }
     return sb.toString();
   }
@@ -213,7 +217,7 @@ public class ChimeraXCommands extends ChimeraCommands
 
   @Override
   public List superposeStructures(AtomSpecModel ref,
-          AtomSpecModel spec, boolean isNucleotide)
+          AtomSpecModel spec, AtomSpecType backbone)
   {
     /*
      * Form ChimeraX match command to match spec to ref
@@ -223,8 +227,8 @@ public class ChimeraXCommands extends ChimeraCommands
      * @see https://www.cgl.ucsf.edu/chimerax/docs/user/commands/align.html
      */
     StringBuilder cmd = new StringBuilder();
-    String atomSpec = getAtomSpec(spec, true);
-    String refSpec = getAtomSpec(ref, true);
+    String atomSpec = getAtomSpec(spec, backbone);
+    String refSpec = getAtomSpec(ref, backbone);
     cmd.append("align ").append(atomSpec).append(" toAtoms ")
             .append(refSpec);
 
@@ -232,8 +236,8 @@ public class ChimeraXCommands extends ChimeraCommands
      * show superposed residues as ribbon, others as chain
      */
     cmd.append("; ribbon ");
-    cmd.append(getAtomSpec(spec, false)).append("|");
-    cmd.append(getAtomSpec(ref, false)).append("; view");
+    cmd.append(getAtomSpec(spec, AtomSpecType.RESIDUE_ONLY)).append("|");
+    cmd.append(getAtomSpec(ref, AtomSpecType.RESIDUE_ONLY)).append("; view");
 
     return Arrays.asList(new StructureCommand(cmd.toString()));
   }
diff --git a/src/jalview/structure/StructureCommandsBase.java b/src/jalview/structure/StructureCommandsBase.java
index 8716691..fdc8d16 100644
--- a/src/jalview/structure/StructureCommandsBase.java
+++ b/src/jalview/structure/StructureCommandsBase.java
@@ -141,7 +141,7 @@ public abstract class StructureCommandsBase implements StructureCommandsI
   protected StructureCommandI getColourCommand(AtomSpecModel atomSpecModel,
           Color colour)
   {
-    String atomSpec = getAtomSpec(atomSpecModel, false);
+    String atomSpec = getAtomSpec(atomSpecModel, AtomSpecType.RESIDUE_ONLY);
     return colourResidues(atomSpec, colour);
   }
 
diff --git a/src/jalview/structure/StructureCommandsI.java b/src/jalview/structure/StructureCommandsI.java
index 734f275..0489bda 100644
--- a/src/jalview/structure/StructureCommandsI.java
+++ b/src/jalview/structure/StructureCommandsI.java
@@ -86,12 +86,11 @@ public interface StructureCommandsI
    * 
    * @param refAtoms
    * @param atomSpec
-   * @param isNucleotide TODO
-   * @param nucleotide - when true, superposition is based on phoshpate backbone, not peptide
+   * @param backbone - superpose based on which kind of atomType
    * @return
    */
   List superposeStructures(AtomSpecModel refAtoms,
-          AtomSpecModel atomSpec, boolean isNucleotide);
+          AtomSpecModel atomSpec, AtomSpecType backbone);
 
   /**
    * Returns a command to open a file of commands at the given path
@@ -110,16 +109,17 @@ public interface StructureCommandsI
    */
   StructureCommandI saveSession(String filepath);
 
+  enum AtomSpecType { RESIDUE_ONLY, ALPHA, PHOSPHATE }; 
   /**
    * Returns a representation of the atom set represented by the model, in
    * viewer syntax format. If {@code alphaOnly} is true, this is restricted to
    * Alpha Carbon (peptide) or Phosphorous (rna) only
    * 
    * @param model
-   * @param alphaOnly
+   * @param specType
    * @return
    */
-  String getAtomSpec(AtomSpecModel model, boolean alphaOnly);
+  String getAtomSpec(AtomSpecModel model, AtomSpecType specType);
 
   /**
    * Returns the lowest model number used by the structure viewer (likely 0 or
diff --git a/src/jalview/structures/models/AAStructureBindingModel.java b/src/jalview/structures/models/AAStructureBindingModel.java
index 336c6f8..9ecf630 100644
--- a/src/jalview/structures/models/AAStructureBindingModel.java
+++ b/src/jalview/structures/models/AAStructureBindingModel.java
@@ -61,6 +61,7 @@ import jalview.structure.AtomSpec;
 import jalview.structure.AtomSpecModel;
 import jalview.structure.StructureCommandI;
 import jalview.structure.StructureCommandsI;
+import jalview.structure.StructureCommandsI.AtomSpecType;
 import jalview.structure.StructureListener;
 import jalview.structure.StructureMapping;
 import jalview.structure.StructureSelectionManager;
@@ -925,7 +926,7 @@ public abstract class AAStructureBindingModel
       // todo better way to ensure synchronous than setting getReply true!!
       executeCommands(commandGenerator.showBackbone(), true, null);
       
-      boolean isNucleotide = structures[refStructure].isRna;
+      AtomSpecType backbone = structures[refStructure].isRna ? AtomSpecType.PHOSPHATE : AtomSpecType.ALPHA;
       /*
        * superpose each (other) structure to the reference in turn
        */
@@ -935,7 +936,7 @@ public abstract class AAStructureBindingModel
         {
           AtomSpecModel atomSpec = getAtomSpec(structures[i], matched);
           List commands = commandGenerator
-                  .superposeStructures(refAtoms, atomSpec,isNucleotide);
+                  .superposeStructures(refAtoms, atomSpec, backbone);
           List replies = executeCommands(commands, true, null);
           for (String reply : replies)
           {
diff --git a/test/jalview/ext/jmol/JmolCommandsTest.java b/test/jalview/ext/jmol/JmolCommandsTest.java
index 64899d3..6265c05 100644
--- a/test/jalview/ext/jmol/JmolCommandsTest.java
+++ b/test/jalview/ext/jmol/JmolCommandsTest.java
@@ -42,6 +42,7 @@ import jalview.gui.SequenceRenderer;
 import jalview.schemes.JalviewColourScheme;
 import jalview.structure.AtomSpecModel;
 import jalview.structure.StructureCommandI;
+import jalview.structure.StructureCommandsI.AtomSpecType;
 import jalview.structure.StructureMapping;
 import jalview.structure.StructureSelectionManager;
 
@@ -130,34 +131,34 @@ public class JmolCommandsTest
   public void testGetAtomSpec()
   {
     AtomSpecModel model = new AtomSpecModel();
-    assertEquals(testee.getAtomSpec(model, false), "");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "");
     model.addRange("1", 2, 4, "A");
-    assertEquals(testee.getAtomSpec(model, false), "2-4:A/1.1");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "2-4:A/1.1");
     model.addRange("1", 8, 8, "A");
-    assertEquals(testee.getAtomSpec(model, false), "2-4:A/1.1|8:A/1.1");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "2-4:A/1.1|8:A/1.1");
     model.addRange("1", 5, 7, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "2-4:A/1.1|8:A/1.1|5-7:B/1.1");
     model.addRange("1", 3, 5, "A");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "2-5:A/1.1|8:A/1.1|5-7:B/1.1");
     model.addRange("2", 1, 4, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "2-5:A/1.1|8:A/1.1|5-7:B/1.1|1-4:B/2.1");
     model.addRange("2", 5, 9, "C");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "2-5:A/1.1|8:A/1.1|5-7:B/1.1|1-4:B/2.1|5-9:C/2.1");
     model.addRange("1", 8, 10, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "2-5:A/1.1|8:A/1.1|5-10:B/1.1|1-4:B/2.1|5-9:C/2.1");
     model.addRange("1", 8, 9, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "2-5:A/1.1|8:A/1.1|5-10:B/1.1|1-4:B/2.1|5-9:C/2.1");
     model.addRange("2", 3, 10, "C"); // subsumes 5-9
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "2-5:A/1.1|8:A/1.1|5-10:B/1.1|1-4:B/2.1|3-10:C/2.1");
     model.addRange("5", 25, 35, " ");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "2-5:A/1.1|8:A/1.1|5-10:B/1.1|1-4:B/2.1|3-10:C/2.1|25-35:/5.1");
 
   }
@@ -199,7 +200,7 @@ public class JmolCommandsTest
     toAlign.addRange("2", 20, 21, "B");
     toAlign.addRange("2", 22, 22, "C");
     List command = testee.superposeStructures(ref,
-            toAlign, false); // doesn't matter for Jmol whether nuc or protein
+            toAlign, AtomSpecType.ALPHA); // doesn't matter for Jmol whether nuc or protein
     assertEquals(command.size(), 1);
     String refSpec = "12-14:A/1.1|18:B/1.1|22-23:B/1.1";
     String toAlignSpec = "15-17:B/2.1|20-21:B/2.1|22:C/2.1";
diff --git a/test/jalview/ext/pymol/PymolCommandsTest.java b/test/jalview/ext/pymol/PymolCommandsTest.java
index bc12542..7759724 100644
--- a/test/jalview/ext/pymol/PymolCommandsTest.java
+++ b/test/jalview/ext/pymol/PymolCommandsTest.java
@@ -36,6 +36,7 @@ import jalview.ext.rbvi.chimera.ChimeraCommands;
 import jalview.structure.AtomSpecModel;
 import jalview.structure.StructureCommand;
 import jalview.structure.StructureCommandI;
+import jalview.structure.StructureCommandsI.AtomSpecType;
 
 public class PymolCommandsTest
 {
@@ -80,32 +81,32 @@ public class PymolCommandsTest
   public void testGetAtomSpec()
   {
     AtomSpecModel model = new AtomSpecModel();
-    assertEquals(testee.getAtomSpec(model, false), "");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "");
     model.addRange("1", 2, 4, "A");
-    assertEquals(testee.getAtomSpec(model, false), "1//A/2-4/");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "1//A/2-4/");
     model.addRange("1", 8, 8, "A");
-    assertEquals(testee.getAtomSpec(model, false), "1//A/2-4+8/");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "1//A/2-4+8/");
     model.addRange("1", 5, 7, "B");
-    assertEquals(testee.getAtomSpec(model, false), "1//A/2-4+8/ 1//B/5-7/");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "1//A/2-4+8/ 1//B/5-7/");
     model.addRange("1", 3, 5, "A");
-    assertEquals(testee.getAtomSpec(model, false), "1//A/2-5+8/ 1//B/5-7/");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "1//A/2-5+8/ 1//B/5-7/");
     model.addRange("0", 1, 4, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "0//B/1-4/ 1//A/2-5+8/ 1//B/5-7/");
     model.addRange("0", 5, 9, "C");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "0//B/1-4/ 0//C/5-9/ 1//A/2-5+8/ 1//B/5-7/");
     model.addRange("1", 8, 10, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "0//B/1-4/ 0//C/5-9/ 1//A/2-5+8/ 1//B/5-10/");
     model.addRange("1", 8, 9, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "0//B/1-4/ 0//C/5-9/ 1//A/2-5+8/ 1//B/5-10/");
     model.addRange("0", 3, 10, "C"); // subsumes 5-9
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "0//B/1-4/ 0//C/3-10/ 1//A/2-5+8/ 1//B/5-10/");
     model.addRange("5", 25, 35, " ");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "0//B/1-4/ 0//C/3-10/ 1//A/2-5+8/ 1//B/5-10/ 5///25-35/");
 
   }
@@ -122,7 +123,7 @@ public class PymolCommandsTest
     toAlign.addRange("2", 20, 21, "B");
     toAlign.addRange("2", 22, 22, "C");
     List commands = testee.superposeStructures(ref,
-            toAlign, false);
+            toAlign, AtomSpecType.ALPHA);
     assertEquals(commands.size(), 2);
     String refSpecCA = "(1//A/12-14/CA 1//B/18+22-23/CA";
     String toAlignSpecCA = "(2//B/15-17+20-21/CA 2//C/22/CA";
@@ -141,34 +142,34 @@ public class PymolCommandsTest
   public void testGetAtomSpec_alphaOnly()
   {
     AtomSpecModel model = new AtomSpecModel();
-    assertEquals(testee.getAtomSpec(model, true), "");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA), "");
     model.addRange("1", 2, 4, "A");
-    assertEquals(testee.getAtomSpec(model, true), "1//A/2-4/CA");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA), "1//A/2-4/CA");
     model.addRange("1", 8, 8, "A");
-    assertEquals(testee.getAtomSpec(model, true), "1//A/2-4+8/CA");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA), "1//A/2-4+8/CA");
     model.addRange("1", 5, 7, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "1//A/2-4+8/CA 1//B/5-7/CA");
     model.addRange("1", 3, 5, "A");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "1//A/2-5+8/CA 1//B/5-7/CA");
     model.addRange("0", 1, 4, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "0//B/1-4/CA 1//A/2-5+8/CA 1//B/5-7/CA");
     model.addRange("0", 5, 9, "C");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "0//B/1-4/CA 0//C/5-9/CA 1//A/2-5+8/CA 1//B/5-7/CA");
     model.addRange("1", 8, 10, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "0//B/1-4/CA 0//C/5-9/CA 1//A/2-5+8/CA 1//B/5-10/CA");
     model.addRange("1", 8, 9, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "0//B/1-4/CA 0//C/5-9/CA 1//A/2-5+8/CA 1//B/5-10/CA");
     model.addRange("0", 3, 10, "C"); // subsumes 5-9
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "0//B/1-4/CA 0//C/3-10/CA 1//A/2-5+8/CA 1//B/5-10/CA");
     model.addRange("5", 25, 35, " ");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "0//B/1-4/CA 0//C/3-10/CA 1//A/2-5+8/CA 1//B/5-10/CA 5///25-35/CA");
   }
 
diff --git a/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java b/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java
index a5933d2..23e42ca 100644
--- a/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java
+++ b/test/jalview/ext/rbvi/chimera/ChimeraCommandsTest.java
@@ -35,6 +35,7 @@ import org.testng.annotations.Test;
 import jalview.structure.AtomSpecModel;
 import jalview.structure.StructureCommand;
 import jalview.structure.StructureCommandI;
+import jalview.structure.StructureCommandsI.AtomSpecType;
 
 public class ChimeraCommandsTest
 {
@@ -161,32 +162,32 @@ public class ChimeraCommandsTest
   public void testGetAtomSpec()
   {
     AtomSpecModel model = new AtomSpecModel();
-    assertEquals(testee.getAtomSpec(model, false), "");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "");
     model.addRange("1", 2, 4, "A");
-    assertEquals(testee.getAtomSpec(model, false), "#1:2-4.A");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "#1:2-4.A");
     model.addRange("1", 8, 8, "A");
-    assertEquals(testee.getAtomSpec(model, false), "#1:2-4.A,8.A");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "#1:2-4.A,8.A");
     model.addRange("1", 5, 7, "B");
-    assertEquals(testee.getAtomSpec(model, false), "#1:2-4.A,8.A,5-7.B");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "#1:2-4.A,8.A,5-7.B");
     model.addRange("1", 3, 5, "A");
-    assertEquals(testee.getAtomSpec(model, false), "#1:2-5.A,8.A,5-7.B");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "#1:2-5.A,8.A,5-7.B");
     model.addRange("0", 1, 4, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0:1-4.B|#1:2-5.A,8.A,5-7.B");
     model.addRange("0", 5, 9, "C");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0:1-4.B,5-9.C|#1:2-5.A,8.A,5-7.B");
     model.addRange("1", 8, 10, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0:1-4.B,5-9.C|#1:2-5.A,8.A,5-10.B");
     model.addRange("1", 8, 9, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0:1-4.B,5-9.C|#1:2-5.A,8.A,5-10.B");
     model.addRange("0", 3, 10, "C"); // subsumes 5-9
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0:1-4.B,3-10.C|#1:2-5.A,8.A,5-10.B");
     model.addRange("5", 25, 35, " ");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0:1-4.B,3-10.C|#1:2-5.A,8.A,5-10.B|#5:25-35.");
 
   }
@@ -203,7 +204,7 @@ public class ChimeraCommandsTest
     toAlign.addRange("2", 20, 21, "B");
     toAlign.addRange("2", 22, 22, "C");
     List command = testee.superposeStructures(ref,
-            toAlign, false);
+            toAlign, AtomSpecType.ALPHA);
     // qualifier to restrict match to CA and no altlocs
     String carbonAlphas = "@CA&~@.B-Z&~@.2-9";
     String refSpec = "#1:12-14.A,18.B,22-23.B";
@@ -218,36 +219,36 @@ public class ChimeraCommandsTest
   public void testGetAtomSpec_alphaOnly()
   {
     AtomSpecModel model = new AtomSpecModel();
-    assertEquals(testee.getAtomSpec(model, true), "");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA), "");
     model.addRange("1", 2, 4, "A");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#1:2-4.A@CA&~@.B-Z&~@.2-9");
     model.addRange("1", 8, 8, "A");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#1:2-4.A,8.A@CA&~@.B-Z&~@.2-9");
     model.addRange("1", 5, 7, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#1:2-4.A,8.A,5-7.B@CA&~@.B-Z&~@.2-9");
     model.addRange("1", 3, 5, "A");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#1:2-5.A,8.A,5-7.B@CA&~@.B-Z&~@.2-9");
     model.addRange("0", 1, 4, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0:1-4.B@CA&~@.B-Z&~@.2-9|#1:2-5.A,8.A,5-7.B@CA&~@.B-Z&~@.2-9");
     model.addRange("0", 5, 9, "C");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0:1-4.B,5-9.C@CA&~@.B-Z&~@.2-9|#1:2-5.A,8.A,5-7.B@CA&~@.B-Z&~@.2-9");
     model.addRange("1", 8, 10, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0:1-4.B,5-9.C@CA&~@.B-Z&~@.2-9|#1:2-5.A,8.A,5-10.B@CA&~@.B-Z&~@.2-9");
     model.addRange("1", 8, 9, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0:1-4.B,5-9.C@CA&~@.B-Z&~@.2-9|#1:2-5.A,8.A,5-10.B@CA&~@.B-Z&~@.2-9");
     model.addRange("0", 3, 10, "C"); // subsumes 5-9
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0:1-4.B,3-10.C@CA&~@.B-Z&~@.2-9|#1:2-5.A,8.A,5-10.B@CA&~@.B-Z&~@.2-9");
     model.addRange("5", 25, 35, " "); // empty chain code
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0:1-4.B,3-10.C@CA&~@.B-Z&~@.2-9|#1:2-5.A,8.A,5-10.B@CA&~@.B-Z&~@.2-9|#5:25-35.@CA&~@.B-Z&~@.2-9");
 
   }
diff --git a/test/jalview/ext/rbvi/chimera/ChimeraXCommandsTest.java b/test/jalview/ext/rbvi/chimera/ChimeraXCommandsTest.java
index 80bf042..143a5d8 100644
--- a/test/jalview/ext/rbvi/chimera/ChimeraXCommandsTest.java
+++ b/test/jalview/ext/rbvi/chimera/ChimeraXCommandsTest.java
@@ -35,6 +35,7 @@ import org.testng.annotations.Test;
 import jalview.structure.AtomSpecModel;
 import jalview.structure.StructureCommand;
 import jalview.structure.StructureCommandI;
+import jalview.structure.StructureCommandsI.AtomSpecType;
 
 public class ChimeraXCommandsTest
 {
@@ -187,7 +188,7 @@ public class ChimeraXCommandsTest
     toAlign.addRange("2", 20, 21, "B");
     toAlign.addRange("2", 22, 22, "C");
     List command = testee.superposeStructures(ref,
-            toAlign,false);
+            toAlign,AtomSpecType.ALPHA);
     assertEquals(command.size(), 1);
     String cmd = command.get(0).getCommand();
     String refSpec = "#1/A:12-14/B:18,22-23";
@@ -207,32 +208,33 @@ public class ChimeraXCommandsTest
   public void testGetAtomSpec()
   {
     AtomSpecModel model = new AtomSpecModel();
-    assertEquals(testee.getAtomSpec(model, false), "");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY
+            ), "");
     model.addRange("1", 2, 4, "A");
-    assertEquals(testee.getAtomSpec(model, false), "#1/A:2-4");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "#1/A:2-4");
     model.addRange("1", 8, 8, "A");
-    assertEquals(testee.getAtomSpec(model, false), "#1/A:2-4,8");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "#1/A:2-4,8");
     model.addRange("1", 5, 7, "B");
-    assertEquals(testee.getAtomSpec(model, false), "#1/A:2-4,8/B:5-7");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "#1/A:2-4,8/B:5-7");
     model.addRange("1", 3, 5, "A");
-    assertEquals(testee.getAtomSpec(model, false), "#1/A:2-5,8/B:5-7");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY), "#1/A:2-5,8/B:5-7");
     model.addRange("0", 1, 4, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0/B:1-4|#1/A:2-5,8/B:5-7");
     model.addRange("0", 5, 9, "C");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0/B:1-4/C:5-9|#1/A:2-5,8/B:5-7");
     model.addRange("1", 8, 10, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0/B:1-4/C:5-9|#1/A:2-5,8/B:5-10");
     model.addRange("1", 8, 9, "B");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0/B:1-4/C:5-9|#1/A:2-5,8/B:5-10");
     model.addRange("0", 3, 10, "C"); // subsumes 5-9
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0/B:1-4/C:3-10|#1/A:2-5,8/B:5-10");
     model.addRange("5", 25, 35, " ");
-    assertEquals(testee.getAtomSpec(model, false),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.RESIDUE_ONLY),
             "#0/B:1-4/C:3-10|#1/A:2-5,8/B:5-10|#5/:25-35");
   }
 
@@ -240,32 +242,32 @@ public class ChimeraXCommandsTest
   public void testGetAtomSpec_alphaOnly()
   {
     AtomSpecModel model = new AtomSpecModel();
-    assertEquals(testee.getAtomSpec(model, true), "");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA), "");
     model.addRange("1", 2, 4, "A");
-    assertEquals(testee.getAtomSpec(model, true), "#1/A:2-4@CA");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA), "#1/A:2-4@CA");
     model.addRange("1", 8, 8, "A");
-    assertEquals(testee.getAtomSpec(model, true), "#1/A:2-4,8@CA");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA), "#1/A:2-4,8@CA");
     model.addRange("1", 5, 7, "B");
-    assertEquals(testee.getAtomSpec(model, true), "#1/A:2-4,8/B:5-7@CA");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA), "#1/A:2-4,8/B:5-7@CA");
     model.addRange("1", 3, 5, "A");
-    assertEquals(testee.getAtomSpec(model, true), "#1/A:2-5,8/B:5-7@CA");
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA), "#1/A:2-5,8/B:5-7@CA");
     model.addRange("0", 1, 4, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0/B:1-4@CA|#1/A:2-5,8/B:5-7@CA");
     model.addRange("0", 5, 9, "C");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0/B:1-4/C:5-9@CA|#1/A:2-5,8/B:5-7@CA");
     model.addRange("1", 8, 10, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0/B:1-4/C:5-9@CA|#1/A:2-5,8/B:5-10@CA");
     model.addRange("1", 8, 9, "B");
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0/B:1-4/C:5-9@CA|#1/A:2-5,8/B:5-10@CA");
     model.addRange("0", 3, 10, "C"); // subsumes 5-9
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0/B:1-4/C:3-10@CA|#1/A:2-5,8/B:5-10@CA");
     model.addRange("5", 25, 35, " "); // empty chain code
-    assertEquals(testee.getAtomSpec(model, true),
+    assertEquals(testee.getAtomSpec(model, AtomSpecType.ALPHA),
             "#0/B:1-4/C:3-10@CA|#1/A:2-5,8/B:5-10@CA|#5/:25-35@CA");
   }
 
diff --git a/test/jalview/structures/models/AAStructureBindingModelTest.java b/test/jalview/structures/models/AAStructureBindingModelTest.java
index c1ad03a..5187167 100644
--- a/test/jalview/structures/models/AAStructureBindingModelTest.java
+++ b/test/jalview/structures/models/AAStructureBindingModelTest.java
@@ -57,6 +57,7 @@ import jalview.schemes.JalviewColourScheme;
 import jalview.structure.AtomSpec;
 import jalview.structure.AtomSpecModel;
 import jalview.structure.StructureCommandI;
+import jalview.structure.StructureCommandsI.AtomSpecType;
 import jalview.structure.StructureMapping;
 import jalview.structure.StructureSelectionManager;
 import junit.extensions.PA;
@@ -470,7 +471,7 @@ public class AAStructureBindingModelTest
     Color mColor = new Color(0x82827d);
     AtomSpecModel atomSpec = colours.get(mColor);
     assertNotNull(atomSpec);
-    assertEquals(helper.getAtomSpec(atomSpec, false), "#0:21.A|#1:21.B");
+    assertEquals(helper.getAtomSpec(atomSpec, AtomSpecType.RESIDUE_ONLY), "#0:21.A|#1:21.B");
 
     /*
      * H colour is #60609f, seq1.2 mapped to structure 0 residue 22
@@ -478,7 +479,7 @@ public class AAStructureBindingModelTest
     Color hColor = new Color(0x60609f);
     atomSpec = colours.get(hColor);
     assertNotNull(atomSpec);
-    assertEquals(helper.getAtomSpec(atomSpec, false), "#0:22.A");
+    assertEquals(helper.getAtomSpec(atomSpec, AtomSpecType.RESIDUE_ONLY), "#0:22.A");
 
     /*
      * V colour is #ffff00, seq2.2 mapped to structure 1 residue 22
@@ -486,7 +487,7 @@ public class AAStructureBindingModelTest
     Color vColor = new Color(0xffff00);
     atomSpec = colours.get(vColor);
     assertNotNull(atomSpec);
-    assertEquals(helper.getAtomSpec(atomSpec, false), "#1:22.B");
+    assertEquals(helper.getAtomSpec(atomSpec, AtomSpecType.RESIDUE_ONLY), "#1:22.B");
 
     /*
      * hidden columns are Gray (128, 128, 128)
@@ -495,7 +496,7 @@ public class AAStructureBindingModelTest
     Color gray = new Color(128, 128, 128);
     atomSpec = colours.get(gray);
     assertNotNull(atomSpec);
-    assertEquals(helper.getAtomSpec(atomSpec, false), "#0:23-25.A|#1:23-25.B");
+    assertEquals(helper.getAtomSpec(atomSpec, AtomSpecType.RESIDUE_ONLY), "#0:23-25.A|#1:23-25.B");
 
     /*
      * S and G are both coloured #4949b6, structure residues 26-30
@@ -503,7 +504,7 @@ public class AAStructureBindingModelTest
     Color sgColour = new Color(0x4949b6);
     atomSpec = colours.get(sgColour);
     assertNotNull(atomSpec);
-    assertEquals(helper.getAtomSpec(atomSpec, false),
+    assertEquals(helper.getAtomSpec(atomSpec, AtomSpecType.RESIDUE_ONLY),
             "#0:26-30.A|#1:26-30.B");
   }
 }
\ No newline at end of file
-- 
1.7.10.2