Skip to content

Commit b2bb79b

Browse files
committed
10/11/2026
1 parent 0874efb commit b2bb79b

26 files changed

Lines changed: 227753 additions & 81 deletions

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ eCLIPSE/all_data_combined_38.txt
6161
eCLIPSE/BigExon_events.txt
6262
eCLIPSE/Exon_events_Rmats.txt
6363
eCLIPSE/Intron_events.txt
64+
eCLIPSE/INCLUSION_LEVELS_FULL-hg38-25-v251.tab.gz

‎Sups/CHARM_V2_NoNetwork.docx‎

-1.07 MB
Binary file not shown.

‎app.R‎

Lines changed: 89 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ schematic_b64 <- base64enc::dataURI(file = "www/charm_schematic.svg", mime = "im
2222

2323
source("plot_theme.R") # one font/size/style for every plot
2424
source("correlation_reference.R") # percentile / permutation-null context for correlations
25+
source("rmats_mapping.R") # rMATS IDs anchored on VAST-TOOLS IDs (Splicing tab)
2526
source("helper_functions.R")
2627

2728
# --- Data directory -----------------------------------------------------
@@ -50,6 +51,9 @@ qload <- function(name) {
5051
CORR_REF <- tryCatch(qload("Correlation_Reference"), error = function(e) NULL)
5152
# Same idea for binding profiles (built by build_binding_reference.R)
5253
BIND_REF <- tryCatch(qload("Binding_Correlation_Reference"), error = function(e) NULL)
54+
# VAST-TOOLS -> rMATS event ID cross-reference (built by eCLIPSE/map_vast_rmats_events.R). Optional: without
55+
# the file the "Show rMATS IDs" option is simply not offered.
56+
RMATS_MAP <- tryCatch(qload("RMATS_Event_Mapping"), error = function(e) NULL)
5357
# Taller plot box when the density panel is stacked under the bar plot
5458
corr_plot_height <- function(key) if (corr_has_ref(key)) "800px" else "500px"
5559

@@ -271,6 +275,10 @@ ui <- fluidPage(
271275
.charm-card-body { padding: 22px 24px 24px; }
272276
.charm-card-body h3 { margin: 4px 0 8px; font-weight: bold; }
273277
.charm-card-body p { margin: 0; }
278+
.charm-cards-three .charm-card { flex: 1 1 290px; max-width: 370px; }
279+
.charm-card-go { display: block; margin-top: 12px; font-size: 13px; font-weight: bold; color: #2c3e50; }
280+
.charm-modes { max-width: 760px; margin: 8px auto 0; }
281+
.charm-modes .charm-layer-go { display: none; }
274282
.charm-tutorial { text-align: center; margin: 16px 0 0; font-size: 14px; }
275283
.charm-footer { text-align: center; font-size: 12px; color: #666; max-width: 900px;
276284
margin: 0 auto; padding-top: 14px; border-top: 1px solid #e0e0e0; }
@@ -382,27 +390,30 @@ ui <- fluidPage(
382390
)
383391
),
384392

385-
# ── What each layer adds ────────────────────────────────────────────
393+
# ── The three layers (main modules): large cards ─────────────────────
386394
div(
387-
class = "charm-layers",
388-
div(class = "charm-layer",
395+
class = "charm-cards charm-cards-three",
396+
div(class = "charm-card",
389397
onclick = "Shiny.setInputValue('home_go_layer', 'Binding', {priority: 'event'});",
390-
div(class = "charm-layer-num", "1"),
391-
tags$h4("Binding"),
392-
tags$p("Where does an RBP bind, and what are its consequences? RNA splicing maps from eCLIP show where it binds around affected events, helping to separate direct targets from indirect ones."),
393-
tags$span(class = "charm-layer-go", "Open Binding \u2192")),
394-
div(class = "charm-layer",
398+
div(class = "charm-card-body",
399+
div(class = "charm-card-icon", fa("link", fill = "black", height = "2em")),
400+
tags$h3("Binding"),
401+
tags$p("Where does an RBP bind, and what are its consequences? RNA splicing maps from eCLIP show where it binds around affected events, helping to separate direct targets from indirect ones."),
402+
tags$span(class = "charm-card-go", "Open Binding \u2192"))),
403+
div(class = "charm-card",
395404
onclick = "Shiny.setInputValue('home_go_layer', 'Splicing', {priority: 'event'});",
396-
div(class = "charm-layer-num", "2"),
397-
tags$h4("Splicing"),
398-
tags$p("Which splicing events depend on the RBP? Changes in exon skipping and intron retention (dPSI) after knockdown, across VastDB-annotated events."),
399-
tags$span(class = "charm-layer-go", "Open Splicing \u2192")),
400-
div(class = "charm-layer",
405+
div(class = "charm-card-body",
406+
div(class = "charm-card-icon", fa("scissors", fill = "black", height = "2em")),
407+
tags$h3("Splicing"),
408+
tags$p("Which splicing events depend on the RBP? Changes in exon skipping and intron retention (dPSI) after knockdown, across VastDB-annotated events."),
409+
tags$span(class = "charm-card-go", "Open Splicing \u2192"))),
410+
div(class = "charm-card",
401411
onclick = "Shiny.setInputValue('home_go_layer', 'Expression', {priority: 'event'});",
402-
div(class = "charm-layer-num", "3"),
403-
tags$h4("Expression"),
404-
tags$p("Which genes and cellular programs change? Differential expression after knockdown, with Hallmark gene-set enrichment."),
405-
tags$span(class = "charm-layer-go", "Open Expression \u2192"))
412+
div(class = "charm-card-body",
413+
div(class = "charm-card-icon", fa("dna", fill = "black", height = "2em")),
414+
tags$h3("Expression"),
415+
tags$p("Which genes and cellular programs change? Differential expression after knockdown, with Hallmark gene-set enrichment."),
416+
tags$span(class = "charm-card-go", "Open Expression \u2192")))
406417
),
407418

408419
# ── Questions CHARM can answer ──────────────────────────────────────
@@ -429,25 +440,18 @@ ui <- fluidPage(
429440
# ── Entry points ────────────────────────────────────────────────────
430441
div(
431442
class = "charm-section",
432-
tags$h2("Start here"),
433443
div(
434-
class = "charm-cards",
435-
div(
436-
class = "charm-card",
437-
onclick = "Shiny.setInputValue('home_go_explore', Math.random());",
438-
div(class = "charm-card-body",
439-
div(class = "charm-card-icon", fa("globe", fill = "black", height = "2em")),
440-
tags$h3("Explore"),
441-
tags$p("Investigate how a known RBP affects expression, splicing, and binding, based on ENCODE's gene silencing series and eCLIP data."))
442-
),
443-
div(
444-
class = "charm-card",
445-
onclick = "Shiny.setInputValue('home_go_discover', Math.random());",
446-
div(class = "charm-card-body",
447-
div(class = "charm-card-icon", fa("map", fill = "black", height = "2em")),
448-
tags$h3("Discovery"),
449-
tags$p("Upload your own expression, splicing, or binding data to discover which RBPs are most likely altered in your biological system."))
450-
)
444+
class = "charm-layers charm-modes",
445+
div(class = "charm-layer",
446+
onclick = "Shiny.setInputValue('home_go_explore', Math.random());",
447+
div(class = "charm-layer-num", fa("globe", fill = "white", height = "0.9em")),
448+
tags$h4("Explore"),
449+
tags$p("Investigate how a known RBP affects expression, splicing, and binding, based on ENCODE's gene silencing series and eCLIP data.")),
450+
div(class = "charm-layer",
451+
onclick = "Shiny.setInputValue('home_go_discover', Math.random());",
452+
div(class = "charm-layer-num", fa("map", fill = "white", height = "0.9em")),
453+
tags$h4("Discovery"),
454+
tags$p("Upload your own expression, splicing, or binding data to discover which RBPs are most likely altered in your biological system."))
451455
# DISABLED: Network module intentionally commented out. Code kept intact for a future redesign; to restore, uncomment this block, the Home card, and the home_go_network observer. [Home card]
452456
# ,div(
453457
# class = "charm-card",
@@ -823,6 +827,15 @@ ui <- fluidPage(
823827
)
824828
)
825829
),
830+
# ---- Optional: show rMATS IDs (anchored on the VAST-TOOLS IDs) ----
831+
if (!is.null(RMATS_MAP)) conditionalPanel(
832+
condition = "input.splice_dataset != 'Similar RBPs'",
833+
div(
834+
style = "margin-top: 20px;",
835+
checkboxInput("splice_show_rmats", "Show rMATS event IDs", value = FALSE),
836+
tags$p(RMATS_DISCLAIMER_SHORT, style = "font-size: 12px; color: #666; margin-top: -8px;")
837+
)
838+
),
826839
conditionalPanel(
827840
condition = "input.splice_dataset == 'Similar RBPs'",
828841
selectizeInput("similar_rbps_select_splice", "Compare with specific RBPs (optional)", choices = NULL, multiple = TRUE, options = list(placeholder = "Select one or more RBPs")),
@@ -871,6 +884,9 @@ ui <- fluidPage(
871884
conditionalPanel(
872885
condition = "input.splice_mode == 'Explore' && input.splice_dataset != 'Similar RBPs'",
873886

887+
# --- Disclaimer, shown while "Show rMATS event IDs" is ticked ---
888+
uiOutput("splice_rmats_note"),
889+
874890
# --- Top panel: Event ID plot, shown when searched (server-controlled) ---
875891
uiOutput("splice_top_panel_ui"),
876892

@@ -1615,7 +1631,7 @@ server <- function(input, output, session) {
16151631
# plot's hover text. Leaving it in wrote raw <br> tags into the CSV --
16161632
# the on-screen table already excludes it the same way (see splice_volcano_table
16171633
# renderDT above), so the download should match what the user sees.
1618-
res$top_table %>% dplyr::select(-dplyr::any_of("text"))
1634+
splice_table_view(res$top_table, note = TRUE)
16191635
}),
16201636
"splicing_volcano_table"
16211637
)
@@ -1991,7 +2007,7 @@ server <- function(input, output, session) {
19912007
})
19922008
output$splice_volcano_table <- DT::renderDataTable({
19932009
req(result_splice())
1994-
result_splice()$top_table %>% select(-text)
2010+
splice_table_view(result_splice()$top_table)
19952011
}, rownames = FALSE, selection = "single", options = list(pageLength = 10))
19962012
}
19972013

@@ -2111,6 +2127,23 @@ server <- function(input, output, session) {
21112127
# Splicing Explore page: "event" or NULL (none).
21122128
splice_top_panel <- reactiveVal(NULL)
21132129

2130+
# ---- rMATS IDs (anchored on VAST-TOOLS IDs) ----
2131+
splice_rmats_on <- function() isTRUE(input$splice_show_rmats) && !is.null(RMATS_MAP)
2132+
2133+
# Table shown / downloaded in the Splicing volcano: internal "text" column dropped and, when requested,
2134+
# the rMATS columns inserted after Event.ID (the row order never changes).
2135+
splice_table_view <- function(tbl, note = FALSE) {
2136+
if (is.null(tbl)) return(NULL)
2137+
tbl <- dplyr::select(tbl, -dplyr::any_of("text"))
2138+
if (splice_rmats_on()) rmats_add_columns(tbl, RMATS_MAP, note = note) else tbl
2139+
}
2140+
2141+
output$splice_rmats_note <- renderUI({
2142+
req(splice_rmats_on())
2143+
div(class = "alert alert-warning", style = "font-size: 12.5px; padding: 8px 12px; margin-bottom: 10px;",
2144+
tags$b("About the rMATS IDs. "), RMATS_DISCLAIMER_LONG)
2145+
})
2146+
21142147
output$splice_top_panel_ui <- renderUI({
21152148
panel <- splice_top_panel()
21162149
if (is.null(panel)) return(NULL)
@@ -2134,7 +2167,11 @@ server <- function(input, output, session) {
21342167
splice_top_panel("event")
21352168

21362169
output$heatmap_splicing_dpsi <- renderPlot({
2137-
p <- plot_event_dpsi_barplot(charm_obj, event_id)
2170+
show_rmats <- splice_rmats_on()
2171+
p <- plot_event_dpsi_barplot(
2172+
charm_obj, event_id,
2173+
extra_subtitle = if (show_rmats) paste0("rMATS ID: ", rmats_label(event_id, RMATS_MAP)) else NULL,
2174+
extra_caption = if (show_rmats) "rMATS IDs mapped from VAST-TOOLS IDs by genomic coordinates (\u00b11 nt); dPSI from VAST-TOOLS" else NULL)
21382175
dl_store$event_dpsi(p)
21392176
p
21402177
})
@@ -3003,16 +3040,26 @@ server <- function(input, output, session) {
30033040
highlight_colors <- c("None" = "#CCCCCC", "RBP" = "#A10702", "Selected" = "#008057")
30043041
plot_df <- tbl
30053042
plot_df$point_color <- unname(highlight_colors[plot_df$highlight])
3043+
show_rmats <- splice_rmats_on()
3044+
if (show_rmats) {
3045+
plot_df <- rmats_add_columns(plot_df, RMATS_MAP)
3046+
plot_df$rmats <- plot_df[["rMATS ID"]]
3047+
}
3048+
tip <- if (show_rmats) "Event: {point.key}<br>rMATS: {point.rmats}" else "Event: {point.key}"
30063049

3007-
highcharter::hchart(
3050+
(if (show_rmats) highcharter::hchart(
3051+
plot_df, "scatter",
3052+
highcharter::hcaes(x = dPSI, y = Pdiff, color = point_color, key = Event.ID, rmats = rmats),
3053+
fast = TRUE
3054+
) else highcharter::hchart(
30083055
plot_df, "scatter",
30093056
highcharter::hcaes(x = dPSI, y = Pdiff, color = point_color, key = Event.ID),
30103057
fast = TRUE
3011-
) %>%
3058+
)) %>%
30123059
charm_hc_style() %>% highcharter::hc_title(text = paste0("Volcano Plot: ", rbp, " KD")) %>%
30133060
highcharter::hc_xAxis(title = list(text = "dPSI (shRNA - CTRL)")) %>%
30143061
highcharter::hc_yAxis(title = list(text = "PDiff")) %>%
3015-
highcharter::hc_tooltip(pointFormat = "Event: {point.key}") %>%
3062+
highcharter::hc_tooltip(pointFormat = tip) %>%
30163063
highcharter::hc_plotOptions(scatter = list(marker = list(radius = 5, lineWidth = 1, lineColor = "black"))) %>%
30173064
highcharter::hc_legend(enabled = FALSE) %>%
30183065
hc_add_click_input(output_id)
@@ -3424,7 +3471,7 @@ server <- function(input, output, session) {
34243471
# ---- Render table ----
34253472
output$splice_volcano_table <- DT::renderDataTable({
34263473
req(result_splice())
3427-
result_splice()$top_table %>% select(-text)
3474+
splice_table_view(result_splice()$top_table)
34283475
}, rownames = FALSE, selection = "single", options = list(pageLength = 10))
34293476

34303477
# ---- Shared function to update highlights ----
734 Bytes
Loading

‎binding_profile_PTBP1__RBFOX2_ES_summary.csv‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,33 @@
55
"Both Cells","Decreased events","All profile pairs",239881656,-0.178,17.1
66
"Both Cells","Decreased events","RBFOX2 profiles vs each other (different KD RBPs)",11175,-0.178,11.82
77
"Both Cells","Decreased events","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",149,-0.178,43.62
8-
"Both Cells","Increased + decreased together (inc line)","All profile pairs",478603831,-0.157,20.56
9-
"Both Cells","Increased + decreased together (inc line)","RBFOX2 profiles vs each other (different KD RBPs)",22350,-0.157,12.11
10-
"Both Cells","Increased + decreased together (inc line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",298,-0.157,26.17
11-
"Both Cells","Increased + decreased together (dec line)","All profile pairs",478603831,-0.178,17.05
12-
"Both Cells","Increased + decreased together (dec line)","RBFOX2 profiles vs each other (different KD RBPs)",22350,-0.178,10.65
13-
"Both Cells","Increased + decreased together (dec line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",298,-0.178,23.49
8+
"Both Cells","Inc + dec pooled (inc line)","All profile pairs",957228135,-0.157,20.59
9+
"Both Cells","Inc + dec pooled (inc line)","RBFOX2 profiles vs each other (different KD RBPs)",44850,-0.157,12.37
10+
"Both Cells","Inc + dec pooled (inc line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",597,-0.157,24.12
11+
"Both Cells","Inc + dec pooled (dec line)","All profile pairs",957228135,-0.178,17.08
12+
"Both Cells","Inc + dec pooled (dec line)","RBFOX2 profiles vs each other (different KD RBPs)",44850,-0.178,10.9
13+
"Both Cells","Inc + dec pooled (dec line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",597,-0.178,21.78
1414
"K562","Increased events","All profile pairs",231759685,-0.176,17.52
1515
"K562","Increased events","RBFOX2 profiles vs each other (different KD RBPs)",10878,-0.176,2.89
1616
"K562","Increased events","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",147,-0.176,0.68
1717
"K562","Decreased events","All profile pairs",235824903,-0.049,40.17
1818
"K562","Decreased events","RBFOX2 profiles vs each other (different KD RBPs)",10878,-0.049,15.02
1919
"K562","Decreased events","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",147,-0.049,42.18
20-
"K562","Increased + decreased together (inc line)","All profile pairs",467584588,-0.176,17.63
21-
"K562","Increased + decreased together (inc line)","RBFOX2 profiles vs each other (different KD RBPs)",21756,-0.176,4.55
22-
"K562","Increased + decreased together (inc line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",294,-0.176,10.2
23-
"K562","Increased + decreased together (dec line)","All profile pairs",467584588,-0.049,40.01
24-
"K562","Increased + decreased together (dec line)","RBFOX2 profiles vs each other (different KD RBPs)",21756,-0.049,11.26
25-
"K562","Increased + decreased together (dec line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",294,-0.049,21.77
20+
"K562","Inc + dec pooled (inc line)","All profile pairs",935173128,-0.176,17.66
21+
"K562","Inc + dec pooled (inc line)","RBFOX2 profiles vs each other (different KD RBPs)",43660,-0.176,4.63
22+
"K562","Inc + dec pooled (inc line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",589,-0.176,9.34
23+
"K562","Inc + dec pooled (dec line)","All profile pairs",935173128,-0.049,40.05
24+
"K562","Inc + dec pooled (dec line)","RBFOX2 profiles vs each other (different KD RBPs)",43660,-0.049,11.31
25+
"K562","Inc + dec pooled (dec line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",589,-0.049,19.69
2626
"HEPG2","Increased events","All profile pairs",217371675,-0.046,40.88
2727
"HEPG2","Increased events","RBFOX2 profiles vs each other (different KD RBPs)",10011,-0.046,21.3
2828
"HEPG2","Increased events","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",141,-0.046,18.44
2929
"HEPG2","Decreased events","All profile pairs",216892378,-0.142,23.4
3030
"HEPG2","Decreased events","RBFOX2 profiles vs each other (different KD RBPs)",10011,-0.142,8.43
3131
"HEPG2","Decreased events","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",141,-0.142,50.35
32-
"HEPG2","Increased + decreased together (inc line)","All profile pairs",434264053,-0.046,40.79
33-
"HEPG2","Increased + decreased together (inc line)","RBFOX2 profiles vs each other (different KD RBPs)",20022,-0.046,17.95
34-
"HEPG2","Increased + decreased together (inc line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",282,-0.046,39.72
35-
"HEPG2","Increased + decreased together (dec line)","All profile pairs",434264053,-0.142,23.5
36-
"HEPG2","Increased + decreased together (dec line)","RBFOX2 profiles vs each other (different KD RBPs)",20022,-0.142,10.98
37-
"HEPG2","Increased + decreased together (dec line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",282,-0.142,31.21
32+
"HEPG2","Inc + dec pooled (inc line)","All profile pairs",868548681,-0.046,40.88
33+
"HEPG2","Inc + dec pooled (inc line)","RBFOX2 profiles vs each other (different KD RBPs)",40186,-0.046,18.29
34+
"HEPG2","Inc + dec pooled (inc line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",565,-0.046,39.29
35+
"HEPG2","Inc + dec pooled (dec line)","All profile pairs",868548681,-0.142,23.58
36+
"HEPG2","Inc + dec pooled (dec line)","RBFOX2 profiles vs each other (different KD RBPs)",40186,-0.142,10.99
37+
"HEPG2","Inc + dec pooled (dec line)","RBFOX2__RBFOX2 vs the other RBFOX2 profiles",565,-0.142,29.73
2.33 KB
Loading

0 commit comments

Comments
 (0)