RNAPeaks: Visualize RNA-Binding Protein Peaks on Gene Structures
Source:R/RNAPeaks-package.R
RNAPeaks-package.RdRNAPeaks creates publication-quality visualizations of RNA-binding protein (RBP) peaks overlaid on gene structures. It supports single-gene plots, multi-gene genomic region plots, splicing maps, and sequence motif analysis around splice junctions. Integrates with GTF annotations from Ensembl via AnnotationHub.
Main Functions
The primary functions for generating plots are:
PlotGenePlot RBP peaks on a single gene structure. Use this when you want to visualize peaks on one specific gene.
PlotRegionPlot RBP peaks across a genomic region containing multiple genes. Use this for broader regional views.
createSplicingMapAnalyze protein binding frequency around splice junctions. Shows where RBPs bind relative to exon/intron boundaries in retained vs excluded splicing events.
createSequenceMapAnalyze sequence motif frequency around splice junctions. Identifies position-specific enrichment of motifs in different splicing event categories.
Included Data
The package includes sample data for testing:
sample_bedK562 cell line RBP binding peaks, ready to use
sample_se.matsSample SE.MATS output for splicing analysis
Workflow
A typical workflow involves:
Use the included
sample_beddata, OR load your own BED file and validate it withcheckBedLoad GTF annotation once with
LoadGTFand store locally (e.g.,gtf <- LoadGTF("Human"); save withsaveRDS(gtf, "gtf.rds")for future sessions)Call
PlotGeneorPlotRegion, passing the storedgtfobject
For splicing analysis:
Prepare SE.MATS output from rMATS or use
sample_se.matsCall
createSplicingMapwith BED and SE.MATS dataCall
createSequenceMapto analyze sequence motifs
Examples
if (FALSE) { # \dontrun{
library(RNAPeaks)
# Load GTF once and store locally (do this once per session)
gtf <- LoadGTF(species = "Human")
# Optionally save for future sessions to avoid re-downloading
saveRDS(gtf, "human_gtf.rds")
# In future sessions: gtf <- readRDS("human_gtf.rds")
# ----- Gene-level visualization -----
result <- PlotGene(
bed = sample_bed,
geneID = "GAPDH",
gtf = gtf
)
result$plot
# ----- Region-level visualization -----
PlotRegion(
bed = sample_bed,
Chr = "12",
Start = 56000000,
End = 56050000,
Strand = "+",
gtf = gtf
)
# ----- Splicing map analysis -----
createSplicingMap(
bed_file = sample_bed,
SEMATS = sample_se.mats
)
# ----- Sequence motif analysis -----
library(BSgenome.Hsapiens.UCSC.hg38)
createSequenceMap(
SEMATS = sample_se.mats,
sequence = "YCAY"
)
} # }