8000 add LAMMPS .grid3d import by alphataubio · Pull Request #181 · RBVI/ChimeraX · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add LAMMPS .grid3d import #181

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

Open
wants to merge 32 commits into
base: develop
Choose a base branch
from

Conversation

alphataubio
Copy link
@alphataubio alphataubio commented May 4, 2025

Overview

LAMMPS (Large-scale Atomic/Molecular Massively Parallel Simulator) can output grid data using the dump grid command. This implementation allows ChimeraX to read and visualize these grid files, similar to how it handles MRC map files.

Files

  • bundles/map_data/src/lammps/__init__.py
  • bundles/map_data/src/lammps/lammps_format.py
  • bundles/map_data/src/lammps/lammps_grid.py
  • bundles/md_crds/src/read_lammps.py

Testing

  • bundles/map_data/tests/data/nitrite.grid3d minimal example
  • bundles/map_data/tests/test_map_data.py added test_lammps_grid3d()

Usage Example

From the ChimeraX command line:

open path/to/simulation.grid3d

Additional Notes

  • The implementation handles multiple data columns in the grid file, creating a separate volume for each column
  • It also supports files with multiple timesteps, naming each volume accordingly
  • Grid indices in LAMMPS files are typically 0-based, which matches ChimeraX's internal representation

@alphataubio alphataubio changed the title add LAMMPS .grid(.gz) import add LAMMPS .grid import May 16, 2025
@alphataubio alphataubio changed the title add LAMMPS .grid import add LAMMPS .grid3d import May 16, 2025
@alphataubio alphataubio marked this pull request as ready for review May 16, 2025 22:13
@alphataubio
Copy link
Author

@tomgoddard ready for review and merge, no rush

@tomgoddard
Copy link
Collaborator

I would need LAMMPS grid data to test this.

I'm also wondering what the hundreds of lines of changes to md_crds/src/read_lammps.py were for. Is that change related to reading grids?

@alphataubio
Copy link
Author

I would need LAMMPS grid data to test this.

i put nitrite.grid3d in map_data/tests/data when i added grid3d to test_map_data.py but it was ignored because of this line in .gitignore

# Test data that gets fetched from Plato
src/bundles/*/tests/data

so i just edited .gitignore without committing on my local machine to commit/push nitrite.grid3d. you should see it now.

I'm also wondering what the hundreds of lines of changes to md_crds/src/read_lammps.py were for. Is that change related to reading grids?

its indirectly related. at the same time, i refactored my lammps data and dump reading code to be flexible to various number and ordering of columns so that i could use it to read a molecule into chimerax together with its esp grid. new refactored version is a lot more resilient to most cases with additional error checking.

@tomgoddard
Copy link
Collaborator

Thanks for providing the nitrite.grid3d example data. I displayed it in ChimeraX using your pull request code. It look like just spherical shells centered at the 0,0,0 corner of the map. Is that what it is supposed to look like? Also all values are negative in this map. Is that typical of the LAMMPs maps you expect? If so ChimeraX won't display them in a useful way because it caps the surface at the map box faces as if the data outside the map is 0. To avoid that for maps where negative values are the norm the reader should turn off map box cap display for the map.

I would need to see some realistic LAMMPS example data before I would merge this pull request in ChimeraX.

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 this pull request may close these issues.

2 participants
0