[chimera-dev] Buildstructure and xform coordinates

Dr. Jean-Didier Maréchal jeandidier.marechal at uab.cat
Fri Dec 19 07:14:19 PST 2008

Dear all,

Based on early queries, I am now using xform coord for most of my scripts.
However, now I have a problem because I have mixture between xforms and

For example, I want to place a helium at the center of mass of the molecular
and having previously calculated it using xform coordinates... The center of
mass is therefore located at another part of the space.

How could I transform on set of coords to the other? 

Thanks for any help!

Here is the script

from chimera import selection
from chimera import Point, Vector, Xform
import BuildStructure

def com(sub):
    for i in range(len(sub.atoms)):
        center = Vector(0, 0, 0)
        for a in sub.atoms:
            sumi += a.element.mass
            center += a.element.mass * Vector(*a.xformCoord().data())
    return center_point

def placing_points(center):
    #print pt
    BuildStructure.placeHelium('com', model='scratch', position=center)

ligand = selection.currentResidues()[0]

More information about the Chimera-dev mailing list