Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Integration Guide for LAMMPS Grid Format in ChimeraX
This guide explains how to integrate the LAMMPS
.grid
file format support into the ChimeraXmap_data
bundle.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 to Add
Create a new
grid
folder within themap_data
bundle with the following files:__init__.py
- Registers the format and provides the open/save functionsgrid.py
- Contains the actual implementation for reading/writing LAMMPS grid filestest_grid.py
- Unit tests for the implementationAdditionally, you need to register the format in the main formats registry.
Integration Steps
1. Create the grid folder
2. Add the implementation files
Copy the files from the provided code artifacts:
__init__.py
andgrid.py
from the main implementation artifacttest_grid.py
from the unit test artifact3. Register the format
Add the format entry to the formats dictionary in
src/bundles/map_data/src/formats.py
as shown in the register format artifact.4. Update the bundle's setup.py (if necessary)
Make sure the
grid
subdirectory is included in the package. This should happen automatically with most setup scripts, but check that the directory is included in any package lists.Testing
To test the implementation:
You can also run the unit tests directly.
Usage Examples
Opening a grid file
From the ChimeraX command line:
Converting grid to MRC format
After opening a grid file, save it as MRC:
Command-line processing
Process the grid file without opening the GUI:
Additional Notes
Troubleshooting
volume
command to adjust visualization parametersopen
command'smapMode
option