Skip to content

Commit

Permalink
feat: upload tranlation and defaults for proteomics
Browse files Browse the repository at this point in the history
  • Loading branch information
ESCRI11 committed Jul 16, 2024
1 parent 8a8e3f7 commit 438b628
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 11 deletions.
8 changes: 7 additions & 1 deletion components/app/R/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ app_server <- function(input, output, session) {

## Modules needed from the start
if (opt$ENABLE_UPLOAD) {
UploadBoard(
upload_datatype <-UploadBoard(
id = "upload",
pgx_dir = PGX.DIR,
pgx = PGX,
Expand All @@ -225,6 +225,12 @@ app_server <- function(input, output, session) {
)
}

shiny::observeEvent(upload_datatype(), {
if (tolower(upload_datatype()) == "proteomics") {
shiny.i18n::update_lang("proteomics", session)
}
})


## Modules needed after dataset is loaded (deferred) --------------
observeEvent(env$load$is_data_loaded(), {
Expand Down
20 changes: 15 additions & 5 deletions components/board.upload/R/upload_module_computepgx.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,20 @@ upload_module_computepgx_server <- function(
function(input, output, session) {
ns <- session$ns
## statistical method for GENE level testing
GENETEST.METHODS <- c(
"ttest", "ttest.welch", "voom.limma", "trend.limma", "notrend.limma",
"deseq2.wald", "deseq2.lrt", "edger.qlf", "edger.lrt"
)
GENETEST.METHODS <- shiny::reactiveVal("")
shiny::observeEvent(upload_datatype(), {
if (tolower(upload_datatype()) == "proteomics") {
GENETEST.METHODS(
c("ttest", "ttest.welch", "trend.limma", "notrend.limma")
)
} else {
GENETEST.METHODS(
c("ttest", "ttest.welch", "voom.limma", "trend.limma", "notrend.limma",
"deseq2.wald", "deseq2.lrt", "edger.qlf", "edger.lrt")
)
}
})

## GENETEST.SELECTED <- c("trend.limma", "voom.limma", "deseq2.wald", "edger.qlf")
GENETEST.SELECTED <- c("ttest", "ttest.welch", "trend.limma", "notrend.limma")

Expand Down Expand Up @@ -148,7 +158,7 @@ upload_module_computepgx_server <- function(
shiny::checkboxGroupInput(
ns("gene_methods"),
shiny::HTML("<h4>Gene tests:</h4>"),
GENETEST.METHODS,
GENETEST.METHODS(),
selected = GENETEST.SELECTED
)
),
Expand Down
4 changes: 2 additions & 2 deletions components/board.upload/R/upload_module_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -682,12 +682,12 @@ upload_module_outliers_server <- function(
div("Normalize data values:\n"),
shiny::selectInput(ns("scaling_method"), NULL,
choices = c(
"LogCPM (default)" = "CPM", ## log2(nC+1)
"LogCPM" = "CPM", ## log2(nC+1)
"LogMaxMedian" = "logMaxMedian",
"LogMaxSum" = "logMaxSum",
"Skip normalization" = "Skip_normalization"
),
selected = "CPM"
selected = ifelse(tolower(upload_datatype()) == "proteomics", "logMaxMedian", "CPM")
),
shiny::checkboxInput(ns("quantile_norm"), "Quantile normalization", value = TRUE),
br()
Expand Down
5 changes: 3 additions & 2 deletions components/board.upload/R/upload_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ UploadBoard <- function(id,
recompute_pgx,
recompute_info,
inactivityCounter,
new_upload) {
new_upload, session2) {
moduleServer(id, function(input, output, session) {
ns <- session$ns ## NAMESPACE

Expand Down Expand Up @@ -839,7 +839,7 @@ UploadBoard <- function(id,
scrollY = "calc(50vh - 140px)",
width = c("auto", "100%"),
height = c("100%", TABLE_HEIGHT_MODAL),
title = "Uploaded Counts",
title = ifelse(tolower(upload_datatype()) == "proteomics", "Uploaded Expression", "Uploaded Counts"),
info.text = "This is the uploaded counts data.",
caption = "This is the uploaded counts data."
)
Expand Down Expand Up @@ -941,5 +941,6 @@ UploadBoard <- function(id,
## ------------------------------------------------
## Board return object
## ------------------------------------------------
return(upload_datatype)
})
}
2 changes: 1 addition & 1 deletion components/board.upload/R/upload_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ UploadUI <- function(id) {
)

counts_ui <- wizardR::wizard_step(
step_title = "Step 2: Upload counts",
step_title = tspan("Step 2: Upload counts"),
step_id = "step_counts",
upload_table_preview_counts_ui(
ns("counts_preview")
Expand Down
4 changes: 4 additions & 0 deletions etc/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
{
"RNA-seq": "Counts boxplots",
"proteomics": "Abundance boxplots"
},
{
"RNA-seq": "Step 2: Upload counts",
"proteomics": "Step 2: Upload expression"
}
]
}

0 comments on commit 438b628

Please sign in to comment.