Skip to content

Commit

Permalink
[UPD] - new version of readQFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
leopoldguyot committed Jul 11, 2024
1 parent 5030820 commit 151cf5f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ Suggests:
rmarkdown,
BiocStyle
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
VignetteBuilder: knitr
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ importFrom(MultiAssayExperiment,getWithColData)
importFrom(QFeatures,QFeatures)
importFrom(QFeatures,addAssayLink)
importFrom(QFeatures,filterFeatures)
importFrom(QFeatures,readQFeatures)
importFrom(QFeatures,zeroIsNA)
importFrom(RColorBrewer,brewer.pal)
importFrom(SummarizedExperiment,assay)
Expand Down Expand Up @@ -38,7 +39,6 @@ importFrom(plotly,layout)
importFrom(plotly,plot_ly)
importFrom(plotly,plotlyOutput)
importFrom(plotly,renderPlotly)
importFrom(scp,readSCP)
importFrom(shiny,NS)
importFrom(shiny,actionButton)
importFrom(shiny,checkboxInput)
Expand Down
2 changes: 1 addition & 1 deletion R/interface_import_tab.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import_tab <- function() {
),
column(
width = 6,
box_readscp_ui("readscp")
box_readqfeatures_ui("readqfeatures")
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#' @param id module id
#'
#' @return A shinydashboardPlus box object that contains the UI components to create an preview a QFeatures object
#' @rdname INTERNAL_box_readscp_ui
#' @rdname INTERNAL_box_readqfeatures_ui
#' @keywords internal
#'
#' @importFrom shiny tagList selectInput checkboxInput actionButton downloadButton NS
#' @importFrom shinydashboardPlus box
#' @importFrom DT dataTableOutput
#'
box_readscp_ui <- function(id) {
box_readqfeatures_ui <- function(id) {
tagList(
box(
title = "QFeatures Converter",
Expand All @@ -35,13 +35,13 @@ box_readscp_ui <- function(id) {
style = "font-size: 14px;"
),
selectInput(
inputId = NS(id, "batch_col"),
"Batch column :",
inputId = NS(id, "run_col"),
"Run/Batch column :",
choices = NULL
),
selectInput(
inputId = NS(id, "channel_col"),
"Channel column :",
inputId = NS(id, "quant_cols"),
"Quantitative column :",
choices = NULL
),
checkboxInput(
Expand All @@ -56,7 +56,7 @@ box_readscp_ui <- function(id) {
),
checkboxInput(
inputId = NS(id, "singlecell"),
label = "Single cell data",
label = "Single cell data (WIP)",
value = FALSE
),
actionButton(
Expand Down
4 changes: 2 additions & 2 deletions R/server_import_tab.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ server_import_tab <- function(
id = "sample",
given_table = sample_table
)
box_readscp_server(
"readscp",
box_readqfeatures_server(
"readqfeatures",
imported_input,
imported_sample
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#' A server module that contains the server logic to the readscp box module
#' A server module that contains the server logic to the readQFeatures box module
#'
#' @param id module id
#' @param input_table a reactiveVal containing the input table
#' @param sample_table a reactiveVal containing the sample table
#'
#' @return A QFeatures object
#' @rdname INTERNAL_box_readscp_server
#' @rdname INTERNAL_box_readqfeatures_server
#' @keywords internal
#'
#' @importFrom shiny is.reactive reactive moduleServer observe eventReactive updateSelectInput removeModal downloadHandler
#' @importFrom DT renderDataTable datatable
#' @importFrom scp readSCP
#' @importFrom QFeatures readQFeatures
#' @importFrom QFeatures zeroIsNA
#' @importFrom SummarizedExperiment assay
#'
box_readscp_server <- function(id, input_table, sample_table) {
box_readqfeatures_server <- function(id, input_table, sample_table) {
stopifnot(is.reactive(input_table))
stopifnot(is.reactive(sample_table))

Expand All @@ -24,13 +24,13 @@ box_readscp_server <- function(id, input_table, sample_table) {
"can be quite time consuming for large data sets",
sep = " "
))
print(typeof(unique(sample_table()[[input$quant_cols]])))
global_rv$qfeatures <- error_handler(
scp::readSCP,
component_name = "QFeatures converting (readSCP)",
featureData = input_table(),
QFeatures::readQFeatures,
component_name = "QFeatures converting (readQFeatures)",
assayData = input_table(),
colData = sample_table(),
batchCol = input$batch_col,
channelCol = input$channel_col,
runCol = input$run_col,
removeEmptyCols = input$removeEmptyCols,
verbose = FALSE
)
Expand Down Expand Up @@ -60,11 +60,11 @@ box_readscp_server <- function(id, input_table, sample_table) {
observe({
input$reload_button
updateSelectInput(session,
"batch_col",
"run_col",
choices = colnames(sample_table())
)
updateSelectInput(session,
"channel_col",
"quant_cols",
choices = colnames(sample_table())
)
})
Expand Down

0 comments on commit 151cf5f

Please sign in to comment.