From 0bf5504738156fee1d500a2914a9e8b779d6eb70 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 12 Dec 2016 12:20:44 +0000 Subject: [PATCH] JAL-2632 corrected lookup of residue colour --- src/jalview/ext/jmol/JalviewJmolBinding.java | 8 +++++--- src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 2d2d10e..38ce476 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -1300,10 +1300,12 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel command.append("select *;color white;"); List residueSet = ResidueProperties.getResidues(isNucleotide(), false); - for (String res : residueSet) + for (String resName : residueSet) { - Color col = cs.findColour(res.charAt(0)); - command.append("select " + res + ";color[" + col.getRed() + "," + char res = resName.length() == 3 ? ResidueProperties + .getSingleCharacterCode(resName) : resName.charAt(0); + Color col = cs.findColour(res); + command.append("select " + resName + ";color[" + col.getRed() + "," + col.getGreen() + "," + col.getBlue() + "];"); } diff --git a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java index 262b8a2..8354410 100644 --- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java +++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java @@ -992,12 +992,14 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel List residueSet = ResidueProperties.getResidues(isNucleotide(), false); - for (String res : residueSet) + for (String resName : residueSet) { - Color col = cs.findColour(res.charAt(0)); + char res = resName.length() == 3 ? ResidueProperties + .getSingleCharacterCode(resName) : resName.charAt(0); + Color col = cs.findColour(res); command.append("color " + col.getRed() / normalise + "," + col.getGreen() / normalise + "," + col.getBlue() - / normalise + " ::" + res + ";"); + / normalise + " ::" + resName + ";"); } sendAsynchronousCommand(command.toString(), COLOURING_CHIMERA); -- 1.7.10.2