making a plane through the atoms of a ring and Distance measurements

Dear Chimera team, I would like to make a plane through the atoms of an aromatic ring and then measure a distance from an atom to the ring centroid. I would also like to measure the angle between the normal to the ring plane and the line joining the centroid and the atom I am measuring from. It would also be nice if I could specify the dimensions, color, and transparency of the plane. In addition it would be great to be able to make multiple planes through atoms, select and color them separately, and measure the angles at the intersection of the planes. Just wondering if there is a way to do this with Chimera. Thanks in advance, Dave ********************************************** David M. Chenoweth California Institute of Technology Division of Chemistry and Chemical Engineering Mail Code: 164-30 1200 California Boulevard, 91125 Pasadena California, USA Phone: 626-395-6074 Email: dchen@caltech.edu **********************************************

On Mon, 2 Jun 2008, David Chenoweth wrote:
Dear Chimera team,
I would like to make a plane through the atoms of an aromatic ring and then measure a distance from an atom to the ring centroid. I would also like to measure the angle between the normal to the ring plane and the line joining the centroid and the atom I am measuring from. It would also be nice if I could specify the dimensions, color, and transparency of the plane. In addition it would be great to be able to make multiple planes through atoms, select and color them separately, and measure the angles at the intersection of the planes. Just wondering if there is a way to do this with Chimera.
Thanks in advance, Dave
This sort of thing currently requires writing Python code. For example, if you selected a ring by hand, the following code computes the plane. The plane's origin is the centroid of the atoms: from chimera import selection, Plane atoms = selection.currentAtoms() plane = Plane([a.coord() for a in atoms]) To calculate the plane equation, chimera uses Newell's method, so points should be given in ring order, but the ring doesn't have to be convex. If you computed a least-squared fit plane, the answer would be slightly different. To measure the angle between two planes, just calculate the angle between their normals (arccos of the (normalized) dot product). To visualize the results, I'd recommend creating a SurfaceModel from the _surface module. Since much of chimera is implemented in Python, "example" code that uses chimera Planes and SurfaceModels can be found the Python modules in the CHIMERA/share directory. Specifically, the NucleicAcids and GraspSurface modules. To get started programming chimera with Python, please look at the tutorials in the Chimera Programmer's Guide, <http://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html>. And if you have any programming questions, please ask them on the chimera developer's mailing list, chimera-dev@cgl.ucsf.edu. Good luck, Greg Couch UCSF Computer Graphics Lab

Hi Dave, We want to make measurements of axes, centroids, and planes possible, and as the first step of that we have been working on axes. So planes/centroids will be coming, but I can't really guarantee when (there's still plenty of work left for axes!). So as Greg says, measuring planes/centroids has to be done using Python for now. Now, the fact that the Chimera Plane constructor requires the points in "ring order" (for now) is kind of a major PITA, so my suggestion is to do a singular value decomposition and take as the plane normal the cross product of the two largest eigenvectors. This is actually really easy. If you look at the axis() function of StructureMeasure/ __init__.py, it finds the centroid and does an SVD on a set of coordinates. The single largest eigenvector is the "axis" of those coordinates. You would use numpy.argsort to find the two eigenvectors with the largest eigenvalues, and numpy.cross to get the cross product. Some useful numpy docs are here: http://www.scipy.org/ Numpy_Example_List_With_Doc . The other thing to know is that to get a bunch of atoms (say from chimera.selection.currentAtoms()) into an Nx3 numpy array, you use the function chimera.numpyArrayFromAtoms. With the centroid and the normal, you would construct a chimera.Point and chimera.Vector. Then there is a chimera.Plane constructor that takes a Point and a Vector. There are a bunch of methods of Point, Vector, and Plane for measuring distances and angles, etc. You can see documentation for them by typing e.g. help (chimera.Vector) in the IDLE tool. So for instance, the distance from an atom to the centroid is atom.coord().distance(centroid). Some measurements, such as angle(), are only available as functions in the chimera module (so help(chimera) to see them). So the angle atom-centroid-normal is: chimera.angle(atom.coord() - centroid, normal) [the subtraction of two Points produced a Vector]. To show planes, you might want to construct BILD files/strings and open those: http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/bild.html --Eric Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu On Jun 2, 2008, at 9:02 PM, David Chenoweth wrote:
Dear Chimera team,
I would like to make a plane through the atoms of an aromatic ring and then measure a distance from an atom to the ring centroid. I would also like to measure the angle between the normal to the ring plane and the line joining the centroid and the atom I am measuring from. It would also be nice if I could specify the dimensions, color, and transparency of the plane. In addition it would be great to be able to make multiple planes through atoms, select and color them separately, and measure the angles at the intersection of the planes. Just wondering if there is a way to do this with Chimera.
Thanks in advance, Dave
********************************************** David M. Chenoweth California Institute of Technology Division of Chemistry and Chemical Engineering Mail Code: 164-30 1200 California Boulevard, 91125 Pasadena California, USA
Phone: 626-395-6074 Email: dchen@caltech.edu **********************************************
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (3)
-
David Chenoweth
-
Eric Pettersen
-
Greg Couch