DeepRBP is a deep learningβbased framework designed to prioritize regulatory relationships between RNA-binding proteins (RBPs) and genes/transcripts from RNA-seq data.
It combines:
- a prediction module that estimates transcript abundance from gene and RBP expression, and
- an explainability module that computes interpretable RBPβtranscript and RBPβgene scores.
- Overview
- Installation
- Quick start: use the pretrained DeepRBP model
- Run the pretrained DeepRBP predictor on your data
- Data preparation
- Training a model from scratch (advanced)
- Additional module-specific documentation
- Citation
- License
Alternative splicing is a key regulatory mechanism in many biological processes and diseases, particularly cancer. RNA-binding proteins (RBPs) play a central role in this regulation, but experimentally identifying RBPβtarget interactions (e.g. via CLIP-based assays) is costly and limited in scope.
DeepRBP provides a computational alternative to prioritize putative RBPβgene and RBPβtranscript regulatory relationships from bulk RNA-seq data.
This repository provides:
- the full DeepRBP pipeline,
- scripts to preprocess RNA-seq data,
- a pretrained model,
- and tools to compute explainability scores.
For most users, the recommended workflow is:
- Download the pretrained model
- Prepare your data in the expected input format
- Run the predictor evaluator to check compatibility and performance
- Run the explainer to obtain TxRBP and GxRBP scores
- Python β₯ 3.9
- Linux or macOS
- (Optional but recommended) CUDA-enabled GPU
git clone https://github.com/ML4BM-Lab/DeepRBP.git
cd DeepRBP
conda create -n DeepRBP python=3.9
conda activate DeepRBP
pip install -e .We provide a pretrained DeepRBP predictor hosted on Hugging Face.
π Model repository https://huggingface.co/ML4BM-Lab/DeepRBP
The pretrained model consists of four required files:
model.ckptβ trained DeepRBP predictor checkpointscaler.joblibβ fitted input scalersigma.npyβ output scaling parameterDeepRBP_feature_spec.xlsxβ feature manifest (RBPs/genes/transcripts + exact order)
- Download the pretrained model bundle
Option A (recommended): download from Hugging Face using Git LFS The model checkpoint is stored using Git Large File Storage (Git LFS).
Install and initialize Git LFS
git lfs installIf git lfs is not available, install it first:
- macOS:
brew install git-lfs - Ubuntu/Debian:
sudo apt install git-lfs
Clone the pretrained model repository
git clone https://huggingface.co/ML4BM-Lab/DeepRBP pretrained_modelThis downloads all required files automatically.
If the repository is private, Hugging Face may ask for credentials. Use your Hugging Face username and an access token (not your password).
Option B: manual download If you prefer not to use Git LFS:
- Open:
https://huggingface.co/ML4BM-Lab/DeepRBP - Download:
model.ckptscaler.joblibsigma.npyDeepRBP_feature_spec.xlsx
- Place them together in a local folder.
- Recommended local layout
DeepRBP/
βββ pretrained_model/
β βββ model.ckpt
β βββ scaler.joblib
β βββ sigma.npy
β βββ DeepRBP_feature_spec.xlsx
βββ data/
β βββ my_dataset/
β β βββ RBPs_log2p_tpm.csv
β β βββ trans_log2p_tpm.csv
β β βββ gn_tpm.csv
β β βββ phenotype_metadata.csv # optional
β βββ annotations/
β βββ getBM.csv # required for some workflows
βββ output/
βββ src/
- Do I need data preparation or training? Use this rule of thumb:
- If you already have:
RBPs_log2p_tpm.csvtrans_log2p_tpm.csvgn_tpm.csv- optional
phenotype_metadata.csv
and they are aligned to DeepRBP_feature_spec.xlsx, you can run the pretrained model directly.
- If you do not yet have these files, go to Data preparation.
- If you want to change the feature set (RBPs/genes/transcripts) or train a new model, go to Training a model from scratch (advanced).
This is the recommended entry point for most users.
If your dataset is already formatted as DeepRBP expects, you do not need to retrain the model.
The recommended workflow is:
-
Run the pretrained DeepRBP predictor first
This verifies that your matrices are compatible with the pretrained model and provides standard performance metrics. -
Run the DeepRBP explainer second
This produces transcript-level and gene-level attribution scores.
DeepRBP expects the following files per dataset or per experimental group:
-
RBPs_log2p_tpm.csv RBP expression matrix (samples Γ RBPs), in log2(TPM + 1)
-
trans_log2p_tpm.csv Transcript expression matrix (samples Γ transcripts), in log2(TPM + 1)
-
gn_tpm.csv Gene expression matrix (samples Γ genes), in TPM
-
phenotype_metadata.csv (optional) Sample metadata (e.g. tissue, condition, or tumor type)
If your data can be converted into this format, it can be used by DeepRBP.
DeepRBP expects your matrices to match the feature manifest used during training:
DeepRBP_feature_spec.xlsx
This file defines:
- the list of RBPs, genes, and transcripts,
- and their exact order.
If you want to use a different feature set, you must preprocess accordingly and train a new model.
Some evaluation and downstream utilities require a frozen gene/transcript annotation mapping file:
data/annotations/getBM.csv
For pretrained-model compatibility, this file must match the annotation reference used to build DeepRBP_feature_spec.xlsx: GENCODE v23 / Ensembl 81 / GRCh38.p3.
The recommended way to obtain it is from the pretrained model bundle:
git clone https://huggingface.co/ML4BM-Lab/DeepRBP pretrained_model
mkdir -p data/annotations cp pretrained_model/getBM.csv data/annotations/getBM.csv
You can run the pretrained DeepRBP predictor on your processed dataset. This is the recommended first step for a new dataset.
It is useful to:
- verify that your inputs are compatible with the pretrained model,
- generate transcript-level predictions,
- obtain standard metrics (Spearman/Pearson/RΒ²/MSE).
Minimal predictor config (YAML)
# src/deeprbp/configs/config_model_eval.yaml
test_path_files: "data/my_dataset"
getBM_path: "data/annotations/getBM.csv"
gene_col_name: "Gene_ID"
trans_col_name: "Transcript_ID"
sample_category: "detailed_category" # optional; remove if not needed
cuda: True
val_batch_size: 256
plot_results: True
seed: 42
# IMPORTANT: use the scaler bundled with the pretrained model
scaler_dir: "pretrained_model"Run locally
run-deeprbp-evaluator \
--config_path src/deeprbp/configs/config_model_eval.yaml \
--model_checkpoint pretrained_model/model.ckpt \
--output_dir output/results/eval_pretrained \
--num_workers 4 \
--verbose 1This command runs the pretrained DeepRBP predictor on your dataset and reports standard performance metrics.
Run on HPC / SLURM
sbatch slurm/training_module/run_evaluate_predictor.shpretrained_model/model.ckpt, always evaluate with the bundled pretrained_model/scaler.joblib.
Do not refit a new scaler when using the pretrained checkpoint.
Once predictor compatibility has been confirmed, you can compute attribution scores with the DeepRBP explainer.
DeepRBP computes:
- TxRBP scores: transcript Γ RBP scores
- GxRBP scores: gene Γ RBP scores obtained by collapsing transcript scores to genes
By default, the explainer uses DeepLIFT.
Minimal explainer config (single-run mode) Use this when:
- your dataset has no TCGA-like categories, or
- you do not provide
phenotype_metadata.csv, or - you simply want one run over all samples.
# src/deeprbp/configs/config_model_explain.yaml
test_path_files: "data/my_dataset"
getBM_path: "data/annotations/getBM.csv"
gene_col_name: "Gene_ID"
trans_col_name: "Transcript_ID"
explanation_method: "DeepLIFT"
reference_data: "knockout_reference"
batch_reduction_method: "t-statistic"
gene_collapse_method: "max_absolute_value"
save_per_sample_scores: falseRun locally
run-deeprbp-explainer \
--config_path src/deeprbp/configs/config_model_explain.yaml \
--model_ckpt_path pretrained_model/model.ckpt \
--scaler_dir pretrained_model \
--output_dir output/results/explainer_all_samplesOptional: hidden-layer attributions You can also compute attributions to the last hidden layer (HL Γ RBP) by adding:
run-deeprbp-explainer \
--config_path src/deeprbp/configs/config_model_explain.yaml \
--model_ckpt_path pretrained_model/model.ckpt \
--scaler_dir pretrained_model \
--output_dir output/results/explainer_all_samples \
--analyze_hidden_layerRun on HPC / SLURM
cd slurm/explainability_module
# Standard run
sbatch run_explainer.sh
# Hidden-layer attributions
ANALYZE_HL=true sbatch run_explainer.shPredictor Typical outputs include:
- performance metrics,
- plots (if enabled), -prediction diagnostics.
Explainer Single-run mode typically produces:
<output_dir>/
df_scores_TxRBP.csv
df_scores_GxRBP.csv
result_table.csv
df_scores_TxRBP_per_sample.csv # only if save_per_sample_scores: true
df_scores_HLxRBP.csv # only with --analyze_hidden_layerUse this section only if you do not yet have DeepRBP-compatible input files:
RBPs_log2p_tpm.csvtrans_log2p_tpm.csvgn_tpm.csv- optional
phenotype_metadata.csv
This section explains how to convert raw RNA-seq quantifications into the format expected by the pretrained model and the explainer.
DeepRBP can be applied to any RNA-seq dataset, including:
- custom cancer cohorts,
- in-vitro experiments,
- RBP knockdown or perturbation studies.
At a high level, the required steps are:
- Quantify expression
- transcript-level TPMs,
- gene-level TPMs (e.g. Salmon, Kallisto, or equivalent)
- Build DeepRBP input matrices
- transcript TPM matrix,
- gene TPM matrix,
- RBP expression matrix (subset of genes),
- optional sample metadata
- Apply standard DeepRBP transformations
log2(TPM + 1)where required
- Export files using the expected filenames
RBPs_log2p_tpm.csvtrans_log2p_tpm.csvgn_tpm.csvphenotype_metadata.csv
If your samples were quantified with kallisto, DeepRBP provides a preprocessing pipeline that converts abundance.tsv files into DeepRBP-ready inputs using the same preprocessing logic as model training.
The pipeline expects:
- one folder per sample under kallisto_output/, each containing abundance.tsv,
- a metadata CSV with a Run column (sample IDs),
- the DeepRBP feature specification file.
preprocess-user-data \
--kallisto_output <DATASET_DIR>/kallisto_output \
--metadata_csv <DATASET_DIR>/metadata.csv \
--feature_spec pretrained_model/DeepRBP_feature_spec.xlsx \
--output_dir <DATASET_DIR>/deeprbp_inputs \
--group_col tissue_typeThis command creates one output folder per group (e.g. per tissue or condition), each containing:
RBPs_log2p_tpm.csvtrans_log2p_tpm.csvgn_tpm.csvphenotype_metadata.csv
Optional arguments allow further splitting (e.g. by tumor stage or cell line).
sbatch preprocess_datauser.sh \
--kallisto_output <DATASET_DIR>/kallisto_output \
--metadata_csv <DATASET_DIR>/metadata.csv \
--feature_spec pretrained_model/DeepRBP_feature_spec.xlsx \
--output_dir <DATASET_DIR>/deeprbp_inputs \
--group_col tissue_typeThis is functionally equivalent to direct execution and is recommended for large-scale preprocessing.
Most users do not need to train a model.
Training from scratch is only needed if you want to:
- reproduce the full training workflow,
- train on a large cohort such as TCGA,
- change the feature specification,
- or optimize a new architecture.
For that workflow, see:
src/deeprbp/training_module/README.mdThat documentation covers:
- TCGA download,
- feature specification,
- preprocessing for training,
- train/test splits,
- predictor training,
- and optional hyperparameter optimization.
The repository also includes additional documentation for specialized workflows:
src/deeprbp/training_module/README.mdsrc/deeprbp/explainability_module/README.mdsrc/deeprbp/explainability_module/postar_validation/README.mdsrc/deeprbp/explainability_module/real_knockdowns/README.mdsrc/deeprbp/explainability_module/complex_analysis/README.md
If you want to reproduce the TCGA experiments reported in the manuscript, including tumor-type/category runs and downstream validations, please follow the module-specific documentation in: src/deeprbp/explainability_module/README.md
If you use DeepRBP in your work, please cite:
DeepRBP: A novel deep neural network for inferring splicing regulation https://doi.org/10.1101/2024.04.11.589004