How kuhlman-lab/thermompnn works
Project Type and Purpose
• Type: A scientific/machine learning application for protein ddG prediction using a GNN.
• Purpose: It takes in protein structural (PDB) or CSV data, processes the input using a series of preprocessing scripts, executes training (or performs inference) via the GNN model, and outputs predictions about protein mutant stability changes.
Identifying Main Components
a. Data Management
• Raw datasets are stored in the "data_all" directory with separate folders for training and testing.
• Dataset splits (train/test partitions and clustering) are maintained under "dataset_splits".
• Configuration files like "local.yaml" and "config.yaml" specify where data is located and set hyperparameters for training.
b. Data Preprocessing
• The "preprocessing" directory includes scripts (and notebooks) for cleaning and aligning datasets, adding metadata, and splitting data.
• This module is responsible for converting raw data into the formats required for training and inference.
c. Model Training
• The "train_thermompnn.py" script is the entry point for training the GNN model.
• Scripts like "transfer_model.py" and utility functions (e.g., in "model_utils.py") support training operations.
• Training produces model weights which are stored in the "models" and "vanilla_model_weights" directories.
d. Inference and Analysis
• The "analysis" directory contains several scripts for various forms of inference (e.g., "custom_inference.py", "SSM.py", and benchmarking scripts).
• These scripts allow running predictions from single PDB inputs or bulk CSV datasets.
e. Utility Modules and Supporting Components
• Files such as "datasets.py", "protein_mpnn_utils.py", and "cache.py" support data handling, model inference, and caching.
• Examples are provided under the "examples" directory for running inference and training using SLURM scripts.
• Configuration/environment setup is supported by "environment.yaml" and ".gitignore"/".idea" for project hygiene.
Relationships/Interactions Between Components
• Data Flow:
→ Raw protein data and dataset splits (data_all and dataset_splits) are ingested.
→ Preprocessing scripts clean and prepare the data, which is then fed into the training pipeline.
→ The training module uses configuration files (config.yaml, local.yaml) and produces model weights.
→ Inference scripts (in analysis/) use these trained weights along with newly processed or provided input data to generate predictions.
• Dependency Relationships:
• The preprocessing module depends on proper dataset file availability.
• The training module relies on both processed data and experimental configuration parameters.
• The inference module utilizes both the trained models and any external protein or CSV input.
Architectural Patterns and Key Technologies
• Separation of Concerns: Clear division between data preprocessing, training, and inference analyses.
• Data Pipeline: A sequential flow from raw input → cleaning/processing → model training/inference.
• Use of Transfer Learning: The system is based on a pretrained GNN that is fine-tuned for stability prediction.
• Technologies: Python scripts, Conda-based environment management via environment.yaml, PyTorch (with GPU support), and job scheduling scripts (e.g., SLURM).
Specific Elements
• Clear labels for each component:
• Data Input (Raw Datasets, Dataset Splits)
• Data Preprocessing Module
• Model Training Module (GNN/Transfer Learning)
• Inference & Analysis Module
• Supporting Utilities and Environment Configuration
• Visual Differentiation:
• Legends or annotations wherever necessary.
• Notations/Annotations:
• Annotations pointing out crucial configuration files (config.yaml, local.yaml) setting experimental parameters.
• Reliance on GPU for training and potential SLURM-managed deployments.