Hi,
I've continued to investigate and have gotten even more confused. This
script:
from numpy import *
import sys
cmd.delete("all")
cmd.load( "../4lzt_quasi.pdb", "full")
cmd.create("anew", "full", 1, 1)
print "First 3 shifts: ", nm[0:3], "\n"
cmd.alter_state(1,"anew" , "x,y,z = x+nm[(ID-1)*3],
y+nm[(ID-1)*3+1], z+nm[(ID-1)*3+2]")
xyz1=[]
cmd.iterate_state(1, 'full & id 5', 'xyz1.append([x,y,z])')
xyz2=[]
cmd.iterate_state(1, 'anew & id 1', 'xyz2.append([x,y,z])')
print "Coords of full id 5:", array(xyz1)
print "Coords of anew id 1:", array(xyz2)
print "Shift between full id5 and anew id1:",
array(xyz1)-array(xyz2), "\n"
xyz1=[]
cmd.iterate_state(1, 'full & resid 1 & name ca ',
'xyz1.append([x,y,z])')
xyz2=[]
cmd.iterate_state(1, 'anew & resid 1 & name ca ',
'xyz2.append([x,y,z])')
print "Coords of full resid1 name ca: ", array(xyz1)
print "Coords of full resid1 name ca: ", array(xyz2)
print "Shift between full id5 and anew id1: ", array(xyz1)-array(xyz2)
print "\n"
yields:
PyMOL>run pymoltest1.py
First 3 shifts: [-0.1263 0.0152 -0.0444]
Coords of full id 5: [[ 2.539 5.619 12.706]]
Coords of anew id 1: [[ 2.4127 5.6342 12.6616]]
Shift between full id5 and anew id1: [[ 0.1263 -0.0152 0.0444]]
Coords of full resid1 name ca: [[ 2.539 5.619 12.706]]
Coords of full resid1 name ca: [[ 2.4127 5.6342 12.6616]]
Shift between full id5 and anew id1: [[ 0.1263 -0.0152 0.0444]]
What I see from this is:
- the first set of shifts is applied to the CA atom which is the
fifth atom in the original pdb file and somehow becomes the second atom
in the object created with cmd.create
- the object created by cmd.create has atom id's spanning from 0 to
N-1 (original object had atom ids from 1 to N)
I would like to know what is happening but, more importantly, what is
the best way to apply the shifts vector "nm" to the atoms in the
original object where the shifts in "nm" are according to the order in
the pdb file.
Thanks!
Pawel
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net