1 package jalview.structure;
3 import jalview.api.AlignmentViewPanel;
4 import jalview.datamodel.SequenceI;
11 * Methods that generate commands that can be sent to a molecular structure
12 * viewer program (e.g. Jmol, Chimera, ChimeraX)
17 public interface StructureCommandsI
20 * Returns the command to colour by chain
24 StructureCommandI colourByChain();
27 * Returns the command to colour residues using a charge-based scheme:
29 * <li>Aspartic acid and Glutamic acid (negative charge) red</li>
30 * <li>Lysine and Arginine (positive charge) blue</li>
31 * <li>Cysteine - yellow</li>
32 * <li>all others - white</li>
37 List<StructureCommandI> colourByCharge();
40 * Returns the command to colour residues with the colours provided in the
41 * map, one per three letter residue code
46 List<StructureCommandI> colourByResidues(Map<String, Color> colours);
49 * Returns the command to set the background colour of the structure viewer
54 StructureCommandI setBackgroundColour(Color col);
57 * Returns commands to colour mapped residues of structures according to
58 * Jalview's colouring (including feature colouring if applied). Parameter is
59 * a map from Color to a model of all residues assigned that colour.
65 List<StructureCommandI> colourBySequence(
66 Map<Object, AtomSpecModel> colourMap);
69 * Returns a command to centre the display in the structure viewer
73 StructureCommandI focusView();
76 * Returns a command to show only the selected chains. The items in the input
77 * list should be formatted as "modelid:chainid".
82 List<StructureCommandI> showChains(List<String> toShow);
85 * Returns zero, one or more commands to set attributes on mapped residues in
86 * the structure viewer for any features present and displayed in Jalview
94 List<StructureCommandI> setAttributesForFeatures(
95 StructureSelectionManager ssm,
96 String[] files, SequenceI[][] sequence, AlignmentViewPanel avp);
99 * Returns a command to superpose structures by closest positioning of
100 * residues in {@code atomSpec} to the corresponding residues in {@ refAtoms}.
101 * If wanted, this may include commands to visually highlight the residues
102 * that were used for the superposition.
108 List<StructureCommandI> superposeStructures(AtomSpecModel refAtoms,
109 AtomSpecModel atomSpec);
112 * Returns a command to open a file of commands at the given path
117 StructureCommandI openCommandFile(String path);
120 * Returns a command to save the current viewer session state to the given
126 StructureCommandI saveSession(String filepath);
129 * Returns a representation of the atom set represented by the model, in
130 * viewer syntax format. If {@code alphaOnly} is true, this is restricted to
131 * Alpha Carbon (peptide) or Phosphorous (rna) only
137 String getAtomSpec(AtomSpecModel model, boolean alphaOnly);
140 * Returns the lowest model number used by the structure viewer (likely 0 or
145 // TODO remove by refactoring so command generation is purely driven by
146 // AtomSpecModel objects derived in the binding classes?
147 int getModelStartNo();
150 * Returns command(s) to show only the backbone of the peptide (cartoons in
151 * Jmol, chain in Chimera)
155 List<StructureCommandI> showBackbone();
158 * Returns a command to open a file at the given path
163 // refactor if needed to distinguish loading data or session files
164 StructureCommandI loadFile(String file);