Unable to compute RDF for .gsd files #5222
-
|
Hi All, I'm using MDAnalysis 2.10.0 and try to get RDFs from a .gsd trajectories. The code is as below: However it gets the problems:
I think the software can successfully read .gsd because when I directly analyze u.trajectory in other occasions everything is fine. But I don't know if my code is wrong or there's some internal problems with rdf. I also attached my trajectory in this post. 2_B50_try7.gsd.zipI would really appreciate your advice. Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
|
I am not sure if you're loading your universe correctly u = mda.Universe("2_B50_try7.gsd","2_B50_try7.gsd")GSD files contain both topology and trajectory, so it makes some sense that you're loading the universe this way. Could you try if just Can you iterate over your trajectory, e.g., c = u.select_atoms("name C")
for ts in u.trajectory[:10]:
print(ts.frame, ts.time, c.center_of_geometry())Can you randomly access a frame print(u.trajectory)
ts = u.trajectory[0]
print(ts.frame, ts.time)
ts = u.trajectory[-3]
print(ts.frame, ts.time) |
Beta Was this translation helpful? Give feedback.
-
|
The bug #5224 was fixed in PR #5260 . If you install the latest development version then it should work for you. |
Beta Was this translation helpful? Give feedback.

@Lynn3512138 I am sorry, until #5224 is fixed you might have to use an older version of MDAnalysis (try 2.9.0 – I am guessing that the issue was introduced with adding parallelization to RDF).
Or convert your gsd to another topology and trajectory file, e.g., TRR (should always work) or H5MD (which is fancier and faster but may require additional installed packages):
and then use