Skip to content

Repository files navigation

GNN-GBA

An Explainable Knowledge Graph-Driven Approach to Decipher the Link Between Brain Disorders and the Gut Microbiome

Python License

Paper: BioRxiv


Overview

GNN-GBA (Graph Neural Network - Gut-Brain Axis) is a novel explainable AI framework that leverages knowledge graphs and graph neural networks to investigate and explain the complex relationships between the gut microbiome and brain disorders. This repository contains the implementation of our approach, which combines:

  • Knowledge Graph: MGBAGraph: A Multi-relational biomedical knowledge graph connecting microbes, metabolites, and brain disorders
  • Graph Neural Networks: GNN-GBA: A GraphSAGE-based GNN architecture for learning predictive relationships
  • Explainability: Path-based explanations that reveal mechanistic connections between gut microbiota and brain disorders

Note: All experiments reported in our paper were conducted on a machine with 64 CPU cores, a single A100 GPU, and 64GB RAM.

Table of Contents


Installation

Setup Instructions

  1. Clone the repository

    git clone https://github.com/naafey-aamer/GNN-GBA.git
    cd GNN-GBA
  2. Create a virtual environment (recommended)

    python3.10 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install required packages

    pip install -r requirements.txt

Dataset

MGBA Knowledge Graph

The knowledge graph contains multi-relational connections between microbes, metabolites, genes, proteins, and brain disorders extracted from multiple biomedical databases.

Download the knowledge graph:

  1. Download from: https://dfkide-my.sharepoint.com/:u:/g/personal/naaa01_dfki_de/IQB0c4v-AXS3QJJe3q_XaqNeAbB19EDmIkV2utpsCBTqJv0?e=XEYMjl
  2. Unzip the downloaded file (~1.06GB) into the root directory of this repository:
    unzip MGBAGraph1.zip -d ./

Brain Disorders Dataset

The repository includes two CSV files with lists of brain disorders:

  • brain_disorders/neurological_disorders_sample.csv: Contains 10 diseases for testing and experimentation
  • brain_disorders/neurological_disorders.csv: Complete list of brain disorders used in the full analysis

Usage


1. Training the GNN-GBA Model

The train-GNN-GBA.py script trains the Graph Neural Network model on the Knowledge Graph.

python train-GNN-GBA.py

2. Finding Paths Between Microbes and Disorders

The find_paths.py script discovers connecting paths between gut microbes and brain disorders in the knowledge graph.

Features:

  • Parallel processing across multiple CPU cores
  • Configurable path length and maximum number of paths
  • Timeout mechanism to prevent infinite searches
  • JSON and text output formats

Quick Start (Sample Dataset):

python find_paths.py

Important Configuration:

By default, the script is configured to use the sample dataset (10 diseases) for ease of testing:

# In find_paths.py
csv_file_path = "brain_disorders/neurological_disorders_sample.csv"  # Sample (10 diseases)

For full analysis, modify the script to use the complete dataset:

csv_file_path = "brain_disorders/neurological_disorders.csv"  # Full dataset

Key Parameters:

edge_file_path = "MGMGraph/filtered_edge_list.txt"    # Knowledge graph
csv_file_path = "brain_disorders/neurological_disorders_ranked_sample.csv"  # Disease list
output_dir = "disease_microbe_paths_latest"            # Output directory
max_paths = 10                                         # Maximum paths per microbe-disease pair
timeout_seconds = 100                                  # Timeout per path search
num_cpus = min(30, mp.cpu_count())                    # Number of parallel processes

3. Generating Explanations

The GNN-GBA-Explainer.py script generates explainable predictions by scoring the discovered paths.

Prerequisites:

  • Completed path discovery (find_paths.py)
  • Trained GNN-GBA model (train-GNN-GBA.py)
python GNN-GBA-Explainer.py

4. Running Baseline Comparisons

The Baselines.py script reproduces the baseline model results for comparison.

python Baselines.py

Citation

If you use this code or find our work helpful, please cite our paper:

@article {Aamer2025.12.11.693657,
	author = {Aamer, Naafey and Asim, Muhammad Nabeel and Vollmer, Sebastian and Dengel, Andreas},
	title = {An Explainable Knowledge Graph-Driven Approach to Decipher the Link Between Brain Disorders and the Gut Microbiome},
	elocation-id = {2025.12.11.693657},
	year = {2025},
	doi = {10.64898/2025.12.11.693657},
	publisher = {Cold Spring Harbor Laboratory},
	abstract = {Motivation The communication between the gut microbiome and the brain, known as the microbiome-gut-brain axis (MGBA), is emerging as a critical factor in neurological and psychiatric disorders. This communication involves complex pathways including neural, hormonal, and immune interactions that enable gut microbes to modulate brain function and behavior. However, the specific mechanisms through which gut microbes influence brain function remain poorly understood, and existing computational efforts to understand these mechanisms are simplistic or have limited scope.Results This work presents a comprehensive approach for understanding these mechanisms by elucidating the cascade of interactions that allows gut microbes to influence brain disorders. By using a large curated biomedical knowledge graph, we train GNN-GBA, an explainable graph neural network, to learn the complex biological interactions between the gut microbiome and the brain. GNN-GBA is then used to extract the mechanistic pathways through which the gut microbiome can influence brain disorders. The network successfully identified pathways for 103 brain disorders, and we show that these pathways are consistent with existing literature.Availability An interactive dashboard to explore thousands of potential mechanisms through which the gut microbiome can influence brain diseases is available at https://sds-genetic-interaction-analysis.opendfki.de/gutbrain/.Contact naafey.aamer{at}cs.rptu.deCompeting Interest StatementThe authors have declared no competing interest.},
	URL = {https://www.biorxiv.org/content/early/2025/12/30/2025.12.11.693657},
	eprint = {https://www.biorxiv.org/content/early/2025/12/30/2025.12.11.693657.full.pdf},
	journal = {bioRxiv}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.


Contact

For questions, issues, or collaboration opportunities, please:


About

An Explainable Knowledge Graph-Driven Approach to Decipher the Link Between Brain Disorders and the Gut Microbiome

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages