WTHMDA 0.0.4
WTHMDA
Requires Python: >=3.6

# **WTHMDA**

## Contents

- [Introduction](#introduction)
- [Package requirement](#package-requirement)
- [Installation](#installation)
- [Data preprocess](#model-training)
- [Model training and prediction ](#classification )
- [Citation](#citation)
- [Contact](#contact)

## Introduction

In this study, we propose a novel deep learning framework named WTHMDA (Weighted Taxonomic Heterogeneous-network based Microbe-Disease Association), which leverages a weighted graph convolution network and microbial taxonomy common tree for microbe-disease association prediction.

## Package requirement

- torch==1.9.0
- dgl==0.9.1
- ete3==3.1.3
- gensim==4.0.1

## Installation

```
setup.py
```

Then all tools are located at ‘bin’ folder:

get_disease_feature.py // To generate disease feature utilizing weighted Deepwalk

get_microbe_feature.py // To generate microbe feature utilizing weightedDeepwalk

get_edges.py // To generate directed microbe links and four types of weighted microbe ontological similarities

WTHMDA_run.py // For model training and prediction

## Data preprocess

To generate disease feature utilizing weighted Deepwalk, one file are required as input including integrated disease functional similarities.  
a. integrated disease functional similarities (required)

| 1    | 0.21 | 0.52 | 0.11 |
| ---- | ---- | ---- | ---- |
| 0.21 | 1    | 0    | 0.44 |
| 0.52 | 0    | 1    | 0.87 |
| 0.11 | 0.44 | 0.87 | 1    |

You can specify the integrated disease functional similarities path (D_feat_path) as input.

```
from WTHMDA2.example.get_disease_feature import get_disease_feature

get_disease_feature(D_feat_path)
```

To generate microbe feature utilizing weighted Deepwalk, one file are required as input including integrated microbe functional similarities.
a. integrated microbe functional similarities (required)

| 1    | 0.75 | 0.9  | 0.43 |
| ---- | ---- | ---- | ---- |
| 0.75 | 1    | 0.71 | 0.1  |
| 0.9  | 0.71 | 1    | 0.53 |
| 0.43 | 0.1  | 0.53 | 1    |

You can specify the integrated microbe functional similarities path (M_feat_path) as input.

```
from WTHMDA2.example.get_microbe_feature import get_microbe_feature

get_microbe_feature(M_feat_path)
```

To generate microbe feature utilizing weighted Deepwalk, one file are required as input including integrated microbe functional similarities.
a. integrated microbe functional similarities (required)

| 0   | Abiotrophia |
| --- | ----------- |
| 1   | Bacteroides |
| 2   | Caloramator |
| 3   | Dermacoccus |

You can specify the microbe list path  (MicroPd_path) as input. 

```
from WTHMDA2.example.get_edges import get_edges

get_edges(MicroPd_path)
```

## Model training and prediction

To train WTHMDA model and prediction, two files are required as input including train_edge and test_edge. 
a. train_edge (required)

| disease | microbe | label |
| ------- | ------- | ----- |
| 1       | 108     | 1     |
| 4       | 43      | 0     |
| 36      | 230     | 1     |

b. test_edge (required)

| disease | microbe | label |
| ------- | ------- | ----- |
| 3       | 165     | 1     |
| 15      | 62      | 1     |
| 14      | 42      | 0     |



Then, you can predict the status of microbiomes using the model generated by the training procedure. 

```
from WTHMDA2.example.WTHMDA_example import WTHMDA_example

WTHMDA_example(train_edge_path = 'data/example/train_edge.csv',
                test_edge_path = 'data/example/test_edge.csv',
                save_path = 'result/example')
```

For convenience,We set an example dataset(example) in ‘data/’ folder. 

Please create  your code file in the same directory as the "data" folder, like the following example:

```
├── data
│   └── example
└── your_code.py
```

You can run the following code to get a quick start.

```
from WTHMDA2.example.WTHMDA_example import WTHMDA_example
from WTHMDA2.example.get_microbe_feature import get_microbe_feature
from WTHMDA2.example.get_edges import get_edges
from WTHMDA2.example.get_disease_feature import get_disease_feature

get_disease_feature(D_feat_path = 'data/example/disease_I_S.csv')
get_edges(MicroPd_path = 'data/example/microbe_list.xlsx')
get_microbe_feature(M_feat_path = 'data/example/microbe_I_S.csv')
WTHMDA_example(train_edge_path = 'data/example/train_edge.csv',
                test_edge_path = 'data/example/test_edge.csv',
                save_path = 'result/example'
```

## Citation

## Contact

All problems please contact WTHMDA development team: 
**Xiaoquan Su**&nbsp;&nbsp;&nbsp;&nbsp;Email: suxq@qdu.edu.cn