1 package jalview.structure;
8 * Methods that generate commands that can be sent to a molecular structure
9 * viewer program (e.g. Jmol, Chimera, ChimeraX)
14 public interface StructureCommandsI
17 * Returns the command to colour by chain
21 StructureCommandI colourByChain();
24 * Returns the command to colour residues using a charge-based scheme:
26 * <li>Aspartic acid and Glutamic acid (negative charge) red</li>
27 * <li>Lysine and Arginine (positive charge) blue</li>
28 * <li>Cysteine - yellow</li>
29 * <li>all others - white</li>
34 List<StructureCommandI> colourByCharge();
37 * Returns the command to colour residues with the colours provided in the
38 * map, one per three letter residue code
43 List<StructureCommandI> colourByResidues(Map<String, Color> colours);
46 * Returns the command to set the background colour of the structure viewer
51 StructureCommandI setBackgroundColour(Color col);
54 * Returns commands to colour mapped residues of structures according to
55 * Jalview's colouring (including feature colouring if applied). Parameter is
56 * a map from Color to a model of all residues assigned that colour.
62 List<StructureCommandI> colourBySequence(
63 Map<Object, AtomSpecModel> colourMap);
66 * Returns a command to centre the display in the structure viewer
70 StructureCommandI focusView();
73 * Returns a command to superpose structures by closest positioning of
74 * residues in {@code atomSpec} to the corresponding residues in
75 * {@code refAtoms}. If wanted, this may include commands to visually
76 * highlight the residues that were used for the superposition.
82 List<StructureCommandI> superposeStructures(AtomSpecModel refAtoms,
83 AtomSpecModel atomSpec);
86 * Returns a command to open a file of commands at the given path
91 StructureCommandI openCommandFile(String path);
94 * Returns a command to save the current viewer session state to the given
100 StructureCommandI saveSession(String filepath);
103 * Returns a representation of the atom set represented by the model, in
104 * viewer syntax format. If {@code alphaOnly} is true, this is restricted to
105 * Alpha Carbon (peptide) or Phosphorous (rna) only
111 String getAtomSpec(AtomSpecModel model, boolean alphaOnly);
114 * Returns command(s) to show only the backbone of the peptide (cartoons in
115 * Jmol, chain in Chimera)
119 List<StructureCommandI> showBackbone();
122 * Returns a command to open a file at the given path
127 // refactor if needed to distinguish loading data or session files
128 StructureCommandI loadFile(String file);
131 * Returns commands to set atom attributes or properties, given a map of
132 * Jalview features as {featureType, {featureValue, AtomSpecModel}}. The
133 * assumption is that one command can be constructed for each feature type and
134 * value combination, to apply it to one or more residues.
136 * @param featureValues
139 List<StructureCommandI> setAttributes(
140 Map<String, Map<Object, AtomSpecModel>> featureValues);
143 * Returns command to open a saved structure viewer session file, or null if
149 StructureCommandI openSession(String filepath);
152 * Returns a command to show structures in the viewer. If {@code restrictTo}
153 * is null, all structures are included, otherwise the display is restricted
154 * to positions represented in the model
159 StructureCommandI showStructures(AtomSpecModel restrictTo);
162 * Returns a command to hide the specified model chain in the structure viewer
168 StructureCommandI hideChain(String modelId, String chainId);
171 * Returns a command to hide everything in the structure viewer
175 StructureCommandI hideAll();