How martinpacesa/bindcraft works
Project Type and Purpose
• BindCraft is a specialized bioinformatics pipeline for designing protein binders. It automates binder design through multiple stages of optimization and uses advanced protein modeling libraries.
• The README explains that the pipeline takes a protein target (provided via a JSON settings file) and runs a binder generation and validation process involving protein structure prediction, mutation sampling, and energy scoring.
File Structure
• Top-Level Files/Scripts:
• bindcraft.py: The main Python entry point for running the design pipeline.
• bindcraft.slurm: SLURM job script to run the pipeline on a high-performance cluster.
• install_bindcraft.sh: Installation script that sets up dependencies, including downloading AlphaFold2 weights and installing PyRosetta (taking into account licensing).
• Directories:
• functions: Contains all helper modules (e.g., biopython_utils.py, colabdesign_utils.py, pyrosetta_utils.py) that abstract common operations such as structure processing, interfacing with Colab design code, or PyRosetta energy evaluations.
• notebooks: Contains a Colab notebook (BindCraft.ipynb) to allow testing or demonstration of the pipeline.
• settings_advanced, settings_filters, settings_target: These hold multiple JSON configuration files that allow users to control binder design parameters (e.g., algorithm details, design iterations, weights), filter thresholds for design evaluations, and target-specific information.
• example: Provides a simple example target PDB file.
Key Architectural Components and Their Relationships
• Input/Configuration Manager:
• Uses JSON files from settings_target (protein target, chain specifications, lengths, etc.), settings_filters (post-design evaluation criteria), and settings_advanced (detailed algorithm parameters, iteration settings, and weights).
• Core Pipeline:
• Main Execution Script (bindcraft.py) orchestrates the process.
• Underlying functions (modules in the functions directory) are invoked to handle various tasks. For example:
• Preparation and preprocessing of protein structures.
• Execution of design iterations (soft, temporary, hard, greedy, etc.) as explained in the README.
• Interface to external libraries.
• This pipeline directs design trajectories through several stages: initial design with AlphaFold2, iterative design optimization (using AF2 recycles and MPNN for sequence mutations), and structure validation.
• External Dependencies and Libraries:
• AlphaFold2: Used in multimer mode or pTM mode for structure prediction and binder design. Indicate that AF2 processes are part of both design and validation stages.
• ProteinMPNN: Applied to generate or optimize binder sequences in parallel.
• PyRosetta: Utilized for final energy evaluation and relaxation of designed structures.
• CUDA & GPU Requirements: Mention that the pipeline requires a CUDA-compatible Nvidia GPU (the installation script addresses this).
• Execution Contexts:
• Local Execution: Executing via bindcraft.py directly with conda environment activation.
• Cluster/SLURM Execution: Running via bindcraft.slurm for high-throughput or GPU-heavy execution.
• Google Colab: A notebook-based interface provided for demonstration or testing.
• Output/Data Visualization:
• Final design PDB files, statistical CSV outputs, and possibly animated visualizations (noted by zipping of animations and plots).
• Filters applied to select designs based on AF2 confidence scores, Rosetta metrics, and MPNN outputs.