wiki:Scripts

Version 52 (modified by pett, 14 years ago) ( diff )

--

Chimera Python Scripts

If all you want to do is loop through a set of data files in a folder and perform a series of Chimera commands on them, the Programmer's Guide (specifically this page ) covers that scenario in detail.

These Python scripts provide capabilities not available using Chimera commands. They may only work with specific Chimera versions.

  • volumecenter.py. Place marker at center of mass of map. Tested with Chimera 1.6 daily build. November 14, 2011.
  • marksurface.py. Place markers at each vertex of selected surfaces. Tested with Chimera 1.6 daily build. October 14, 2011.
  • czone.py. Color a surface to match nearby selected atoms. Tested with Chimera 1.6 daily build. March 7, 2011.
  • readvol.py. Open volume data file, find size, xyz coordinates, data values. Tested with Chimera 1.6 daily build. Feb 16, 2011.
  • surfvalues.py. Report electrostatic potential values on a surface that are being shown with the Surface Color dialog at a point the mouse is over. Values are shown in the status line and updated as the mouse is moved. Tested with Chimera 1.6 daily build. Feb 10, 2011.
  • placem.py. Place maps or molecules with specified positions and orientations. Tested with Chimera 1.6 daily build. Feb 8, 2011.
  • makesurf.py. Stitch marker chains to make a surface. Tested with Chimera 1.6 daily build. Dec 7, 2010.
  • flatimage.py. Create flattened icosahedron virus images for making paper models for VIPERdb database. Tested with Chimera 1.6 daily build. Nov 11, 2010. Should work with Chimera 1.4.
  • camerapositions.py. Report camera location and field of view for each position saved with the savepos command. Tested with Chimera 1.5 daily build. July 27, 2010. Should work with Chimera 1.4.
  • capmask.py. Mask out a cylindrical shell from a density map. This is used for removing the capillary from x-ray tomography reconstructions. Tested with Chimera 1.5 daily build. July 19, 2010.
  • Using Chimera with MMTK. Tested with Chimera 1.5 daily build. July 8, 2010.
  • edgesum.py. Add values at edge of volume data. Tested with Chimera 1.4. June 21, 2010.
  • saveunitcell.py. Save unit cell symmetry copies of a molecule. Tested with Chimera 1.4. April 26, 2010.
  • placeatom.py. Place a new atom near an existing atom. Tested with Chimera 1.4. April 23, 2010.
  • square.py. Square density map values. Tested with Chimera 1.4. April 13, 2010.
  • capcolor.py. Set surface cap color. Tested with Chimera 1.4. March 5, 2010.
  • angle.py. Report angle between two axes where each axis is specified by a pair of atoms, for example, axes produced by the "measure rotation" command. Tested with Chimera 1.4. Feb 9, 2010.
  • surfvol.py. Report enclosed volumes of each connected piece of a surface, and delete all but the largest piece. Tested with Chimera 1.5. January 24, 2010.
  • closeatoms.py. Draw lines between close pairs of selected atoms. Tested with Chimera 1.4. January 14, 2010.
  • markeruse.py. Place markers (spheres) and connect them. Tested with Chimera 1.5 daily build November 24, 2009.
  • surfsilhouette.py. Creates silhouette images of surfaces. Tested with Chimera 1.4 daily build September 2, 2009.
  • lightsout.py. Turns off surface lighting for flat shading. Tested with Chimera 1.4 daily build August 11, 2009.
  • xyzsdmap.py. Makes a volume data set from a text file of xyz points with standard deviations along each axis. Each point is represented as a Gaussian. Tested with Chimera 1.4 daily build August 3, 2009.
  • xyzmap.py. Makes a volume data set from a text file of xyz points. Each point is represented as a Gaussian. Tested with Chimera 1.4 daily build August 3, 2009.
  • pqr2chimera.py. Split a PQR file into a PDB file that Chimera can read (chimera.pdb) and a defattr file (chimera.defattr) for assigning the PQR charge attributes if preferred to Chimera charges. Script should be run using Python from a shell rather than inside Chimera. The defattr may be processed slowly by Chimera due to using "@/serialNumber" selector -- script could be probably be speeded up by moving to ":res@atom" style selectors. Tested with Chimera 1.4 daily build August 3, 2009.
  • surfvert.py. Writes a text file containing the coordinates of molecular surface vertices and the associated residues. Tested with Chimera 1.4 daily build July 26, 2009.
  • markhidden.py. Places markers at hidden surface vertices. Used to place markers at centers of hexagons and pentagons of icosahedral lattices made by hkcage command for coloring virus maps. Tested with Chimera 1.4 daily build July 17, 2009.
  • interpolate.py. Interpolate volume data set values at specific points. Tested with Chimera 1.4 daily build July 17, 2009.
  • place.py. Place copies of a model at specified positions and orientations. Tested with Chimera 1.4 daily build July 10, 2009.
  • fitnogui.py. Fit one map in another and print rotation/translation. Tested with Chimera 1.4 daily build May 18, 2009.
  • quality.py. Set the subdivision quality. Gives smooth appearance to molecule models. Tested with Chimera 1.3.
  • aniso.py. Anisotropic b-factors shown as ellipsoids for selected atoms using PDB ANISOU records. Tested with Chimera 1.4 daily build July 14, 2009 using PDB 1xy1. [Thermal ellipsoids now available via "aniso" command and Thermal Ellipsoids tool.]
  • match.py. Match chain A of two open molecules and report RMSD and atom pairings to Reply Log. Tested with Chimera 1.3 using PDBs 3fx2 and 1gcn.
  • esp.py. Coulombic-ly color all open molecular surfaces. Tested with Chimera 1.4 daily build September 1, 2009 using PDB 3fx2.
  • selLys.py. Select lysine NZ atoms within 8 angstroms of another lysine NZ and put distance monitors between them. Difficult to do with normal selection language because of no way to exclude the base atoms of a zone selection from the zone test. Tested with Chimera 1.4 daily build September 21, 2009 using PDB 1www.
  • disulphide.py. Create disulphide bonds between unprotonated CYS SG atoms that are not already disulphide bonded and that meet reasonable bond-distance criteria. Tested with Chimera 1.4 daily build November 11, 2009 using PDB 1gc1.
  • dipole.py. Print dipole moment of all open molecular models to the reply log. The models must already have charges assigned. Tested with Chimera 1.4 on February 8th, 2010.
  • torspace.py. Drive a torsion angle through 360 degrees and make a volume data set from the atom positions. Tested with Chimera 1.5 on May 12th, 2010. Could be improved by checking for clashes and by having occupancy vary based on VDW radius. Written by Miguel Ortiz-Lombardia.
  • smoothMD.py. Rewrite a trajectory with averaged coordinates using nearby frames to produce smoother-looking motions. Usage described in this chimera-users message. Tested with Chimera 1.6 on September 20th, 2011.
  • radius-of-gyration.py. Print center of mass and mass-weighted radius of gyration from that center in the Reply Log. Tested with Chimera 1.7 on February 15th, 2012.

Attachments (99)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.