Amber-MD / pytraj

Python interface of cpptraj
https://amber-md.github.io/pytraj
170 stars 38 forks source link

Align two molecules within one frame? #1503

Closed khoroshyy closed 4 years ago

khoroshyy commented 4 years ago

Hi. I have two protein units in one frame. Can I align them? Thanks. Petro

hainm commented 4 years ago

May be something like below?

import pytraj as pt
stock_traj  = pt.load('your.pdb')
traj = pt.load('your.pdb')
ref = pt.load('your.pdb')
pt.rmsd(traj, ref=ref, mask='your 2nd unit', ref_mask='your 1st unit')
# Now taking the coordinates of your 1st unit from `stock_traj` and update them in `traj.xyz`? 
khoroshyy commented 4 years ago

Thanks I will give it a try...

khoroshyy commented 4 years ago

Works like a charm, just one more question. After realignment, of two structures in nglview widget bonds are formed between close atoms of two different structures. Any way to avoid it? Thanks.

khoroshyy commented 4 years ago

Problem with bonds was solved by adding each molecule as a separate trajectory.