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
  • /
  • server
  • /
  • GetDEgenes.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:ff033b9a56e74998880475e18c1737bb88f59b6d
directory badge
swh:1:dir:b4f135b203230666f5e14abbaf58604b20e67ee4

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 ...
GetDEgenes.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


prefstat <- reactiveValues() #A reactive value to identify prefix for the foldchange

#' subsetstat is a reactive function that return a list containing multiple data frames
#' with the adj.P.val, logFC and P.value selected for the corresponding groups
#'
#' @param csvf Data frame corresponding to the restable
#'
#' @return subsetstat a reactive list of data frames
#'
#' @export


subsetstat <- reactive({

  req(csvf())

  adj = csvf()[[3]][, grep("^adj.P.Val|^FDR|^padj_",
                           names(csvf()[[3]]),
                           value = TRUE), drop= F]

  logfc = csvf()[[3]][, grep("^logFC|^log2FoldChange|^log2FC",
                             names(csvf()[[3]]),
                             value = TRUE), drop= F]

  pval = csvf()[[3]][, grep("^P.value|^PValue|^pvalue",
                            names(csvf()[[3]]),
                            value = TRUE), drop= F]

  vecstat = c("^adj.P.Val_","^padj_", "^FDR_", "^FDR.","^logFC_","^logFC.","^log2FoldChange_", "^P.value_", "^pvalue_", "^PValue_","^PValue." ) # Put your statistical prefix here for multitest comparisons

  subsetstat = list(adj,logfc,pval)
  subsetinfo = list()
  for(i in 1:length(subsetstat)){
    for(j in 1:length(vecstat)){
      if(any(grepl(vecstat[j], names(subsetstat[[i]]) )))
        subsetinfo[[i]] <- vecstat[j]

      names(subsetstat[[i]]) = gsub(
      pattern = vecstat[j],
      replacement = "",
      x = names(subsetstat[[i]]),
      perl = T
      )
    }

  }

  prefstat$greppre <- gsub(pattern= "\\^", subsetinfo, replacement = "")
  return(subsetstat)

})



# subsetcomp is a reactive function that return a list of data frame depending on the selected comparisons
#'
#' @param subsetstat list of three data frame corresponding to the grep of respectively Adj.pval, P.val and logFC columns
#' @param selected_test character corresponding to the defined contrast set by the user
#'
#' @return usergroup a reactive list containing three data frame for each contrast selected
#'
#' @export

subsetcomp <- reactive({

  req(selected_test(),subsetstat())
  subsetedcomp = list()
  for (i in 1:3)
    subsetedcomp[[i]] = (subset(subsetstat()[[i]],
                           select = selected_test()))

  return(subsetedcomp)
})



#' subsetDEG is a reactive function that return the indexes for the signficant genes


subsetDEG <- callModule(getDegenes, "deghm", data = subsetcomp , meth = reactive(input$decidemethod), case = 1 , maxDe = reactive(input$maxgen))


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