Changes between Version 24 and Version 25 of ChimeraAnimationState


Ignore:
Timestamp:
Feb 4, 2011, 4:43:21 PM (15 years ago)
Author:
Darren Weber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ChimeraAnimationState

    v24 v25  
    159159== Molecules ==
    160160
     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
     166chimera.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:
     173chimera.openModels.list(modelTypes=[chimera.Molecule])
     174
     175# Lastly, if the structure is selected, get a list of selected Molecules:
     176chimera.selection.currentMolecules()
     177# To get all selected atoms use:
     178chimera.selection.currentAtoms()
     179a = chimera.openModels.list(modelTypes=[chimera.Molecule])[0].atoms[0]
     180}}}
     181
     182
    161183Molecule 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.
    162184
     
    190212atomSelections = chimera.selection.currentAtoms()
    191213anAtom = chimera.openModels.list(modelTypes=[chimera.Molecule])[0].atoms[0]
     214
     215for 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
    192225}}}
    193226