Re: [AMBER] Working with pytraj

From: Hai Nguyen <nhai.qn.gmail.com>
Date: Mon, 16 May 2016 15:28:05 -0400

Hi,

your syntax is not correct. (I admit that introducing `top=...` option will
mislead user). You only need to specify `top=` if `traj` does not have
Topology info.

Back to you example, should be

For example: c_o_G for first residue

# use all atoms in residue 1

# or
# use given atoms in residue 1

code: https://gist.github.com/hainm/be068c1d9dcfdcfefc54dcce0aa57a76

So if you want to compute c_o_G for 500 residues, you need to write a loop
to repeat calculation for each residue.

Note: If your trajectory is not big and fit well to memory, you can you
iterating.

Let me know if I understand your Q correctly.

Hai

On Mon, May 16, 2016 at 3:05 PM, MOHD HOMAIDUR RAHMAN <rahmanhpu.gmail.com>
wrote:

> Dear AmberTools developers
>
> In my MD simulations I have five member ring and now I want to calculate
> (1) No of residue within given cut-off distance (Geometrical center)
> between two residues.
> (2) Angle between two normal vectors (Geometrical center) of the five
> member ring
>
> For that, I used pytraj and able to print geometrical center of residue and
> the normal vector to the plane.
> But I am unable to generate over residue. I have total 512 no of residue in
> my system, so the output should be
> ndarray (total frame , total residue).
>
> import pytraj as pt
> ring_atoms=traj.top['.C1, @N6, @C2, @C4, @N7']
> c_o_G=pt.center_of_geometry(traj,top=ring_atoms)
> ring_plane_all=pt.vector.corrplane(traj, top=ring_atoms)
>
> Please guide us how to proceed furthers