Dear MDAnalysis users,
I am trying to calculate the distance between the centre of mass of two residues over the trajectory.
import numpy as np
import MDAnalysis as mda
from MDAnalysis.analysis import distances
u = mda.Universe("mol.top", "
traj.nc"
res_te = u.select_atoms('resid 28')
res_tt = u.select_atoms('resid 32')
sel_te = res_te.center_of_mass(compound=('residues'))
sel_tt = res_tt.center_of_mass(compound=('residues'))
n_te = len(sel_te)
n_te = len(sel_te)
dist = distances.distance_array(n_te, n_tt,
box = u.dimensions)
However this gives me a single distance instead of the distance for each frame.
Is anyone able to help please?
Thank you,
Juliette