import jalview.datamodel.ColumnSelection;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
+import jalview.httpserver.AbstractRequestHandler;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ResidueProperties;
import jalview.structure.AtomSpec;
public abstract class JalviewChimeraBinding extends AAStructureBindingModel
{
+ // Chimera clause to exclude alternate locations in atom selection
+ private static final String NO_ALTLOCS = "&~@.B-Z&~@.2-9";
private static final boolean debug = false;
/*
* Object which listens to Chimera notifications
*/
- private ChimeraListener chimeraListener;
+ private AbstractRequestHandler chimeraListener;
/*
* set if chimera state is being restored from some source - instructs binding
cmd.setLength(cmd.length() - 4);
}
String cmdstring = cmd.toString();
- evalStateCommand("~display #*; ~ribbon #*; ribbon " + cmdstring
- + ";focus " + cmdstring, false);
+ evalStateCommand("~display #*; ~ribbon #*; ribbon " + cmdstring, false);
}
/**
// TODO: handle sub-models
command.append(selcom[pdbfnum]);
command.append("@" + atomSpec[pdbfnum]);
+ // JAL-1757 exclude alternative CA locations
+ command.append(NO_ALTLOCS);
command.append(" #" + refStructure /* +".1" */);
command.append(selcom[refStructure]);
command.append("@" + atomSpec[refStructure]);
+ command.append(NO_ALTLOCS);
}
if (selectioncom.length() > 0)
{
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 + ";");