= 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 [http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html Programmer's Guide] (specifically [http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/basicPrimer.html 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. * [attachment:pblengths.py pblengths.py]. Print lengths of selected pseudobonds. Tested with Chimera 1.11.2. October 16, 2017. * [attachment:removecross.py removecross.py]. Remove longer pseudobonds that cross shorter pseudobonds. Tested with Chimera 1.11.2. October 12, 2017. * [attachment:segment.py segment.py]. Run segger to segment map. Tested with Chimera 1.11.2. October 6, 2017. * [attachment:dividelinks.py dividelinks.py]. Divide marker set links by inserting N additional markers. Tested with Chimera 1.11.2. May 26, 2017. * [attachment:save.py save.py]. Save a pdb fit to a map to files. Tested with Chimera 1.11.2. April 20, 2017. * [attachment:copymol.py copymol.py]. Copy a molecule and change atom coordinates. Tested with Chimera 1.11.2. April 7, 2017. * [attachment:volmin.py volmin.py]. Compute map minimum value without reading full map in memory. Tested with Chimera 1.11. February 16, 2017. * [attachment:savemarkers.py savemarkers.py]. Adds savemarkers command to save markers in a *.cmm file. Tested with Chimera 1.11. January 30, 2017. * [attachment:avalnogui.py avalnogui.py]. Report density map values at atom positions. Tested with Chimera 1.11. January 18, 2017. * [attachment:angles.py angles.py]. Measure angles between axes of two models in 2d planes. Tested with Chimera 1.11. October 10, 2016. * [attachment:triangles.py triangles.py]. Access surface vertices and triangles for density maps. Tested with Chimera 1.11. September 7, 2016. * [attachment:syncregion.py syncregion.py]. Synchronize displayed regions of density maps. Tested with Chimera 1.11. August 23, 2016. * [attachment:surfval.py surfval.py]. Output text file of electrostatic values at surface points. Tested with Chimera 1.10.2. July 5, 2016. * [attachment:lineplot.py lineplot.py]. Make 2D plot of density map values along the view direction line. Tested with Chimera 1.10.2. May 19, 2016. * [attachment:edgeband.py edgeband.py]. Show band at edge of surface zone. Tested with Chimera 1.10.2. April 7, 2016. * [attachment:maxdist.py maxdist.py]. Compute maximum pairwise atom distance for selected atoms. Tested with Chimera 1.10.2. March 4, 2016. * [attachment:capcalc.py capcalc.py]. Compute triangulation of part of plane inside a close surface. Tested with Chimera 1.10.2. February 17, 2016. * [attachment:findIncomplete.py findIncomplete.py]. Select standard amino acid residues with missing heavy atoms. Not intended for nucleic acids. Tested with Chimera 1.10.2 January 2016 although written years earlier. * [attachment:surfinvert.py surfinvert.py]. Invert which part of surface is shown. Used with hide dust to show only the dust for masking. Tested with Chimera 1.10.2. December 8, 2015. * [attachment:cube.py cube.py]. Extend density map to a cube. Tested with Chimera 1.10.2. December 7, 2015. * [attachment:pp.py pp.py]. pipes and planks command. Tested with Chimera 1.10.2. October 9, 2015. * [attachment:helixtube.py helixtube.py]. htube command to show helices as tubes. Tested with Chimera 1.10.1. August 12, 2015. * [attachment:printfit.py printfit.py]. Print fit search results to log. Tested with Chimera 1.10.1. August 11, 2015. * [attachment:placeimod.py placeimod.py]. Place map copies using IMOD createAlignedModel output. Tested with Chimera 1.10.1. May 18, 2015. * [attachment:flat.py flat.py]. Fit a plane to atoms/markers and report distances. Tested with Chimera 1.10.1. May 8, 2015. * [attachment:midfocal.py midfocal.py]. Keep focal plane midway between near/far clip planes for stereo viewing. Tested with Chimera 1.10. April 21, 2015. * [attachment:showoutline.py showoutline.py]. Show molecule unit cell outline box. Tested with Chimera 1.10. January 28, 2015. * [attachment:atomdist.py atomdist.py]. Find minimum distance between two sets of atoms. Tested with Chimera 1.10. November 17, 2014. * [attachment:blend.py blend.py]. Blend 2 or more solid style maps. Tested with Chimera 1.9. April 29, 2014. * [attachment:insightgrid.py insightgrid.py]. Read Insight II grid file produced by rdock docking program. Tested with Chimera 1.9. Feb 26, 2014. * [attachment:changeaxes.py changeaxes.py]. Move atoms to use specified axes. Tested with Chimera 1.9. Feb 25, 2014. * [attachment:curvature.py curvature.py]. Color a surface by mean curvature. Tested with Chimera 1.9. Jan 29, 2014. * [attachment:filament.py filament.py]. Copy molecules along a smooth path to make a filament. Tested with Chimera 1.9. Jan 3, 2014. * [attachment:red_area.py red_area.py]. Adds redarea command that computes fraction of surface area more red than blue. Tested with Chimera 1.8. Dec 4, 2013. * [attachment:colordist.py colordist.py]. Color lines between atoms based on a distance cutoff. Tested with Chimera 1.9. Oct 29, 2013. * [attachment:microtubule.py microtubule.py]. Make a geometric model of a [http://www.cgl.ucsf.edu/chimera/data/microtubule_aug2013/bent_mt.html bent microtubule]. Tested with Chimera 1.8. August 2, 2013. * [attachment:fitsearch.py fitsearch.py]. Print fit search results without gui. Tested with Chimera 1.7. May 21, 2013. * [attachment:RadialDensity.zip RadialDensity.zip]. Print average map density versus radius. Tested with Chimera 1.8 daily build. April 15, 2013. * [attachment:compress.py compress.py]. Put a density map time series in one file with compression. Tested with Chimera 1.8 daily build. Feb 28, 2013. * [attachment:mapsum.py mapsum.py]. Report average density over spheres centered on atoms. Tested with Chimera 1.8 daily build. Feb 19, 2013. * [attachment:distances.py distances.py]. Report distances between all pairs of selected markers. Tested with Chimera 1.8 daily build. Feb 19, 2013. * [attachment:savemaskedmaps.py savemaskedmaps.py]. Save masked maps overwriting original map files. Tested with Chimera 1.8 daily build. Jan 31, 2013. * [attachment:fov.py fov.py]. Keyboard shortcuts f+ and f- to change field of view angle. Also mouse mode to change field of view by dragging. Tested with Chimera 1.7 daily build. Dec 20, 2012. * [attachment:rotatoms.py rotatoms.py]. Rotate atoms about a line. Tested with Chimera 1.7 daily build. June 7, 2012. * [attachment:tilemap.py tilemap.py]. Tile a map to avoid OpenGL texture rendering size limits with solid style. Tested with Chimera 1.7 daily build. June 7, 2012. * [attachment:eulermove.py eulermove.py]. Rotate a map by specified Euler angles. Tested with Chimera 1.7 daily build. April 24, 2012. * [attachment:vclip.py vclip.py]. Show the intersection and union of two maps. Tested with Chimera 1.7 daily build. April 22, 2012. * [attachment:volumecenter.py volumecenter.py]. Place marker at center of mass of map. Tested with Chimera 1.6 daily build. November 14, 2011. * [attachment:marksurface.py marksurface.py]. Place markers at each vertex of selected surfaces. Tested with Chimera 1.6 daily build. October 14, 2011. * [attachment:czone.py czone.py]. Color a surface to match nearby selected atoms. Tested with Chimera 1.6 daily build. March 7, 2011. * [attachment:readvol.py readvol.py]. Open volume data file, find size, xyz coordinates, data values. Tested with Chimera 1.6 daily build. Feb 16, 2011. * [attachment:surfvalues.py 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. * [attachment:placem.py placem.py]. Place maps or molecules with specified positions and orientations. Tested with Chimera 1.6 daily build. Feb 8, 2011. * [attachment:makesurf.py makesurf.py]. Stitch marker chains to make a surface. Tested with Chimera 1.6 daily build. Dec 7, 2010. * [attachment:flatimage.py 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. * [attachment:camerapositions.py 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. * [attachment:capmask.py 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. * [wiki:Scripts/MMTK Using Chimera with MMTK]. Tested with Chimera 1.5 daily build. July 8, 2010. * [attachment:edgesum.py edgesum.py]. Add values at edge of volume data. Tested with Chimera 1.4. June 21, 2010. * [attachment:saveunitcell.py saveunitcell.py]. Save unit cell symmetry copies of a molecule. Tested with Chimera 1.4. April 26, 2010. * [attachment:placeatom.py placeatom.py]. Place a new atom near an existing atom. Tested with Chimera 1.4. April 23, 2010. * [attachment:square.py square.py]. Square density map values. Tested with Chimera 1.4. April 13, 2010. * [attachment:capcolor.py capcolor.py]. Set surface cap color. Tested with Chimera 1.4. March 5, 2010. * [attachment:angle.py 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. * [attachment:surfvol.py 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. * [attachment:closeatoms.py closeatoms.py]. Draw lines between close pairs of selected atoms. Tested with Chimera 1.4. January 14, 2010. * [attachment:markeruse.py markeruse.py]. Place markers (spheres) and connect them. Tested with Chimera 1.5 daily build November 24, 2009. * [attachment:surfsilhouette.py surfsilhouette.py]. Creates silhouette images of surfaces. Tested with Chimera 1.4 daily build September 2, 2009. * [attachment:lightsout.py lightsout.py]. Turns off surface lighting for flat shading. Tested with Chimera 1.4 daily build August 11, 2009. * [attachment:xyzsdmap.py 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. * [attachment:xyzmap.py 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. * [attachment:pqr2chimera.py pqr2chimera.py]. Split a PQR file into a PDB file that Chimera can read (chimera.pdb) and a [http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/defattr.html 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. * [attachment:surfvert.py 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. * [attachment:markhidden.py 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. * [attachment:interpolate.py interpolate.py]. Interpolate volume data set values at specific points. Tested with Chimera 1.4 daily build July 17, 2009. * [attachment:place.py place.py]. Place copies of a model at specified positions and orientations. Tested with Chimera 1.4 daily build July 10, 2009. * [attachment:fitnogui.py fitnogui.py]. Fit one map in another and print rotation/translation. Tested with Chimera 1.4 daily build May 18, 2009. * [attachment:quality.py quality.py]. Set the subdivision quality. Gives smooth appearance to molecule models. Tested with Chimera 1.3. * [attachment:aniso.py 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.] * [attachment:match.py 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. * [attachment:esp.py esp.py]. Coulombic-ly color all open molecular surfaces. Tested with Chimera 1.4 daily build September 1, 2009 using PDB 3fx2. * [attachment:selLys.py 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. * [attachment:disulphide.py 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. * [attachment:dipole.py dipole.py]. Print dipole moment to the reply log and show dipole vector of all open molecular models. The models must already have charges assigned. Tested with Chimera 1.10.2 on November 25th, 2015. * [attachment:torspace.py 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. * [attachment:smoothMD.py smoothMD.py]. Rewrite a trajectory with averaged coordinates using nearby frames to produce smoother-looking motions. Usage described in [http://plato.cgl.ucsf.edu/pipermail/chimera-users/2008-April/002496.html this chimera-users message]. Tested with Chimera 1.6 on September 20th, 2011. * [attachment:radius-of-gyration.py radius-of-gyration-mass.py]. Print center of mass and mass-weighted radius of gyration from that center in the Reply Log. Tested with Chimera 1.11.2 on April 10th, 2017. * [attachment:radius-of-gyration.py radius-of-gyration-nomass.py]. Print center of mass and radius of gyration (not mass weighted) from that center in the Reply Log. Tested with Chimera 1.11.2 on April 10th, 2017. * [attachment:orient.py orient.py]. Rotate every open structure so that the major axis is parallel to the Y axis and the secondary axis is parallel to the X axis. Tested with Chimera 1.7 on March 15th, 2012. * [attachment:varbond.py varbond.py]. Show bond formation during a trajectory. Usage described in [http://plato.cgl.ucsf.edu/pipermail/chimera-users/2014-April/009759.html this chimera-users message]. Tested with Chimera 1.9 on April 7th, 2014. * [attachment:getcolors.py getcolors.py]. Print out "modelcolor" commands equivalents for the current colors of open molecular models. Tested with Chimera 1.11 on September 6, 2016. * [attachment:worm.py worm.py]. Create a "worms" depiction based on mavConservation attribute. Script easily edited to use different attribute and different worm widths. Tested with Chimera 1.11.2 on July 13, 2017.