From f39b4fd0472fe8a00824b9b40ea9dbd415efb817 Mon Sep 17 00:00:00 2001 From: tonywu1999 Date: Thu, 23 Apr 2026 15:32:45 -0400 Subject: [PATCH] fix(dataProcessPlots): Fix error bar caps / whiskers for profile plots for plotly visualization --- R/dataProcessPlots.R | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/R/dataProcessPlots.R b/R/dataProcessPlots.R index 0d8284da..76da2a7e 100644 --- a/R/dataProcessPlots.R +++ b/R/dataProcessPlots.R @@ -155,6 +155,7 @@ dataProcessPlots = function( og_plotly_plot <- .convertGgplot2Plotly(plot_i,tips=c("FEATURE","RUN","newABUNDANCE")) og_plotly_plot = .fixLegendPlotlyPlotsDataprocess(og_plotly_plot) og_plotly_plot = .fixCensoredPointsLegendProfilePlotsPlotly(og_plotly_plot) + og_plotly_plot = .fixErrorBarCapsPlotly(og_plotly_plot) if(toupper(featureName) == "NA") { og_plotly_plot = .retainCensoredDataPoints(og_plotly_plot) @@ -168,6 +169,7 @@ dataProcessPlots = function( summ_plotly_plot <- .convertGgplot2Plotly(plot_i,tips=c("FEATURE","RUN","newABUNDANCE")) summ_plotly_plot = .fixLegendPlotlyPlotsDataprocess(summ_plotly_plot) summ_plotly_plot = .fixCensoredPointsLegendProfilePlotsPlotly(summ_plotly_plot) + summ_plotly_plot = .fixErrorBarCapsPlotly(summ_plotly_plot) if(toupper(featureName) == "NA") { summ_plotly_plot = .retainCensoredDataPoints(summ_plotly_plot) } @@ -696,6 +698,15 @@ dataProcessPlots = function( plot } +.fixErrorBarCapsPlotly = function(plot, cap_width = 8) { + for (i in seq_along(plot$x$data)) { + if (!is.null(plot$x$data[[i]]$error_y)) { + plot$x$data[[i]]$error_y$width <- cap_width + } + } + plot +} + .fixLegendPlotlyPlotsVolcano = function(plot) { df <- data.frame(id = seq_along(plot$x$data), legend_entries = unlist(lapply(plot$x$data, `[[`, "name"))) # Create a mapping