Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions R/module-statmodel-server.R
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,7 @@ statmodelServer = function(id, parent_session, loadpage_input, qc_input,
req(input[[NAMESPACE_STATMODEL$visualization_view_results]])
ns = session$ns

if (loadpage_input()$BIO == "PTM") {
output_plot = renderPlot({
create_group_comparison_plot(
input, loadpage_input(), data_comparison()
)
})

} else if (input[[NAMESPACE_STATMODEL$visualization_plot_type]] ==
if (input[[NAMESPACE_STATMODEL$visualization_plot_type]] ==
CONSTANTS_STATMODEL$plot_type_response_curve) {
if (app_template() == TEMPLATES$protein_turnover) {
req(turnover_ratios())
Expand Down
10 changes: 8 additions & 2 deletions R/statmodel-server-visualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,21 @@ create_group_comparison_plot = function(input, loadpage_input, data_comparison)
stop('** Cannot generate multiple plots in a screen. Please refine selection or save to a pdf. **')
}
if (loadpage_input$BIO == "PTM") {
plot_result = groupComparisonPlotsPTM(
result = groupComparisonPlotsPTM(
data_comparison,
input[[NAMESPACE_STATMODEL$visualization_plot_type]],
sig = input[[NAMESPACE_STATMODEL$visualization_volcano_significance_cutoff]],
FCcutoff = fold_change_cutoff,
logBase.pvalue = as.integer(input[[NAMESPACE_STATMODEL$visualization_logp_base]]),
ProteinName = TRUE,
which.Comparison = input[[NAMESPACE_STATMODEL$visualization_which_comparison]],
address = FALSE
address = FALSE,
isPlotly = TRUE
)
# groupComparisonPlotsPTM returns `result` as a list where element 3 is
# the adjusted-peptide plot and element 1 is the unadjusted fallback;
# prefer the adjusted plot (result[[3]]) when available.
plot_result = if (length(result) >= 3) result[[3]] else result[[1]]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
} else if (loadpage_input$DDA_DIA == "TMT") {
plot_result = groupComparisonPlots(
data = data_comparison$ComparisonResult,
Expand Down Expand Up @@ -131,6 +136,7 @@ create_group_comparison_plot = function(input, loadpage_input, data_comparison)
}, error = function(e) {
remove_modal_spinner()
showNotification(conditionMessage(e), type = "error", duration = 8)
NULL
})
}
#' Get filename for plot download based on plot type
Expand Down
Loading