Skip to content

TUnA: Transformer-based Uncertainty Aware model for PPI Prediction

License

Notifications You must be signed in to change notification settings

Wang-lab-UCSD/TUnA

Repository files navigation

TUnA: Transformer-based Uncertainty Aware model for PPI Prediction

architecture

Introduction

This repository contains the data and code required to reproduce results or run TUnA.

Installation

$ git clone https://github.com/Wang-lab-UCSD/TUnA
$ cd TUnA
$ conda env create --file environment.yml
$ conda activate tuna

NOTE: The torch packages in environment.yml may need to be edited depending on which CUDA you are using: https://pytorch.org/get-started/previous-versions/

Usage

Data processing

The embedding step may take some time.

Cross-species Dataset

$ python3 process_xspecies.py 

Bernett Dataset

$ python3 process_bernett.py 

NOTE:The embedded Bernett data can be downloaded here: https://huggingface.co/yk0/TUnA_embeddings/tree/main. Please place the three folders in the data/embedded/bernett/ directory.


Training and evaluation

To train from scratch, head to results/ and choose the dataset/model you wish to train. Then, run:

$ python3 main.py 

Hyperparameters and other options can be controlled using the config.yaml file. Please make sure the directories to the train/val/test dictionary and interaction files are correct. Every epoch, the performance on the validation set will be logged in output/results.txt

NOTE: You need to specify your cuda device in config.yaml. Please edit the config file so that you are using the cuda device available in your setup.

Using pre-trained models:

First, download the pretrained models you wish from: https://huggingface.co/datasets/yk0/TUnA_data/tree/main. Then, place the model file in the results/dataset/model/output directory. For example: place the bernett-TUnA model in the results/bernett/TUnA/output

Then to evaluate either the re-trained or pre-trained models on the test sets:

$ cd results/bernett/TUnA # navigate to the model you wish to use. The pretrained model needs to be placed in output/
$ python3 inference.py 

About

TUnA: Transformer-based Uncertainty Aware model for PPI Prediction

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages