-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Nah--

> Is there an equivalent of geomanal/distance_plot.inp in the pyXplor interface
> ?
> 
> specifically, for the statement :
> pick bond
> (byresidue ( id $id1)) (byresidue ( id $id2)) geometry
> evaluate ($distance=$result)
> 
> which is said to calculate the distance between mass-weighted centroids of
> the residues. (seems very concise)
> 

for a single pair of residues, try:

from atomAction import centerOfMass
from vec3 import norm
print norm(centerOfMass("resid 42") - centerOfMass("resid 56"))

for a range of resids:

from atomAction import centerOfMass
from vec3 import norm
for i in [1,2,4]:
  for j in [5,6,7]:
    cm1=centerOfMass("resid %d"%i)
    cm2=centerOfMass("resid %d"%j)
    print i,j,norm(cm1-cm2)


best regards--
Charles
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>

iD8DBQFIKb+OPK2zrJwS/lYRAuePAJ0VvqGD5rG2i0B92FEy7ET4DD3kAgCeI8SK
fMkioWEG1sR7s+kI+T4azvo=
=K14N
-----END PGP SIGNATURE-----

Reply via email to