| Version 1 (modified by , 15 years ago) ( diff ) |
|---|
Resources
- Programmer's Guide (http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/)
- Example scripts (http://plato.cgl.ucsf.edu/trac/chimera/wiki/Scripts)
- IDLE (Tools > General Controls): help(object), dir(object)
- Chimera developer mailing list (http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev)
- Source code:
- subversion browser (http://plato.cgl.ucsf.edu/trac/chimera/browser)
- download (http://www.cgl.ucsf.edu/chimera/sourcecode.html)
- C++ headers are available in distributions (see $CHIMERA/include)
- Python source code is included with distributions (see $CHIMERA/share)
- Python documentation (http://docs.python.org/)
- Numpy examples (http://www.scipy.org/Numpy_Example_List_With_Doc)
Chimera Molecular Data
# a list of open models models = chimera.openModels.list() # restrict list to Molecules molecules = chimera.openModels.list(modelTypes=[chimera.Molecule]) # a Molecule's residues, atoms, or bonds if len(molecules): r = molecules[0].residues a = molecules[0].atoms b = molecules[0].bonds
Residues
- type: LYS, HEM, etc.
- id.position / id.chainId / id.insertionCode: number / chain ID / insertion code
- molecule: parent Molecule
- atoms: list of atoms
- atomsMap: dict of {atom-name: [list of atoms]}
- isHelix / isStrand: in helix / strand
Atoms
- name: name
- coord() / xformCoord(): untransformed / transformed coordinates
- residue / molecule: parent Residue / Molecule
- bonds: list of bonds
- neighbors: list of bonded atoms
- primaryBonds() / primaryNeighbors(): same as above but only primary altlocs
- bondsMap: dict of {bonded-atom: bond}
- color: Color
- display: True if shown
- drawMode: one of chimera.Atom.X with X being Dot, Sphere, EndCap, or Ball
- element: chemical element (type chimera.Element, settable with string or number)
- label: label shown in graphics window
- radius: VdW radius
Bonds
- atoms: 2-tuple of atoms
- otherAtom(a): [a is one of the bond's atoms] other atom in bond
- drawMode: one of chimera.Bond.X with X being Wire or Stick
- label: label shown in graphics window
- molecule: parent Molecule
- length(): length
Molecular Measurements
chimera module functions use Points, which are returned by Atom's coord() or xformCoord() methods
- distance / sqdistance
- also: a1.coord().[sq]distance(a2.coord()) [similar for xformCoord]
- angle (in degrees)
- dihedral (in degrees)
Molecular Editing
Look in $CHIMERA/share/BuildStructure/__init__.py for examples of creating new molecules and residues.
Using the chimera.molEdit module:
- addAtom
- if adding in bulk, make sure to specify optional serialNumber keyword
- addBond
- addDihedralAtom -- add atom given a bond length / angle / dihedral
Setting or Querying Selections
Using the chimera.selection module:
- currentAtoms / currentBonds / currentResidues / currentMolecules: currently selected Atoms / Bonds / Residues / Molecules
- setCurrent: set current selection to given items
- addCurrent / addImpliedCurrent: add given items to current selection
- the "implied" version also selects endpoint Atoms of added Bonds and connecting Bonds of added Atoms
- removeCurrent: remove items from current selection, if present
Miscellaneous
- chimera.runCommand: execute any command-line command (arg is a string)
- direct Python equivalent usually in Midas module
- chimera.colorTable module:
- getColorByName: get a Color by name
- OpenSave module:
- osOpen: open a file or HTTP URL, with or without compression
- chimera.extension module
- manager.instances: running dialogs listed at end of Tools menu
Note:
See TracWiki
for help on using the wiki.
![[Chimera Issue Tracking System]](/trac/chimera/chrome/site/chimera_logo.png)