R/Workflows/Protein/mod_Protein.R

Defines functions mod_Protein_server mod_Protein_ui

Documented in mod_Protein_server

btn_style <- "display:inline-block; vertical-align: middle; padding: 7px"

#source(file.path('.', 'mod_Protein_Description.R'), local=TRUE)$value
#source(file.path('.', 'mod_Protein_Normalization.R'), local=TRUE)$value



mod_Protein_ui <- function(id){
  ns <- NS(id)
}


#' @title xxx
#'
#' @description
#' This module contains the configuration informations for the corresponding pipeline.
#' It is called by the nav_pipeline module of the package Magellan
#'
#' @param id xxx
#'
#' @param dataIn The dataset
#'
#' @param steps.enabled A vector of boolen which has the same length of the steps
#' of the pipeline. xxx
#'
#' @param reset It is a remote command to reset the module. A boolen that
#' indicates is the pipeline has been reseted by a program of higher level
#' Basically, it is the program which has called this module
#'
#' @param status xxx
#'
#' @author Samuel Wieczorek
#'
#' @export
#'
#' @import shiny
#'
mod_Protein_server <- function(id,
                               dataIn = reactive({NULL}),
                               steps.enabled = reactive({NULL}),
                               remoteReset = reactive({FALSE}),
                               status = reactive({NULL})){

  #' @field global xxxx
  global <- list(
    VALIDATED = 1,
    UNDONE = 0,
    SKIPPED = -1
  )


  config <- reactiveValues(
    name = 'Protein',
    steps = c('Description', 'Normalization', 'Filtering'),
    mandatory = c(T, F, F)

  )

  ###-------------------------------------------------------------###
  ###                                                             ###
  ### ------------------- MODULE SERVER --------------------------###
  ###                                                             ###
  ###-------------------------------------------------------------###
  moduleServer(id, function(input, output, session) {
    ns <- session$ns

    rv <- reactiveValues(
      dataIn = NULL,
      dataOut = NULL,
      status = NULL,
      reset = NULL,
      steps.enabled = NULL
    )

    observeEvent(status(), { rv$status <- status()})

    # Initialization of the module
    observeEvent(steps.enabled(), ignoreNULL = TRUE, {
      if (is.null(steps.enabled()))
        rv$steps.enabled <- setNames(rep(FALSE, rv.process$length), rv.process$config$steps)
      else
        rv$steps.enabled <- steps.enabled()
    })


   # Return value of module
   # DO NOT MODIFY THIS PART
    list(config = reactive({config}),
         dataOut = reactive({rv$dataOut}),
         status = reactive({rv$status})
         )

  }
  )
}
samWieczorek/MSPipelines documentation built on May 6, 2021, 5:54 p.m.