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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ biocViews: ImmunoOncology, MassSpectrometry, Proteomics, Software, ShinyApps,
BugReports: https://github.com/Vitek-Lab/MSstatsShiny/issues
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
Config/testthat/edition: 3
Config/roxygen2/version: 8.0.0
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ importFrom(tools,file_ext)
importFrom(utils,capture.output)
importFrom(utils,head)
importFrom(utils,packageVersion)
importFrom(utils,read.csv)
importFrom(utils,read.delim)
importFrom(utils,read.table)
importFrom(utils,txtProgressBar)
importFrom(utils,write.csv)
importFrom(utils,write.table)
Expand Down
2 changes: 1 addition & 1 deletion R/MSstatsShiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#' @importFrom MSstatsPTM dataProcessPlotsPTM groupComparisonPlotsPTM MaxQtoMSstatsPTMFormat PDtoMSstatsPTMFormat FragPipetoMSstatsPTMFormat SkylinetoMSstatsPTMFormat MetamorpheusToMSstatsPTMFormat SpectronauttoMSstatsPTMFormat
#' @importFrom MSstatsBioNet exportNetworkToHTML deleteEdgeFromNetwork
#' @importFrom MSstatsResponse futureExperimentSimulation run_tpr_simulation plot_tpr_power_curve calculateTurnoverRatios
#' @importFrom utils capture.output head packageVersion read.csv read.delim write.csv
#' @importFrom utils capture.output head packageVersion write.csv
#' @importFrom stats aggregate
#' @importFrom methods is
#' @importFrom readxl read_excel
Expand Down
26 changes: 12 additions & 14 deletions R/module-loadpage-server.R
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ loadpageServer <- function(id, parent_session, is_web_server = FALSE, app_templa
ui_elements <- tagList(ui_elements, create_spectronaut_standard_ui(session$ns))
}

tagList(ui_elements, create_separator_buttons(session$ns, "sep_specdata"))
ui_elements
})

output$spectronaut_turnover_ui <- renderUI({
Expand Down Expand Up @@ -305,7 +305,6 @@ loadpageServer <- function(id, parent_session, is_web_server = FALSE, app_templa
# enable("proceed1")
# })

# can remove separator is.null check because shiny by default assigns the first value as the default value for radiobutton
observe({
disable("proceed1")
if(((input$BIO == "Protein") || (input$BIO == "Peptide"))) {
Expand All @@ -316,38 +315,37 @@ loadpageServer <- function(id, parent_session, is_web_server = FALSE, app_templa
enable("proceed1")
}
} else if (input$filetype == "msstats") {
if(!is.null(input$msstatsdata) && !is.null(input$sep_msstatsdata)) {
if(!is.null(input$msstatsdata)) {
enable("proceed1")
}
} else if (input$filetype == "sky") {
print(input$sep_skylinedata)
if(!is.null(input$skylinedata) && !is.null(input$sep_skylinedata)) { # && !is.null(input$annot)
if(!is.null(input$skylinedata)) {
enable("proceed1")
}
} else if (input$filetype == "maxq") {
if(!is.null(input$evidence) && !is.null(input$pGroup)) { # && !is.null(input$annot1)
enable("proceed1")
}
} else if (input$filetype == "prog" || input$filetype == "PD" || input$filetype == "open" || input$filetype == "phil" || input$filetype == "meta") {
if(!is.null(input$data) && !is.null(input$sep_data)) { # && !is.null(input$annot)
if(!is.null(input$data)) {
enable("proceed1")
}
} else if (input$filetype == "openms") {
if(!is.null(input$data) && !is.null(input$sep_data)) {
if(!is.null(input$data)) {
enable("proceed1")
}
} else if (input$filetype == "spec") {
spec_regular_file_ok <- !isTRUE(input$big_file_spec) && !is.null(input$specdata)
spec_big_file_ok <- isTRUE(input$big_file_spec) && length(local_big_file_path()) > 0
if((spec_regular_file_ok || spec_big_file_ok) && !is.null(input$sep_specdata)) {
if(spec_regular_file_ok || spec_big_file_ok) {
enable("proceed1")
}
} else if (input$filetype == "ump") {
if(!is.null(input$fragSummary) && !is.null(input$peptideSummary) && !is.null(input$protSummary)) { #&& !is.null(input$annot2)
enable("proceed1")
}
} else if (input$filetype == "diann") {
if(!is.null(input$dianndata) && !is.null(input$sep_dianndata)) { # && !is.null(input$annot)
if(!is.null(input$dianndata)) {
enable("proceed1")
}
}
Expand All @@ -362,29 +360,29 @@ loadpageServer <- function(id, parent_session, is_web_server = FALSE, app_templa
enable("proceed1")
}
} else if (input$filetype == "PD") {
if(!is.null(input$data) && !is.null(input$sep_data)) { # && !is.null(input$annot)
if(!is.null(input$data)) {
enable("proceed1")
}
} else if (input$filetype == "openms") {
if(!is.null(input$data) && !is.null(input$sep_data)) {
if(!is.null(input$data)) {
enable("proceed1")
}
} else if (input$filetype == "spmin" || input$filetype == "phil") {
if(!is.null(input$data) && !is.null(input$sep_data)) { # && !is.null(input$annot)
if(!is.null(input$data)) {
enable("proceed1")
}
}
}
}

}
else if ((input$BIO == "PTM")) {
if (input$DDA_DIA == "LType" || input$DDA_DIA == "TMT") {
if ((!is.null(input$filetype) && length(input$filetype) > 0)) {
if (input$filetype == "sample") {
enable("proceed1")
} else if (input$filetype == "msstats") {
if(!is.null(input$msstatsptmdata) && !is.null(input$sep_msstatsptmdata)) {
if(!is.null(input$msstatsptmdata)) {
enable("proceed1")
}
} else if (input$filetype == "sky" || input$filetype == "maxq" || input$filetype == "spec" || input$filetype == "PD" || input$filetype == "meta") {
Expand Down
31 changes: 5 additions & 26 deletions R/module-loadpage-ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ create_standard_uploads <- function(ns) {
condition = "(input['loadpage-filetype'] =='10col' || input['loadpage-filetype'] =='prog' || input['loadpage-filetype'] =='PD' || input['loadpage-filetype'] =='open'||
input['loadpage-filetype'] =='openms' || input['loadpage-filetype'] =='spmin' || input['loadpage-filetype'] == 'phil' || input['loadpage-filetype'] == 'meta') && input['loadpage-BIO'] != 'PTM'",
h4("4. Upload quantification dataset"),
fileInput(ns('data'), "", multiple = FALSE, accept = NULL),
create_separator_buttons(ns, "sep_data")
fileInput(ns('data'), "", multiple = FALSE, accept = NULL)
)
}

Expand All @@ -240,17 +239,15 @@ create_msstats_uploads <- function(ns) {
conditionalPanel(
condition = "input['loadpage-filetype'] == 'msstats' && (input['loadpage-BIO'] != 'PTM' && (input['loadpage-BIO'] != 'PTM' && input['loadpage-DDA_DIA'] != 'TMT'))",
h4("4. Upload data in MSstats Format"),
fileInput(ns('msstatsdata'), "", multiple = FALSE, accept = NULL),
create_separator_buttons(ns, "sep_msstatsdata")
fileInput(ns('msstatsdata'), "", multiple = FALSE, accept = NULL)
),

# PTM MSstats format
conditionalPanel(
condition = "input['loadpage-filetype'] == 'msstats' && (input['loadpage-BIO'] == 'PTM' || (input['loadpage-BIO'] == 'PTM' && input['loadpage-DDA_DIA'] == 'TMT'))",
h4("4. Upload PTM data in MSstats Format"),
fileInput(ns('msstatsptmdata'), "", multiple = FALSE, accept = NULL),
create_separator_buttons(ns, "sep_msstatsptmdata"),


h4("5. (Optional) Upload unmodified data in MSstats Format"),
fileInput(ns('unmod'), "", multiple = FALSE, accept = NULL),
tags$br()
Expand All @@ -264,8 +261,7 @@ create_skyline_uploads <- function(ns) {
conditionalPanel(
condition = "input['loadpage-filetype'] == 'sky' && input['loadpage-BIO'] != 'PTM'",
h4("4. Upload MSstats report from Skyline"),
fileInput(ns('skylinedata'), "", multiple = FALSE, accept = NULL),
create_separator_buttons(ns, "sep_skylinedata")
fileInput(ns('skylinedata'), "", multiple = FALSE, accept = NULL)
)
}

Expand All @@ -275,8 +271,7 @@ create_diann_uploads <- function(ns) {
conditionalPanel(
condition = "input['loadpage-filetype'] == 'diann' && input['loadpage-BIO'] != 'PTM'",
h4("4. Upload MSstats report from DIANN"),
fileInput(ns('dianndata'), "", multiple = FALSE, accept = NULL),
create_separator_buttons(ns, "sep_dianndata")
fileInput(ns('dianndata'), "", multiple = FALSE, accept = NULL)
)
}

Expand Down Expand Up @@ -664,19 +659,3 @@ create_quality_filtering_options <- function(ns) {
)
)
}


#' Create column separator radio buttons
#'
#' @param ns Namespace function
#' @param input_id ID for the radio button input
#' @noRd
create_separator_buttons <- function(ns, input_id) {
radioButtons(ns(input_id),
label = h5("Column separator in uploaded file", class = "icon-wrapper",
icon("question-circle", lib = "font-awesome"),
div("Choose how columns are separated in the uploaded file", class = "icon-tooltip")),
c(Comma=",", Semicolon=";", Tab="\t", Pipe="|"),
inline = TRUE
)
}
4 changes: 2 additions & 2 deletions R/module-visualize-network-server.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ loadCsvData <- function(input, dataComparison) {
}
req(input$dataUpload)
tryCatch({
read.csv(input$dataUpload$datapath)
data.table::fread(input$dataUpload$datapath)
}, error = function(e) {
showNotification(paste("Error reading file:", e$message), type = "error")
return(NULL)
Expand Down Expand Up @@ -535,7 +535,7 @@ visualizeNetworkServer <- function(id, parent_session, dataComparison) {
codes <- paste(codes, "library(MSstatsBioNet)\nlibrary(dplyr)\n\n", sep = "")

codes <- paste(codes, "# Read data\n", sep = "")
codes <- paste(codes, "df <- read.csv(\"path/to/your/data.csv\")\n\n", sep = "")
codes <- paste(codes, "df <- data.table::fread(\"path/to/your/data.csv\")\n\n", sep = "")

# Add label filtering if not default
if (params$selectedLabel != "" && !is.null(params$selectedLabel)) {
Expand Down
4 changes: 2 additions & 2 deletions R/plotting_funtions.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
#' @importFrom grDevices dev.off pdf
#' @importFrom graphics image mtext par plot.new
#' @importFrom stats dist hclust qt
#' @importFrom utils read.table write.table
#' @importFrom utils write.table
#'
#' @examples
#' data("dia_skyline_model")
Expand Down Expand Up @@ -136,7 +136,7 @@ groupComparisonPlots2 = function(data=data,
}

finalfile = lastfilename
processout = as.matrix(read.table(finalfile, header=TRUE, sep="\t"))
processout = as.matrix(data.table::fread(finalfile))
}

processout = rbind(processout, as.matrix(c(" ", " ", "MSstats - groupComparisonPlots function", " "), ncol=1))
Expand Down
Loading
Loading