Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • a78cb8f
  • /
  • module
  • /
  • Selgroup.R
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:a77143948f46a71c32a1553b64969535134f6daa
directory badge
swh:1:dir:c2fbeb3a282ae4e712de69c4c8697d75059f7bda

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Selgroup.R
### Author: Franck Soubès
### Bioinformatics Master Degree - University of Bordeaux, France
### Link: https://github.com/GeT-TRiX/MA_Trix_App/
### Where: GET-TRiX's facility
### Application: MATRiX is a shiny application for Mining and functional Analysis of TRanscriptomics data
### Licence: GPL-3.0


#' checkboxElements is a global namespace containing a list of shiny widgets to check group or comparison(s)
#'
#' @param id Shiny id
#'
#' @return Widgets in the gui
#'
#' @export
#'
checkboxElements <- function(id){
  ns <- NS(id)
  tagList(
    uiOutput(ns("usercheck")),
    actionButton(
      inputId = ns("allcomphm"),label= "Select all" ,icon = icon("check-square-o"),
      style ="color: #fff; background-color: #337ab7; border-color: #2e6da4"
    ),
    actionButton(
      inputId = ns("nocomphm"),label= "Clear selection" ,icon = icon("square-o"),
      style ="color: #fff; background-color: #337ab7; border-color: #2e6da4"
    )
  )
}

#' boxChooser is a shiny module which aims is to allows users to select group(s) or comparison(s)
#'
#' @param input Internal
#' @param output Internal
#' @param session Internal
#' @param label Label associate to the widget
#' @param data A Reactive expression containing a character vector of each group(s) or contrast(s)
#' @param group A Reactive dataframe corresponding to the pData
#' @param case A Numeric value
#' @param empty A boolean value (if true all the box are selected)
#'
#' @return A reactive vector containing the selected box
#'
#' @export
#'

boxChooser <- function(input, output, session, label, data, group, case, empty =F) {
  
  isinline <- reactiveValues(inline = F)
  
  observe({
    req(group()[[2]]$Grp)
    isinline$format <- ifelse(length(levels(group()[[2]]$Grp)) >= 6, T, F)
  })

  output$usercheck <- renderUI({
    
    ns <- session$ns
    groupinline <- ifelse(length(levels(group()[[2]]$Grp)) >= 6, T, F)
    case = ifelse(empty,  2, 1)
    checkboxGroupInput(
      ns("box"),
      label,
      choices =data(),
      selected =  switch(case,data(), NULL),
      inline = isinline$format
    )

  })

  #Select all the contrasts
  observeEvent(input$allcomphm, {
    updateCheckboxGroupInput(
      session,
      "box",
      label ,
      choices = data(),
      selected = data(),
      inline = isinline$format
    )
  })

  #Unselect all the contrasts
  observeEvent(input$nocomphm, {
    updateCheckboxGroupInput(session,
                             "box",
                             label ,
                             choices = data(),
                             inline= isinline$format
    )
  })



return(reactive({
  switch(case, group()[[2]][group()[[2]]$Grp %in% input$box,], input$box)
  }))
}

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API