Replies: 1 comment
-
No, it's not center of mass distance. distance_array(A, B) operates on raw coordinates, namely it just calculates the "all-vs-all" distances of all coordinates A from all coordinates B. You should first calculate the COMs and then use distance_array on the COMs water = u.select_atoms("resname SOL and not name MW") # exclude mass-less particles in TIP4P
protein = u.select_atoms("protein")
for ts in u.trajectory:
w_com = water.center_of_mass(compound="residues", unwrap=True)
protein_residues_com = protein.center_of_mass(compound="residues", unwrap=True)
# produces arrays of shape (n_residues, 3) with the COM (correct under PBC) for each residue
assert w_com.shape == (water.n_residues, 3)
assert protein_residues_com.shape == (protein.n_residues, 3)
# calc distances (under PBC with minimum image)
dists = distance_array(protein_residues_com, w_com, box=ts.dimensions) Calculating the centers of mass with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone!
Just a quick question, couldn't find the answer in the manual. If I'm to compute the distance between two molecules, for example:
Is this distance between the centers of mass of the two molecules? Or am I completely misusing the tool? Lol
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions