Geometrical Transformations and their effects in written files
Dear all,
this is my first mail on the list, so what I am going to do is:
I) try what i am trying to achieve II) what classes/methods I use
Its fairly simple: I create a molecule and endow it with some structure using the provided PMI classes:
s = System() st = s.create_state() m = st.create_molecule(molecule.name ,sequence=molecule.get_sequence(),chain_id=molecule.chain_id)
for pdb_path,chain_id in molecule: struc = m.add_structure(pdb_path,chain_id,soft_check=True) m.add_representation(struc,resolutions=[0])
The "molecule" object is a convenience class that holds the necessary information. The other methods and objects are typical pmi elements. I create a clone, build the system and decorate the clone because I want to apply a transformation to it. I do that, afterwards i write the system to pdb:
c = m.create_clone(molecule.chain_id+"_C") s.build()
cx = IMP.core.XYZ(c.get_hierarchy()) IMP.core.transform(cx,g) IMP.atom.write_pdb(s.get_hierarchy(),"test_1.pdb")
g rotates the clone around some axis specified elsewhere. When I look at the file I would expect two molecule in different positions, yet they sit on top of each other. What am I missing?
Thanks in advance and all the best, Kai (Jans friend)
On 5/31/17 2:23 PM, Kai Karius wrote: > cx = IMP.core.XYZ(c.get_hierarchy()) > IMP.core.transform(cx,g) > IMP.atom.write_pdb(s.get_hierarchy(),"test_1.pdb") > > g rotates the clone around some axis specified elsewhere. When I look at > the file I would expect two molecule in different positions, yet they > sit on top of each other. What am I missing?
There are two transform functions:
IMP.core.transform() applies a transformation to an XYZ particle.
IMP.atom.transform() applies a transformation to a Hierarchy.
I'm pretty sure you want the second one, since it will move all atoms (or other geometric objects) in the hierarchy (which is what you want) rather than just the declared "center" of the top-level hierarchy particle.
Ben
participants (2)
-
Ben Webb
-
Kai Karius