JAL-4026 always wait 50ms before checking if the calculation worker is still running...
[jalview.git] / src / jalview / structures / models / AAStructureBindingModel.java
index 336c6f8..44d698d 100644 (file)
@@ -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;
@@ -69,9 +70,9 @@ import jalview.util.MessageManager;
 
 /**
  * 
- * A base class to hold common function for 3D structure model binding.
- * Initial version created by refactoring JMol and Chimera binding models, but
- * other structure viewers could in principle be accommodated in future.
+ * A base class to hold common function for 3D structure model binding. Initial
+ * version created by refactoring JMol and Chimera binding models, but other
+ * structure viewers could in principle be accommodated in future.
  * 
  * @author gmcarstairs
  *
@@ -590,7 +591,6 @@ public abstract class AAStructureBindingModel
       }
     }
   }
-  
 
   @Override
   public abstract void highlightAtoms(List<AtomSpec> atoms);
@@ -924,8 +924,10 @@ 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,12 +937,13 @@ public abstract class AAStructureBindingModel
         {
           AtomSpecModel atomSpec = getAtomSpec(structures[i], matched);
           List<StructureCommandI> commands = commandGenerator
-                  .superposeStructures(refAtoms, atomSpec,isNucleotide);
+                  .superposeStructures(refAtoms, atomSpec, backbone);
           List<String> replies = executeCommands(commands, true, null);
           for (String reply : replies)
           {
             // return this error (Chimera only) to the user
-            if (reply.toLowerCase(Locale.ROOT).contains("unequal numbers of atoms"))
+            if (reply.toLowerCase(Locale.ROOT)
+                    .contains("unequal numbers of atoms"))
             {
               error += "; " + reply;
             }