How openmm/pdbfixer works
Project type and purpose
• PDBFixer is a Python-based utility for preparing PDB (Protein Data Bank) files for molecular simulation.
• It provides both a command-line interface (CLI) and a browser-based UI (via a lightweight Python HTTP server).
• It bundles core “fixer” functionality (adding atoms, building loops, deleting chains, etc.), templates, tests, packaging scripts, and CI tooling.
Main architectural components
a. User Interfaces
– CLI front end (pdbfixer/cli entry points in setup.py, ui.py)
– Browser UI served by uiserver.py + HTML templates (pdbfixer/html & templates)
b. Core Engine
– pdbfixer/pdbfixer.py: the Python library implementing all “fixer” operations
– soft.xml forcefield data
– pdb templates under pdbfixer/templates
c. Data Layer
– Input PDB files (user-supplied or test fixtures)
– Output PDB files
d. Packaging & Distribution
– setup.py / setup.cfg
– devtools/conda-recipe (meta.yaml, build.sh)
– environment-dev.yaml for dev environment
e. Continuous Integration & Deployment
– GitHub Actions workflow (.github/workflows/CI.yml)
– Travis CI config (.travis.yml, devtools/travis-ci scripts)
– docs publication (push-docs-to-s3.py)
Relationships & data flow
• User invokes either:
– CLI: pdbfixer … → loads core engine → reads input PDB → performs fixes → writes output
– Browser UI: launch uiserver.py → serves HTML pages → user clicks actions → server calls core engine → returns updated PDB or progress page
• Core engine uses:
– XML forcefield (soft.xml)
– Residue templates (templates/*.pdb)
• Packaging tools consume the source tree to build conda packages or PyPI distributions.
• CI workflows run tests (pdbfixer/tests) and deployment scripts on each push.
Architectural patterns & design principles
• Separation of concerns:
– UI layer (CLI vs HTTP) is thin, delegates logic to the core engine.
– Core engine is a pure Python library with no UI dependencies.
• Modular data definitions:
– Templates and XML forcefield are external data resources.
• Test isolation:
– Unit tests operate directly on core functions using test PDB fixtures.
Elements
– Clear component names: “PDBFixer Core Library,” “CLI Front End,” “Browser UI Server,” “Templates & Forcefield Data,” “Conda-Package Builder,” “CI/CD Pipelines.”