Supporting repository for the publication: The periphery of nuclear speckles defines a spatially and temporally regulated compartment of long-lived intron-retained RNAs that resolves during mitosis
This repository contains the Python notebooks, R scripts, R Markdown notebooks, shell wrappers, configuration files, and exported analysis outputs used to regenerate manuscript figures and train models to predict IR and IR HL.
.
├── README.md
├── environment-parnet_clean.yml
├── environment-tfmodisco.yml
├── environment-r.yml
├── requirements.txt
├── configs/
├── data/
├── notebooks/
├── R/
├── results/
└── scripts/
Three environments are used in this repository:
parnet-cleanfor metadata assembly, model training, UMAP export, CAM export, figure generation, and Python notebookstfmodiscofor motif discovery and motif report generationrfor the R analyses underR/
Create the main environment:
conda env create -f environment-parnet_clean.yml
conda activate parnet-cleanInstall the Python packages exported from the original parnet-clean environment:
pip install -r requirements.txtInstall ir_toolkit from GitHub:
pip install git+https://github.com/melonheader/ir_toolkit.gitCreate the dedicated motif-analysis environment separately:
conda env create -f environment-tfmodisco.yml
conda activate tfmodiscoThis environment provides modisco-lite together with the MEME suite tools used by tomtom.
Create the R environment for the analyses in R/:
conda env create -f environment-r.yml
conda activate rLaunch Jupyter from the main analysis environment:
conda activate parnet-clean
jupyter labUse the parnet-clean kernel for the notebooks in notebooks/. The tf-modisco step is executed through the shell wrapper and uses the dedicated tfmodisco environment internally.
Notebook guide:
notebooks/1.reassemble_metadata.ipynbRebuildsdata/metadata_selected.csvfrom the assembled source tables.notebooks/2.hl_revision_workflow.ipynbMain workflow notebook for run validation, retraining, UMAP export, CAM export, tf-modisco execution, and per-run plotting.notebooks/3.remake_fig3.ipynbRegenerates Figure 3 panels and associated source tables.notebooks/4.remake_sfig4.ipynbRegenerates Supplementary Figure 4 panels and associated source tables.notebooks/5.remake_sfig5.ipynbRegenerates Supplementary Figure 5 analyses and tables.notebooks/6.detained_introns_analysis.ipynbRuns the detained-intron follow-up analyses.notebooks/7.intron_motif_enrichment.ipynbRuns motif-enrichment analyses for intron subsets.
The R code is organized by figure:
R/Figure_1/Figure 1 length, GC content, and nuclear enrichment analysis.R/Figure_2/Figure 2 stability analysis notebook.R/Figure_4/Figure 4 TSA-seq overlap analysis.R/Figure_4_distance/RANDOM_SPOTS/Random-spot null-distribution analyses for iPS and HUVEC distance-to-speckle measurements.
These workflows assume they are launched from their local scripts/ directory. Example commands:
conda activate r
cd R/Figure_1/scripts
Rscript Figure_1_length_gc_nuclear_enrichment.R
cd ../../Figure_2/scripts
Rscript -e "rmarkdown::render('Figure_2.Rmd')"
cd ../../Figure_4/scripts
Rscript Figure_4_TSAseq_IR_stability.R
cd ../../Figure_4_distance/RANDOM_SPOTS/scripts
Rscript FINAL_iPS_IR_RNAS_vs_random_spots_KS.R
Rscript FINAL_HUVEC_IR_RNAS_vs_random_spots_KS.RThe workflow is defined by:
configs/hl_revision_runs.jsonscripts/hl_revision_pipeline.pyscripts/run_hl_revision_workflow.shscripts/run_all_hl_revision_workflow.shscripts/run_modisco_report.shnotebooks/2.hl_revision_workflow.ipynb
python scripts/hl_revision_pipeline.py list-runspython scripts/hl_revision_pipeline.py train --run hl_revised_50percgapFor a single run, the main wrapper is:
scripts/run_hl_revision_workflow.sh \
--run hl_revised_50percgap \
--train \
--umap \
--modisco-inputs \
--modisco-report \
--plots \
--cam-modes final_logit_linearized,branch_signed \
--motif-db /path/to/pwms_all_motifs_ids.memeFor all configured runs:
scripts/run_all_hl_revision_workflow.sh \
--train \
--cam-modes final_logit_linearized,branch_signedWith no stage flags, run_all_hl_revision_workflow.sh regenerates downstream outputs by default:
- UMAP embeddings
- tf-modisco inputs
- tf-modisco reports
- plot exports
The figure-remaking notebooks and plot-export scripts write outputs into:
results/plots/for manuscript figure panels, source CSVs, and statistics tablesresults/models/*/plot_exports/for per-run exported plotting tables and figures
To consolidate CSV statistics tables into a single workbook:
python scripts/merge_csv_to_xlsx.py \
--input-dir results/plots \
--output-xlsx results/plots/statistics_tables_unified.xlsxThe repository also includes the shell scripts used to download and process the PRJNA608890 raw sequencing data under scripts/raw_data/PRJNA608890/.
Included helpers:
scripts/raw_data/PRJNA608890/download_sra.shDownloads SRA accessions and converts them to compressed FASTQ files.scripts/raw_data/PRJNA608890/trim_reads.shRuns read trimming for the WGBS sample set.scripts/raw_data/PRJNA608890/process_WGBS.shBuilds the filtered Bismark genome index, aligns WGBS reads, deduplicates alignments, and extracts methylation calls.scripts/raw_data/PRJNA608890/process_ssDRIP.shTrims, aligns, and deduplicates the ssDRIP-seq reads.scripts/raw_data/PRJNA608890/process_ssDRIP_macs3.shCalls strand-specific ssDRIP peaks withmacs3.