How jule-c/flowr works
Project type and purpose
• This is a Python-based research toolkit (no GUI/frontend) for structure-aware, flow-matching ligand generation. It provides a full CLI-driven pipeline: data ingestion & preprocessing, model definition & training, de novo/fragment-based generation, and multi-facet evaluation.
File structure analysis
• Top-level directories:
• flowr/ ← core library: data, models, training, generation, evaluation, utilities
• genbench3d/ ← 3D geometry & scoring backend (data sources, geometry extraction, scoring metrics)
• posebusters/ ← docking-based error modules, CLI, configs, dataset loaders, scoring modules
• posecheck/ ← independent pose quality checks & utilities
• callbacks/ ← training callbacks (e.g., EMA, prediction logging)
• scripts/ ← SLURM/batch scripts for train, generate, evaluate
• Key files:
• environment.yml ← conda dependencies
• genbench3d/config/*.yaml ← geometry tool config
• posebusters/config/*.yml ← docking & generation config
• README.md ← project overview & workflow instructions
README insights
• Full FLOWR workflow: setup → data download → train → generate → evaluate
• External dependencies: ADFR suite, SLURM scheduler, Python packages (RDKit, PyTorch, etc.)
• Examples of CLI/SLURM scripts for automation
Components & interactions
1. Data Layer
• Raw SPINDR data (.smol, .cif), genbench3d_data, posebusters PDB library
• Preprocessing modules: flowr/data, genbench3d/data, posebusters/datasets
2. Model Layer
• Model definitions: flowr/models (EGNN, EQGAT, SEMLA…)
• Callbacks (callbacks/)
3. Training Pipeline
• Trainer entrypoint: flowr/train.py
• Datamodule: flowr/data/datamodules.py
• Scripts: scripts/train_spindr.sh → SLURM
4. Generation Pipeline
• FLOWR generation: flowr/gen/predict*.py
• genbench3d generation: genbench3d/genbench3d.py / sbgenbench3d.py
• posebusters CLI: posebusters/cli.py & modules → error modules
• Scripts: scripts/gen_spindr.sl, gen_pdb.sl
5. Evaluation Pipeline
• FLOWR evaluation: flowr/eval/*
• genbench3d metrics: genbench3d/metrics/*
• posebusters scoring & posecheck: posebusters/modules & posecheck/eval.py
• Scripts: scripts/eval_spindr.sh
6. Utilities & Config
• Shared utilities: flowr/util, genbench3d/utils, posebusters/tools, posecheck/utils
• Configuration files: environment.yml, YAML under genbench3d/config & posebusters/config
7. External Services
• ADFR docking engine
• SLURM scheduler
• Zenodo dataset repository
• “Raw Data” → Preprocessing → Processed Datasets → DataLoader → Training
• Training → Model Checkpoint → Generation
• Model Checkpoint + Input (pocket .pdb/.cif + optional fragments) → Generation → SDF output
• Generated SDFs → Evaluation modules → Metrics report
• Posebusters & Posecheck can plug in at Generation/Evaluation stages for alternative scoring
c. Architectural patterns & principles
• Modular Python packages separated by responsibility (data / models / pipeline / utilities)
• CLI + SLURM scripts orchestrate end-to-end workflows
• Configuration as code (YAML files) for reproducibility
• Callbacks for extensibility (logging, EMA, checkpointing)
• Reuse of shared utilities across sub-projects
d. Key technologies & libraries
• PyTorch (implied via datamodules, callbacks)
• RDKit, Biopython for cheminformatics/structural tasks
• ADFR for docking
• SLURM for job scheduling
• YAML for config