How ml4bm-lab/gennius works
Overall Project Type and Purpose
• This is a computational biology project focusing on drug–target interaction (DTI) prediction using graph neural networks.
• Its purpose is to generate drug–target predictions faster and more accurately by leveraging a GNN encoder and a neural network classifier.
• The project includes both core model training/inference and extensive preprocessing, validation, and baseline experiments, as well as support for grid-search hyperparameter tuning and docker-based deployment.
Main Components
A. Data Management and Preprocessing:
• Data Input: Represent the raw and processed datasets (Data/Raw, Data directory with annotated and preprocessed files, and multiple datasets like DRUGBANK, BIOSNAP, etc.).
• Preprocessing Modules: Include Code/data_preprocessing.py, Code/data_preprocessing_removing_repeated_edges.py, and equivalent scripts in Baselines and pretrain_protemb directories.
• External Data Sources: For example, data fetched from PubChem, Uniprot (as noted for protein embeddings).
B. Core Model Components:
• GNN Encoder: Based on SAGEConv layers (4 hidden layers, Tanh activation, sum aggregation) as described in the README.
• NN-Classifier: Two-layer linear model with ReLU activations, also using a sum aggregation.
• Main Execution Flow: Represent Code/main.py that ties these model components together and accepts parameters (e.g., embedding dimension).
C. Training, Evaluation, and Validation:
• Training Pipeline: Illustrate the module where the model is trained (with Adam optimizer, specific learning rate, and dropout parameters) as part of the Code scripts.
• Evaluation Scripts: Include Code/validation.py, Code/compare_dtis_retrieve_unknown.py, and supporting scripts that generate TSVs and figures (e.g., figure_boxplot_inferring_dtis.py).
D. Baselines and Comparative Studies:
• Baselines Directory: Split into sub-components such as simple_baselines (with logistic regression and random forest implementations), feature_corr for assessing feature correlations, and pretrain_protemb for experiments involving pre-trained protein embeddings.
• Generalization Analysis: Highlight the pipeline under Baselines/simple_baselines/baseline_generalization and scripts like execute4generalization.py, which assess performance across multiple datasets.
E. Experiment Management and Deployment:
• Hyperparameter Tuning: Include the GridSearchCodes folder that holds scripts for grid search (gridsearch_GeNNius.py, generate_grid.py).
• Docker: Represent the Dockerfile and instructions how containerization is used to run the experiments in a consistent environment.
• Logging and Results: Show directories like Results for output files and logs to complete the feedback loop.
Relationships and Data Flow
• Data flows from the “Data/Raw” and “Data/Annotation” into the preprocessing modules, which then produce “HeteroData” objects ready for training.
• Preprocessed data feeds into the core training routine (invoked by Code/main.py and supported by utilities in Code/utils.py).
• The trained model (embedding generation via the GNN encoder and classification via the NN classifier) is then used for inference, DTI prediction, or generalization analyses.
• Evaluation and visualization components (in Code/validation.py and Code/tsnes) interact with the output from the core model.
• Baselines and grid search experiments run parallel pipelines to benchmark performance against the main GeNNius model.
• The Docker environment encapsulates the complete system for consistent execution, linking to the build pipeline from Docker/Dockerfile.
Architectural Patterns and Design Principles
• There is a clear separation between data ingestion/preprocessing, model training, evaluation, and result visualization.
• The code is modularized into directories (Code, Baselines, Data, GridSearchCodes) that indicate discrete concerns and allow for extensibility.
• Integration of external resources (e.g., Uniprot embeddings) and baseline experiments as parallel comparative pipelines.