Skip to content
Open
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
42 changes: 27 additions & 15 deletions R/module-qc-server.R
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,19 @@ qcServer <- function(input, output, session,parent_session, loadpage_input,get_d
which.Protein = protein,
originalPlot = original,
summaryPlot = input$summ,
address = file, isPlotly = TRUE
address="Ex_", isPlotly = TRUE
)[[1]]
return(plot)
# return(plot)

} else if (loadpage_input()$BIO == "PTM"){

dataProcessPlotsPTM(preprocess_data(),
plot <- dataProcessPlotsPTM(preprocess_data(),
type=input$type1,
which.PTM = protein,
originalPlot = original,
summaryPlot = input$summ,
address = file)
address="Ex_", isPlotly = TRUE)[[1]]
# return(plot)

} else{
plot <- dataProcessPlots(data = preprocess_data(),
Expand All @@ -194,12 +196,14 @@ qcServer <- function(input, output, session,parent_session, loadpage_input,get_d
originalPlot = original,
summaryPlot = input$summ,
save_condition_plot_result = FALSE,
address = file,
address="Ex_",
isPlotly = TRUE

)[[1]]
return(plot)
# return(plot)
}
enable("plotresults_qc")
return(plot)
}
else {
return(NULL)
Expand Down Expand Up @@ -367,17 +371,25 @@ qcServer <- function(input, output, session,parent_session, loadpage_input,get_d
# }
# })


### OUTPUT ####
output$plotresults_qc = downloadHandler(
filename = function() {
paste("SummaryPlot-", Sys.Date(), ".zip", sep="")
},
content = function(file) {
files <- list.files(getwd(), pattern = "^Ex_", full.names = TRUE)
file_info <- file.info(files)
latest_file <- files[which.max(file_info$mtime)]
print(latest_file)
file.copy(latest_file, file)
}
)

output$showplot = renderUI({
ns<- session$ns

# PTM plotly plots are still under development
if (loadpage_input()$BIO == "PTM") {
output$theplot = renderPlot(theplot())
op <- plotOutput(ns("theplot"))
} else {
output$theplot = renderPlotly(theplot())
op <- plotlyOutput(ns("theplot"))
}
output$theplot = renderPlotly(theplot())
op <- plotlyOutput(ns("theplot"))

tagList(
op,
Expand Down
6 changes: 4 additions & 2 deletions R/module-qc-ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,18 @@ qcUI <- function(id) {
"No feature legend"="NA"))

),

p("Use the camera icon on the top right of the plot to download as PNG"),
uiOutput(ns("Which")),
tags$br()
),
# conditionalPanel(condition="$('html').hasClass('shiny-busy')",
# tags$br(),
# tags$br(),
# tags$h4("Calculation in progress...")),
uiOutput(ns("showplot")),
disabled(downloadButton(ns("plotresults_qc"), "Save plot results as Zip")),
uiOutput(ns("showplot"))
# disabled(downloadButton(ns("saveplot"), "Save this plot"))

),
tabPanel("Download Data",
#verbatimTextOutput('effect'),
Expand Down
50 changes: 29 additions & 21 deletions R/module-statmodel-server.R
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,31 @@ statmodelServer <- function(input, output, session,parent_session, loadpage_inpu
}

if (loadpage_input()$BIO=="PTM"){
plot1 = groupComparisonPlotsPTM(data_comparison(),
input$typeplot,
sig=input$sig,
FCcutoff=input$FC,
logBase.pvalue=as.integer(input$logp),
ProteinName = input$pname,
which.Comparison = input$whichComp,
address = FALSE)

tryCatch({
if(toupper(input$typeplot) == "COMPARISONPLOT") {
remove_modal_spinner()
stop( 'Comparison Plot is not offered by MSstatsPTM at the moment' )
}
plot = groupComparisonPlotsPTM(data_comparison(),
input$typeplot,
sig=input$sig,
FCcutoff=input$FC,
logBase.pvalue=as.integer(input$logp),
ProteinName = input$pname,
numProtein=input$nump,
which.Comparison = input$whichComp,
address = "Ex_",
isPlotly = TRUE)
if(length(plot) == 3) { # return adjusted if we have it
plot1 = plot[[3]]
} else {
plot1 = plot[[1]]
}
remove_modal_spinner()
},error = function(e){
remove_modal_spinner()
stop( '** Cannnot generate multiple plots in a screen. Please refine selection or save to a pdf. **' )}
)

} else if(loadpage_input()$DDA_DIA=="TMT"){
tryCatch({
Expand Down Expand Up @@ -717,18 +733,10 @@ statmodelServer <- function(input, output, session,parent_session, loadpage_inpu

observeEvent(input$viewresults, {
ns <- session$ns
# PTM plotly plots are still under development
if (loadpage_input()$BIO == "PTM") {
output$comp_plots = renderPlot({
group_comparison(FALSE, FALSE)
})
op <- plotOutput(ns("comp_plots"))
} else {
output$comp_plots = renderPlotly({
group_comparison(FALSE, FALSE)
})
op <- plotlyOutput(ns("comp_plots"), height = input$height)
}
output$comp_plots = renderPlotly({
group_comparison(FALSE, FALSE)
})
op <- plotlyOutput(ns("comp_plots"), height = input$height)
insertUI(
selector = paste0("#", ns("comparison_plots")),
ui=tags$div(
Expand Down
5 changes: 4 additions & 1 deletion R/module-statmodel-ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ statmodelUI <- function(id) {
Volcano Plot comparison, you must save the results \
as a HTML."),
conditionalPanel(
condition = "input['loadpage-BIO'] !== 'PTM'",
condition = "input['loadpage-BIO'] == 'PTM' && input['statmodel-typeplot'] == 'ComparisonPlot'",
p("Comparison Plot is not offered by MSstatsPTM at the moment")),
conditionalPanel(
condition = "input['loadpage-BIO'] !== 'PTM_'",
actionButton(ns("viewresults"),
"View plot in browser (only for one \
comparison/protein)")),
Expand Down