Skip to main content

A CLI tool for predicting lncRNA–Protein interactions using transformer embeddings and CatBoost

Project description

🧬 lncrna-PI - LncRNA–Protein Interaction Prediction

lncrnaPI is a command-line tool for predicting lncRNA–Protein interactions using pre-trained language models (DNABERT-2 and ESM-2) for sequence embedding and a CatBoost classifier for interaction probability estimation.


🚀 Overview

This standalone script enables large-scale prediction of interactions between lncRNA and protein sequences.
It leverages state-of-the-art transformer models to extract biologically meaningful embeddings and a pre-trained CatBoost model to compute interaction probabilities.


📦 Features

  • Supports FASTA input for lncRNA and protein sequences.
  • Generates embeddings using:
    • 🧬 DNABERT-2 (zhihan1996/DNABERT-2-117M) for lncRNAs
    • 🧫 ESM-2 (facebook/esm2_t30_150M_UR50D) for proteins
  • Predicts interaction probabilities using a CatBoost classifier.
  • Supports GPU acceleration (CUDA / MPS) for faster inference.
  • Outputs results in CSV format.

🧰 Installation

Install the package using the following code from the command line:

pip install lncrnapi

⚙️ Usage

Run the script directly from the command line:

lncrnapi  --lncrna_fasta /path/to/lncrnas.fasta     --protein_fasta /path/to/proteins.fasta     --model_path /path/to/saved_model.joblib     --output_file /path/to/results.csv

Arguments

Argument Description Required
--lncrna_fasta Path to the FASTA file containing lncRNA sequences.
--protein_fasta Path to the FASTA file containing protein sequences.
--model_path Path to the pre-trained CatBoost model file (.cbm, .joblib, or .pkl).
--output_file Path to save the CSV file with predicted probabilities.

🧠 How It Works

  1. Model Loading
    The tool loads the DNABERT-2 and ESM-2 models from Hugging Face.

  2. FASTA Parsing
    Extracts sequence IDs and corresponding sequences from input FASTA files.

  3. Embedding Generation
    Computes mean pooled embeddings for each sequence using transformer hidden states.

  4. Prediction
    Concatenates embeddings (lncRNA + protein) and predicts the interaction probability using the CatBoost model.

  5. Output
    Generates a .csv file containing:

    • LncRNA_ID
    • Protein_ID
    • Interaction_Probability

📊 Example Output

LncRNA_ID Protein_ID Interaction_Probability
lnc001 P12345 0.9421
lnc002 Q8N6T7 0.3175

⚡ Hardware Acceleration

The script automatically detects and uses available hardware:

  • CUDA GPU (NVIDIA)
  • MPS (Apple Silicon)
  • ⚠️ CPU (fallback)

🧩 Model Formats Supported

Format Description
.cbm Native CatBoost model format
.joblib Joblib-serialized model
.pkl Pickle-based serialized model

🛠 Troubleshooting

Issue Possible Cause Solution
Model file not found Wrong --model_path Check the file path
No sequences found in FASTA Invalid FASTA format Ensure > headers are present
safetensors error Missing library Install with pip install safetensors
Slow performance CPU usage Use GPU-enabled environment

📁 Output Example

$ head results.csv
LncRNA_ID,Protein_ID,Interaction_Probability
lnc001,P12345,0.9421
lnc002,Q8N6T7,0.3175
lnc003,O76074,0.7814

📜 Citation

If you use this tool in your research, please cite:

Your Name et al.
A Deep Learning Framework for lncRNA–Protein Interaction Prediction Using Transformer-Based Sequence Embeddings (2025)


🧩 Repository Structure

├── predict_interaction.py       # Main CLI script
├── README.md                    # Documentation
└── example/
    ├── lncrnas.fasta
    ├── proteins.fasta
    └── saved_model.joblib

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

lncrnapi-0.1.1.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lncrnapi-0.1.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file lncrnapi-0.1.1.tar.gz.

File metadata

  • Download URL: lncrnapi-0.1.1.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for lncrnapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3dbcf72dfac7a0bd7c30b652875062f3d6a6b5e4576c6fb1a2c6647f5e7aa623
MD5 ff7861ee58e10124e7310e3e7cc5bf01
BLAKE2b-256 8f24c9efce55a10eb569f1f542b9d7594aed93d15c8ed6a921e7b606ede97df6

See more details on using hashes here.

File details

Details for the file lncrnapi-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lncrnapi-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for lncrnapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d913e365bee86c11275bfe85470596a9d858f52fe840b04cf9173ef6209f0478
MD5 fdd17f451f52380c27ef664f355e9e77
BLAKE2b-256 cc786ccfbc5a6e57e618e76fe6d83cfdb068ad2526b0c608d916b40414ee640c

See more details on using hashes here.

Supported by

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