Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum image convention not working for distances.distance_array #4774

Open
williambrown3 opened this issue Oct 29, 2024 · 1 comment
Open

Comments

@williambrown3
Copy link

williambrown3 commented Oct 29, 2024

I am using mda.analysis.distances.distance_array() to calculate all of the distances between alpha carbons of arginine residue with resid 2 in a cluster and the centroid of the cluster. After identifying the cluster and the coordinates of the centroid, the lines to calculate distances looks like this:

sel = univ.select_atoms(f'resnum 2 and resname ARG and name CA')
dists = distances.distance_array(centroid, sel.atoms.positions, univ.dimensions)

No errors occur and the calculation seems to go smoothly. However, I am getting distances as large as ~89 angstroms in a box with dimensions: [92.57094, 92.57094, 92.57094]. I am under the impression that by passing "univ.dimensions", periodic boundary conditions are supposed to be accounted for through minimum image convention, but there aren't any situations where the clusters in my trajectories should have that large of radii, let alone distances from the centroid. I am just curious if there is a way to assure that periodic boundary conditions will be accounted for.

Thank you

@orbeckst
Copy link
Member

I'd generally agree with you, I'd expect that the min-image distance between any two coordinates inside the box should always be less than half the longest box diagonal. Can you provide a file or the set of coordinates together with code that shows that the distances are too large?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants