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

add function to write trajectory with fixed box size #2

Open
orbeckst opened this issue Dec 16, 2024 · 0 comments · May be fixed by #3
Open

add function to write trajectory with fixed box size #2

orbeckst opened this issue Dec 16, 2024 · 0 comments · May be fixed by #3
Assignees

Comments

@orbeckst
Copy link
Member

Is your feature request related to a problem?

Writing the universe with all conformers with

u.atoms.write("output.trr", frames="all")

creates a trajectory without a box. This may be a problem for re-evaluating energies in GROMACS with cutoffs as this needs periodic boundary conditions.

The box can be added afterwards with a MDAnalysis on the fly transformation (set box dimensions

box = np.array([15, 15, 15, 90, 90, 90])
u.add_transformation(mda.transformations.boxdimensions.set_dimensions(box))
u.atoms.write("boxed.trr")

(or setting the box dimensions in a loop while writing a new trajectory) but

  1. We don't always know the right box dimensions (maybe the molecules is too big?)
  2. It's tedious...

Describe the solution you'd like

Add a function molconfgen.output.write_pbc_trajectory(u, filename, box=None) that

  1. takes a universe with conformers u
  2. filename: trajectory filename
  3. optional box argument
    • None: no box (no PBC)
    • "auto": find a "good" box (define what that means ...)
    • float: cubic box with length box (and fail if box size is not safe)
    • [A, B, C, alpha, beta, gamma]: regular box description (and fail if not safe)

Describe alternatives you've considered

Do it manually ...

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

Successfully merging a pull request may close this issue.

2 participants