JAL-1741 nucleotide-aware colour schemes applied to structures
[jalview.git] / src / jalview / ext / rbvi / chimera / JalviewChimeraBinding.java
index 543cad4..b649a64 100644 (file)
@@ -1018,23 +1018,16 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel
       return;
     }
 
-    int index;
-    Color col;
     // Chimera expects RBG values in the range 0-1
     final double normalise = 255D;
     viewerCommandHistory(false);
-    // TODO: Switch between nucleotide or aa selection expressions
     StringBuilder command = new StringBuilder(128);
-    command.append("color white;");
-    for (String res : ResidueProperties.aa3Hash.keySet())
-    {
-      index = ResidueProperties.aa3Hash.get(res).intValue();
-      if (index > 20)
-      {
-        continue;
-      }
 
-      col = cs.findColour(ResidueProperties.aa[index].charAt(0));
+    List<String> residueSet = ResidueProperties.getResidues(isNucleotide(),
+            false);
+    for (String res : residueSet)
+    {
+      Color col = cs.findColour(res.charAt(0));
       command.append("color " + col.getRed() / normalise + ","
               + col.getGreen() / normalise + "," + col.getBlue()
               / normalise + " ::" + res + ";");