p-j-smith / lipyphilic

A Python toolkit for the analyis of lipid membrane simulations
https://lipyphilic.readthedocs.io/en/latest/
Other
29 stars 12 forks source link

[BUG]nojump fails with concatenated trajectories #113

Closed lianxiliang closed 1 year ago

lianxiliang commented 1 year ago

Hello,

Thanks a lot for the code, it has been more than helpful.

After I use MDAnalysis to load two trajectory files simultaneously, I add the lattice parameters using u.dimensions. However, when I use nojump, the code seems to allocate the lattice parameters to the first trajectory only, not the second part. I got the following error: ValueError: No dimensions information in Universe. Either use the 'box' argument or set the '.dimensions' attribute The code fails at 20% of the job. The length of the trajectories is 2ns and 8ns respectively.

Here is the code I use, it has been working well with a single trajectory :

u = mda.Universe(traj1, traj2, all_coordinates = True, dt = 1)

u.dimensions = [30.6191, 30.6191, 30.6191, 90, 90, 90]

u.trajectory.add_transformations(nojump(ag=u.select_atoms('bynum 1'), 
                                                nojump_x=True,
                                                nojump_y=True,
                                                nojump_z=True))

Thanks a lot in advance.

p-j-smith commented 1 year ago

H @lianxiliang, I'm happy to hear lipyphilic has been useful for you!

Thanks for raising the issue, and sorry for the delay in getting back to you. There are a few issues with this transformation, and I think now that there is an implementation in MDAnalysis I will remove the one in lipyphilic and recommend people to use MDAnalysis.transformations.NoJump.

Let me know if you have any more issues 🙂