Skip to main content

RNA Foundation Model (rna-fm): Pretrained language models for RNAs. From CUHK AIH Lab.

Project description

RNA-FM

This repository contains codes and pre-trained models for RNA foundation model (RNA-FM). RNA-FM outperforms all tested single-sequence RNA language models across a variety of structure prediction tasks as well as several function-related tasks. You can find more details about RNA-FM in our paper, "Interpretable RNA Foundation Model from Unannotated Data for Highly Accurate RNA Structure and Function Predictions" (Chen et al., 2022).

Overview

Citation
@article{chen2022interpretable,
  title={Interpretable rna foundation model from unannotated data for highly accurate rna structure and function predictions},
  author={Chen, Jiayang and Hu, Zhihang and Sun, Siqi and Tan, Qingxiong and Wang, Yixuan and Yu, Qinze and Zong, Licheng and Hong, Liang and Xiao, Jin and King, Irwin and others},
  journal={arXiv preprint arXiv:2204.00300},
  year={2022}
}
Table of contents

Create Environment with Conda

First, download the repository and create the environment.

git clone https://github.com/mydkzgj/RNA-FM.git
cd ./RNA-FM
conda env create -f environment.yml

Then, activate the "RNA-FM" environment and enter into the workspace.

conda activate RNA-FM
cd ./redevelop

Access pre-trained models.

Download pre-trained models from this gdrive link and place the pth files into the pretrained folder.

Apply RNA-FM with Existing Scripts.

1. Embedding Extraction.

python launch/predict.py --config="pretrained/extract_embedding.yml" \
--data_path="./data/examples/example.fasta" --save_dir="./resuts" \
--save_frequency 1 --save_embeddings

RNA-FM embeddings with shape of (L,640) will be saved in the $save_dir/representations.

2. Downstream Prediction - RNA secondary structure.

python launch/predict.py --config="pretrained/ss_prediction.yml" \
--data_path="./data/examples/example.fasta" --save_dir="./resuts" \
--save_frequency 1

The predicted probability maps will be saved in form of .npy files, and the post-processed binary predictions will be saved in form of .ct files. You can find them in the $save_dir/r-ss.

3. Online Version - RNA-FM server.

If you have any trouble with the deployment of the local version of RNA-FM, you can access its online version from this link, RNA-FM server. You can easily submit jobs on the server and download results from it afterwards, without setting up environment and occupying any computational resources.

Quick Start for Further Development.

PyTorch is the prerequisite package which you must have installed to use this repository. You can install rna-fm in your own environment with the following pip command if you just want to use the pre-trained language model. you can either install rna-fm from PIPY:

pip insatll rna-fm

or install rna-fm from github:

cd ./RNA-FM
pip insatll .

After installation, you can load the RNA-FM with the following code:

import fm
backbone, alphabet = fm.pretrained.rna_fm_t12()

More tutorials can be found from https://ml4bio.github.io/RNA-FM/

Citations

If you find the models useful in your research, we ask that you cite the relevant paper:

For RNA-FM:

@article{chen2022interpretable,
  title={Interpretable rna foundation model from unannotated data for highly accurate rna structure and function predictions},
  author={Chen, Jiayang and Hu, Zhihang and Sun, Siqi and Tan, Qingxiong and Wang, Yixuan and Yu, Qinze and Zong, Licheng and Hong, Liang and Xiao, Jin and King, Irwin and others},
  journal={arXiv preprint arXiv:2204.00300},
  year={2022}
}

The model of this code builds on the esm sequence modeling framework. And we use fairseq sequence modeling framework to train our RNA language modeling. We very appreciate these two excellent works!

License

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rna-fm-0.1.0.tar.gz (23.6 kB view details)

Uploaded Source

File details

Details for the file rna-fm-0.1.0.tar.gz.

File metadata

  • Download URL: rna-fm-0.1.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.11

File hashes

Hashes for rna-fm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 36d9fca5c2ccc253178014da55d3c6c834a0d7ca681f8df53aae2e63dcf95a8b
MD5 25d96adcd572c0eb98eab45958c29a81
BLAKE2b-256 9e5135430b11dccb5116032abee50a8f12014a6334a0814d437c8685cc0b814f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page