MolPACD is the Molecular Pore Aperture Cap Designer. It designs, adds, analyzes, and removes molecular aperture caps in protein structures.
The first implementation is derived from the MemGen beta-barrel water-cap script, but generalizes the workflow for PDB and mmCIF structures with configurable axes, cap identity, and cap removal metadata.
From PyPI:
python -m pip install molpacdFrom a local checkout:
python -m pip install .For development:
python -m pip install -e ".[dev]"With Conda, keep the environment local to the checkout:
conda env create -p .conda/molpacd-dev -f environment-dev.yml
conda run -p .conda/molpacd-dev python -m nox -s lint format mypy tests-3.13 buildCommon development tasks are also available through make:
make env
make checkFor documentation work:
make docs-deps
make docs-serveAnalyze candidate apertures:
molpacd analyze input.pdb --jsonAdd caps to both apertures:
molpacd add input.pdb -o capped.pdbUse a membrane-oriented z-axis and a fixed cap residue name:
molpacd add input.pdb -o capped.pdb --axis z --resname DUMUse each aperture's inferred radius instead of sharing the larger radius:
molpacd add input.pdb -o capped.pdb --axis z --independent-radiusRemove MolPACD-generated caps:
molpacd remove capped.pdb -o decapped.pdbRemove matching caps from a file without MolPACD metadata:
molpacd remove capped.pdb -o decapped.pdb --resname DUM --chain Z --forceMolPACD writes cap provenance metadata and uses it during removal so matching
non-cap atoms are not removed accidentally. If metadata is absent, or if you
override metadata values such as residue name, chain, or atom name, removal
requires --force.
MolPACD reads PDB and mmCIF files and writes minimal PDB/mmCIF outputs focused on atom records plus MolPACD metadata. It preserves PDB header lines before the coordinate section, but it does not attempt to reproduce every original record or mmCIF category. Multi-model structures are not supported for analysis or cap addition; split those structures into single-model inputs before running MolPACD.
from pathlib import Path
from molpacd import CapOptions, add_caps, read_structure, write_structure
structure = read_structure(Path("input.pdb"))
capped, result = add_caps(structure, CapOptions(axis="z", resname="DUM"))
write_structure(capped, Path("capped.pdb"))
print(result.resname, result.added_count)python -m noxThe nox sessions run tests, linting, formatting checks, type checks, and package build validation. GitHub Actions runs the same checks on pushes and pull requests.
The project documentation is built with MkDocs:
make docs