Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peterajhgraham/bnn_biological_network_inference
This repository contains a Bayesian Neural Network (BNN) based analysis tool for biological network inference that can be used with various datasets. It is programmed in Python along with the torch, torchbnn, pandas, scikit-learn, and matplotlib libraries.
https://github.com/peterajhgraham/bnn_biological_network_inference
bayesian-neural-networks computational-biology computational-genomics computational-neuroscience computational-pharmacology computational-systems-biology
Last synced: 14 days ago
JSON representation
This repository contains a Bayesian Neural Network (BNN) based analysis tool for biological network inference that can be used with various datasets. It is programmed in Python along with the torch, torchbnn, pandas, scikit-learn, and matplotlib libraries.
- Host: GitHub
- URL: https://github.com/peterajhgraham/bnn_biological_network_inference
- Owner: peterajhgraham
- License: mit
- Created: 2024-08-19T19:22:51.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-20T21:02:37.000Z (3 months ago)
- Last Synced: 2024-08-20T22:34:19.843Z (3 months ago)
- Topics: bayesian-neural-networks, computational-biology, computational-genomics, computational-neuroscience, computational-pharmacology, computational-systems-biology
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bayesian Neural Network Biological Network Inference
This BNN BNI Analysis Tool can be used for predictive insight in Biological Networks through the use of Bayesian Neural Networks. This repository can be used for any biological datasets, however it is tailored toward individuals who are interested in neural networks/neural computation, computational biology, computational systems biology, computational genomics, computational pharmacology, and computational neuroscience. It is also made just as available to anyone who would like to use it for their own learning endeavours or to start their journey in any of these fields!
## Directory Structure
```
BNN_Biological_Network_Inference/
├── data/
│ └── example_data.csv
│
├── src/
│ ├── data_preprocessing.py
│ ├── train.py
│ ├── inference.py
│ └── utils.py
│
├── .gitignore
├── LICENSE
├── requirements.txt
└── README.md
```## Example Databases
* **[Protein Data](https://www.wwpdb.org/)**
* **[Genomic Data](https://www.genomicsengland.co.uk/)**
* **[Drug Interaction Data](https://go.drugbank.com/)**
* **[Metabolite Data](https://www.metabolomicsworkbench.org/databases/metabolitedatabase.php)**
* **[Microbiome Data](https://portal.hmpdacc.org/)**
### Data Structure
Your `.csv` files should follow this structure:
1. **Features**: Columns representing various features.
2. **Target Variable**: A column for the target variable that represents the interaction score or outcome you want to predict.**Example Structure**:
feature1,feature2,feature3,target
value1,value2,value3,target_value
## Instructions
### 1. Prepare Your Data
* **Copy The Repository**:
```
git clone https://github.com/peterajhgraham/BNN_Biological_Network_Inference.git
cd BNN_Biological_Network_Inference
```
* **Format Your Data**: Ensure your `.csv` files follow the structure outlined above.* **Place Data Files**: Save your `.csv` files in the `data/` directory of the repository.
### 2. Install Required Packages
Install the required Python packages listed in `requirements.txt`:
```
pip install -r requirements.txt
```### 3. Preprocess Data
Run the data preprocessing script to load and prepare your data for modeling:
```python
from src.data_preprocessing import load_data, preprocess_datafile_paths = {
'example': 'data/example_data.csv'
}data = load_data(file_paths)
processed_data = preprocess_data(data)
```### 4. Train the Model
Use the training script to build and train your Bayesian Neural Network model with torchbnn:
```python
from src.train import train_modelinput_dim = processed_data['example'][0].shape[1] # Example for one dataset
model = train_model(*processed_data['example'], input_dim)
```### 5. Make Predictions
After training, use the inference script to make predictions with your model:
```python
from src.inference import inferpredictions = infer(model, processed_data['example'][1])
```### 6. Visualize Results
You can use the utility functions to visualize your results:
```python
from src.utils import plot_predictionsplot_predictions(processed_data['example'][2], predictions)
```