How protein-design-laboratory-pdl/vdm-motif-design works
Purpose and entry points
vdmdesign is a research Python package for placing van der Mer (vdM) motifs on ligand chemical groups, evaluating chemistry and clashes, then constructing compatible motif ensembles. Primary user entry points are thin module/console CLIs in src/vdmdesign/cli/candidates.py, src/vdmdesign/cli/ensembles.py, src/vdmdesign/cli/backbone_conditioned.py, and src/vdmdesign/cli/audit_ensembles.py.
Chemical-group specification and ligand preparation
The authoritative runtime CG catalog is data/definitions/cg_definitions.yaml; it supplies atom identities, graph topology, placement/alignment orders, H-bond roles, mappings, and constraints. src/vdmdesign/specs/definitions.py and src/vdmdesign/specs/cg.py turn this catalog into placement specifications and graph templates. Ligand preparation/perception in src/vdmdesign/chemistry/ligand_preparation.py, src/vdmdesign/chemistry/perception.py, and src/vdmdesign/chemistry/ligand.py preserves explicit PDB chemistry where possible and uses RDKit recovery paths when needed.
Ligand-only candidate pipeline
Ligand-only orchestration is split between src/vdmdesign/ligand_only/candidates_workflow.py and src/vdmdesign/ligand_only/ensembles_workflow.py. Candidate generation (src/vdmdesign/candidates/generate.py) maps requested CGs onto the prepared ligand, loads vdM data/members (src/vdmdesign/candidates/loader.py), aligns motifs, applies AA policy and geometric/chemical filters, and writes candidate artifacts through src/vdmdesign/output/candidate_writer.py.
Chemistry evaluation boundary
Shared chemistry is independent of workflow selection: clash calculations use src/vdmdesign/chemistry/clash.py; H-bond site identification and directional quality live in src/vdmdesign/chemistry/hbond/sites.py and src/vdmdesign/chemistry/hbond/direction_quality.py; aromatic interaction handling is in src/vdmdesign/chemistry/aromatic.py. This layer supplies filtering and ranking signals to both ligand-only and backbone-conditioned flows rather than owning search or serialization.
Ensemble assignment and search
src/vdmdesign/assignment_engine/search_space.py builds candidate slots and search state, while src/vdmdesign/assignment_engine/compatibility.py enforces member compatibility, clash constraints, and one-motif-per-residue rules. src/vdmdesign/assignment_engine/ranking.py ranks feasible assignments using H-bond quality, candidate/cluster metrics, and distances. src/vdmdesign/ensembles/build.py and src/vdmdesign/ensembles/pools.py orchestrate count-constrained ensemble construction. Torch is an optional runtime for exact search, configured by requirements-torch.txt.
Backbone-conditioned feasibility and batch flow
For backbone–ligand PDBs, src/vdmdesign/backbone_conditioned/workflow.py detects mapped CGs and tests vdM cluster representatives against nearby residues. src/vdmdesign/backbone_conditioned/fit.py applies rigid ligand-CG placement and backbone gates; src/vdmdesign/backbone_conditioned/multi_cg.py diagnoses compatible multi-CG rotamers. src/vdmdesign/backbone_conditioned/ensemble_workflow.py consumes audit provenance, restores cluster members, reapplies member-level backbone checks, then delegates feasible combinations to the ensemble search.
Data, outputs, and infrastructure
Runtime datasets are manifest-driven under data/manifests/ and vdM library metadata begins at data/vdM_library/manifest.json; backbone-conditioned processing reads AA parquet data referenced by that library. PDB/CSV output is centralized in src/vdmdesign/output/paths.py, src/vdmdesign/output/pdb_writer.py, and src/vdmdesign/output/ensemble_writer.py. Outputs include prepared ligands, candidate/ensemble CSVs, standalone PDBs, backbone diagnostics, and aromatic reranking products. Core runtime is Python 3.9+ with RDKit-based chemistry; no web service or distributed infrastructure is indicated.
Main entry points: generate.py Candidate generation · candidates.py CLI modules · compatibility.py Compatibility rules · ensemble_workflow.py Backbone ensemble flow
Components 19
Entry Points
- CLI modules · Candidate, ensemble, backbone, and audit commands.
src/vdmdesign/cli/candidates.py
Specifications & Chemistry
- CG catalog · Authoritative chemical-group definitions.
data/definitions/cg_definitions.yaml - CG specifications · Builds placement specifications and graph templates.
src/vdmdesign/specs/definitions.py - Ligand preparation · Preserves PDB chemistry with RDKit recovery when required.
src/vdmdesign/chemistry/ligand_preparation.py - Chemistry evaluation · Clash, H-bond, and aromatic signals shared by both workflows.
src/vdmdesign/chemistry/clash.py
Ligand-only Pipeline
- Candidate workflow · Orchestrates ligand-only candidate generation.
src/vdmdesign/ligand_only/candidates_workflow.py - Candidate generation · Maps CGs, aligns vdMs, and applies geometric and chemical filters.
src/vdmdesign/candidates/generate.py - vdM loader · Loads vdM metadata and members.
src/vdmdesign/candidates/loader.py - Ensemble workflow · Orchestrates ligand-only ensemble construction.
src/vdmdesign/ligand_only/ensembles_workflow.py
Ensemble Search
- Search space · Builds candidate slots and search state.
src/vdmdesign/assignment_engine/search_space.py - Compatibility rules · Enforces clashes, member compatibility, and residue uniqueness.
src/vdmdesign/assignment_engine/compatibility.py - Assignment ranking · Ranks feasible assignments using chemistry and candidate metrics.
src/vdmdesign/assignment_engine/ranking.py - Ensemble builder · Constructs count-constrained ensembles; optional Torch exact search.
src/vdmdesign/ensembles/build.py
Backbone-conditioned Flow
- Backbone feasibility · Finds mapped CGs and tests representatives against nearby residues.
src/vdmdesign/backbone_conditioned/workflow.py - Backbone fit gates · Applies rigid placement and backbone gates.
src/vdmdesign/backbone_conditioned/fit.py - Multi-CG diagnostics · Diagnoses compatible multi-CG rotamers.
src/vdmdesign/backbone_conditioned/multi_cg.py - Backbone ensemble flow · Restores members, reapplies checks, and delegates search.
src/vdmdesign/backbone_conditioned/ensemble_workflow.py
Data & Outputs
- Runtime datasets · vdM library metadata and referenced AA parquet data.
data/vdM_library/manifest.json - Output writers · Centralized PDB, CSV, diagnostic, and reranking output.
src/vdmdesign/output/ensemble_writer.py
Connections 24
- CLI modules → Candidate workflow: runs
- CLI modules → Ensemble workflow: runs
- CLI modules → Backbone feasibility: runs
- CLI modules → Backbone ensemble flow: runs
- CG catalog → CG specifications: defines
- CG specifications → Candidate generation: placement specs
- Ligand preparation → Candidate generation: prepared ligand
- Candidate workflow → Candidate generation: orchestrates
- vdM loader → Candidate generation: vdM members
- Runtime datasets → vdM loader: library data
- Chemistry evaluation → Candidate generation: filter signals
- Candidate generation → Output writers: candidate artifacts
- Ensemble workflow → Ensemble builder: orchestrates
- Candidate generation → Search space: candidates
- Search space → Compatibility rules: candidate slots
- Chemistry evaluation → Compatibility rules: clash and interaction signals
- Compatibility rules → Assignment ranking: feasible assignments
- Assignment ranking → Ensemble builder: ranked assignments
- Ensemble builder → Output writers: ensemble artifacts
- Backbone feasibility → Backbone fit gates: tests representatives
- Backbone fit gates → Multi-CG diagnostics: feasible placements
- Runtime datasets → Backbone feasibility: AA parquet
- Backbone ensemble flow → Compatibility rules: feasible combinations
- Backbone ensemble flow → Output writers: diagnostics and ensembles