structopt is a Python package and CLI to quickly clean and optimize protein structures from
predicted or experimental sources (.pdb, .cif, .mmcif).
It combines:
PDBFixerfor structure cleanup.- OpenMM minimization (implicit solvent by default).
- Optional short MD refinement.
- Optional GAFF small-molecule handling (for ligands like
LIG1).
Install from PyPI:
pip install structoptIf you want ligand/GAFF support, also install openmmforcefields in the same environment.
Depending on your platform, it may be easier to use the provided mamba environment for that setup.
Sync the project environment with uv:
uv syncTo include dev tools:
uv sync --group devFor GAFF ligand support from source, install openmmforcefields, rdkit, and AmberTools
in the active environment. If your package index cannot resolve those, use mamba:
mamba env create -f environment.mamba.yml
mamba activate structopt
pip install -e .Run the command below to see all the possible options you can have for your optimisation
uv run structopt optimize --helpExample:
uv run structopt optimize tests/data/geraniol_model_0.cifUseful options:
uv run structopt optimize tests/data/geraniol_model_0.cif \
--mode both \
--ph 7.2 \
--ligand-name LIG1 \
--npt-steps 50000 \
--temperature 300 \
--pressure 1.0If GAFF ligand parametrization cannot be inferred from the structure alone, provide an SDF:
uv run structopt optimize tests/data/geraniol_model_0.cif \
--ligand-name LIG1 \
--ligand-sdf path/to/ligand.sdf- Default cleanup adds hydrogens at pH
7.2. - Minimization uses explicit by default or possibly implicit solvent (
gbn2orobc2). - MD refinement uses short explicit-solvent NPT by default.
- For GAFF workflows, install AmberTools in your environment.