Changes between Version 24 and Version 25 of ChimeraAnimationState
- Timestamp:
- Feb 4, 2011, 4:43:21 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ChimeraAnimationState
v24 v25 159 159 == Molecules == 160 160 161 {{{ 162 #!python 163 # Locating the Molecule object depends a bit on what your script does. 164 # If your script opened the PDB file itself with: 165 166 chimera.openModels.open("/home/eortega/data.pdb") 167 168 # The return value of that is a list of Molecule objects (it's a list 169 # because some kinds of files cause multiple Molecules to be 170 # created [e.g. NMR ensembles]). 171 172 # Similarly to get a list of all currently open Molecule objects: 173 chimera.openModels.list(modelTypes=[chimera.Molecule]) 174 175 # Lastly, if the structure is selected, get a list of selected Molecules: 176 chimera.selection.currentMolecules() 177 # To get all selected atoms use: 178 chimera.selection.currentAtoms() 179 a = chimera.openModels.list(modelTypes=[chimera.Molecule])[0].atoms[0] 180 }}} 181 182 161 183 Molecule models have some global attributes, like {{{display}}} and {{{color}}}, that can alter their appearance. Note that color properties will propagate into all elements of a molecule model (residues, atoms, bonds) that do not have any specific 'component' settings. Whenever a component (residue, atom, bond) has it's own color properties, they override the global molecule color properties. 162 184 … … 190 212 atomSelections = chimera.selection.currentAtoms() 191 213 anAtom = chimera.openModels.list(modelTypes=[chimera.Molecule])[0].atoms[0] 214 215 for atom in model.atoms: 216 if atom.color is not None: 217 atom.color.rgba() 218 atom.display 219 atom.drawMode 220 if atom.label is not None: 221 atom.label 222 atom.surfaceDisplay 223 atom.surfaceColor 224 atom.surfaceOpacity 192 225 }}} 193 226
![[Chimera Issue Tracking System]](/trac/chimera/chrome/site/chimera_logo.png)