Problem with select_atoms #4587
Unanswered
katieesconfused
asked this question in
Q&A
Replies: 1 comment
-
A few issues,
|
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.
-
Dear MDAnalysis team and Users,
I'm trying use MDAnalysis select_atoms function to dump out atom index, frame and positions of species at the Interface of a system.
Problem : the output is WRONG, and very specifically wrong.
This is my code:
import MDAnalysis as mda
import numpy as np
topo = "/scratch/anhnguyen99/g/s/si2/nvt/p10/ps.gro"
trjnj = "/scratch/anhnguyen99/g/s/si2/nvt/p10/2nd10ns/ps2nj.xtc"
unj = mda.Universe(topo, trjnj, format='xtc',topology_format="gro")
unj.trajectory[500]
linj = unj.select_atoms("name LI and (around 5 resname PE120)", periodic = False, updating= True)
print(linj.indices)
Result:
[44338 44355 44405 44436 44446]
For demonstration I'm slicing at frame 500 in the trajectory.
The trajectory is converted to remove box periodicity using gromacs gmx trjconv -pbc nojump,
This problem persist even when I use the original wrapped trajectory.
When I visualize all of species that got selected this way, this is the result, which is INCORRECT:

When I use GROMACS gmx select, I get these indices as results:
44339 44406 44420 44441 44443 44445 44447
and this is what it looks like, which is CORRECT, for my purpose:

The atoms that got selected by MDAnalysis , for some of them, the index is off by exactly 1
44338 instead of 44339
44405 instead of 44406
44446 instead of 44447
I already set period = False for geometric selection, and updating = True for dynamic selection in the trajectory.
MDAnalysis version I'm using is MDAnalysis 2.7.0.
Any help is greatly appreciated!! If you have some time to spare please help and take a look at this, I suspect there is a bug with the function select_atoms of MDAnalysis 2.7.0.
Thank you for your time, please let me know what other information I can provide to on this issue.
Anh.
Beta Was this translation helpful? Give feedback.
All reactions