🧬 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.
It supports two modes:
- Rapid — based on sequence composition features (fast, lightweight)
- LLM — based on transformer embeddings (DNABERT2 + ESM2)
The script performs all-by-all predictions between every lncRNA and every protein sequence in the provided FASTA files.
📦 Features
- Vectorized and efficient FASTA parsing
- All-by-all pairing of lncRNA and protein sequences
- Automatic feature extraction:
- Rapid mode: nucleotide and amino acid composition (%)
- LLM mode: transformer-based embeddings (DNABERT2 + ESM2)
- Automatic model selection:
catboost_model_rapid.joblib→ Composition modelcatboost_dnabert2_esm-t30.joblib→ Embedding model
- GPU-aware embedding generation (with safe fallback to CPU)
- Generates probability and binary interaction predictions
🧰 Dependencies
The tool was developed using Python 3.10. Install the following dependencies before running the script:
pip install torch==2.6.0 transformers==4.57.0 catboost==1.2.8 joblib tqdm numpy pandas
⚙️ Usage
1️⃣ Rapid (Composition-Based) Prediction
This mode uses simple % composition features (very fast).
python lncrnapi_cli.py -lf ./data/example_lncRNA.fasta -pf ./data/example_protein.fasta -wd ./output -model rapid
Model used:
./model/catboost_model_rapid.joblib
2️⃣ LLM (Embedding-Based) Prediction
This mode uses transformer embeddings from DNABERT2 (for lncRNA) and ESM2-T30 (for protein).
python lncrnapi_cli.py -lf ./data/example_lncRNA.fasta -pf ./data/example_protein.fasta -wd ./output -model llm
Model used:
./model/catboost_dnabert2_esm-t30.joblib
Arguments
| Argument | Description | Required |
|---|---|---|
-lf |
Path to the FASTA file containing lncRNA sequences. | ✅ |
-pf |
Path to the FASTA file containing protein sequences. | ✅ |
-wd |
Path to the working directory. | ✅ |
-model |
Choice of model to be used. | ✅ |
-t |
Threshold | ❌ |
💾 Output
A CSV file named output.csv is generated in the output directory:
| lncRNA_ID | Protein_ID | Interaction_Probability | Predicted_Label |
|---|---|---|---|
| lnc1 | P12345 | 0.87 | 1 |
| lnc1 | P67890 | 0.34 | 0 |
| ... | ... | ... | ... |
- Interaction_Probability: Probability predicted by CatBoost
- Predicted_Label: 1 → interaction, 0 → non-interaction
⚡ Hardware Acceleration
The script automatically detects and uses available hardware:
- ✅ CUDA GPU (NVIDIA)
- ✅ MPS (Apple Silicon)
- ⚠️ CPU (fallback)
🛠 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 |
📜 Citation
If you use this tool in your research, please cite:
** Choudhury et al.**
Prediction of lncRNA-protein interacting pairs using LLM embeddings based on evolutionary information (2025)
🧩 Repository Structure
├── lncrnapi_cli.py # Main CLI script
├── README.md
├── LICENSE
├── test_lncrna.fa
├── test_protein.fa
├── output.csv
└── models/
├── catboost_model_rapid.joblib
└── catboost_dnabert2_esm-t30.joblib
Metadata
Release files for lncrnapi 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lncrnapi-1.2.tar.gz | 1.9 MB | Without provenance | Details for lncrnapi-1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lncrnapi-1.2-py3-none-any.whl | Python 3 | none | any | Details for lncrnapi-1.2-py3-none-any.whl |
Total release size: 3.8 MB
Release files / lncrnapi-1.2.tar.gz
| Download URL | lncrnapi-1.2.tar.gz |
|---|---|
| Size | 1.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
413669292fb0d092040ead85aa03f02da91e21510ca3b2a3420fec7c814a1953
|
|
BLAKE2b-256 checksum How to use checksums |
1e52f3140613c6d265404aac937902445ab54443aab51e9cfa4e2a439ddae103
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.18
|
Release files / lncrnapi-1.2-py3-none-any.whl
| Download URL | lncrnapi-1.2-py3-none-any.whl |
|---|---|
| Size | 1.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de50404660bb4439f91ae8c50dce6cbf5b812774a7d52ccd4dd1d32876f299f4
|
|
BLAKE2b-256 checksum How to use checksums |
1245f45a6b087aca6cac649095afafc266f99a755cb825866d2a27efd42c9fa9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.18
|
Security for lncrnapi 1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.