Metadata-Version: 2.4
Name: structopt
Version: 0.2.0
Summary: CLI tools for quick protein structure cleanup and optimization with OpenMM.
Author: StructOpt Contributors
License: MIT
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: numpy>=1.26.0
Requires-Dist: openmm>=8.1.1
Requires-Dist: pdbfixer>=1.10
Requires-Dist: pydantic>=2.9.0
Requires-Dist: rdkit>=2023.9.5
Requires-Dist: typer>=0.12.5
Description-Content-Type: text/markdown

# StructOpt

`structopt` is a Python package and CLI to quickly clean and optimize protein structures from
predicted or experimental sources (`.pdb`, `.cif`, `.mmcif`).

It combines:
- `PDBFixer` for structure cleanup.
- OpenMM minimization (implicit solvent by default).
- Optional short MD refinement.
- Optional GAFF small-molecule handling (for ligands like `LIG1`).

## Install

Install from PyPI:

```bash
pip install structopt
```

If 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.

## Install From Source

Sync the project environment with `uv`:

```bash
uv sync
```

To include dev tools:

```bash
uv sync --group dev
```

For GAFF ligand support from source, install `openmmforcefields`, `rdkit`, and AmberTools
in the active environment. If your package index cannot resolve those, use mamba:

```bash
mamba env create -f environment.mamba.yml
mamba activate structopt
pip install -e .
```

## CLI

Run the command below to see all the possible options you can have for your optimisation
```bash
uv run structopt optimize --help
```


Example:
```bash
uv run structopt optimize tests/data/geraniol_model_0.cif
```

Useful options:

```bash
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.0
```

If GAFF ligand parametrization cannot be inferred from the structure alone, provide an SDF:

```bash
uv run structopt optimize tests/data/geraniol_model_0.cif \
  --ligand-name LIG1 \
  --ligand-sdf path/to/ligand.sdf
```

## Notes

- Default cleanup adds hydrogens at pH `7.2`.
- Minimization uses explicit by default or possibly implicit solvent (`gbn2` or `obc2`).
- MD refinement uses short explicit-solvent NPT by default.
- For GAFF workflows, install AmberTools in your environment.
