discoServer: Shiny Module – disco plots

View source: R/disco.R

discoUIR Documentation

Shiny Module – disco plots

Description

Shiny Module – disco plots

Usage

discoUI(id, cntr_titles)

discoServer(
  id,
  cntr,
  annot = NULL,
  selcols = c("PrimaryID", "ENTREZ", "SYMBOL"),
  primary_id = "PrimaryID",
  gene_id = NULL
)

Arguments

id

identifier of the shiny module (character vector)

cntr_titles

character vector containing the IDs of the contrasts (same as names(cntr)).

cntr

list of data frames containing the contrast information. Data frames must have the columns log2FoldChange and pvalue. Rownames of the data frames should be IDs.

annot

Annotation data frame. The annotation data frame must have a column named "PrimaryID" which corresponds to the rownames of the data frames in the cntr list.

selcols

which column in the gene table when genes are selected from the plot

primary_id

name of the contrast data frame column with the primary IDs

gene_id

must be a reactiveValues object. If not NULL, then clicking on a gene identifier will modify this object (possibly triggering an event in another module).

Value

Returns a reactive expression returning the ID of the activated gene

Examples

if(interactive()) {
    cntr1 <- data.frame(log2FoldChange=rnorm(5000),
                        pvalue=runif(5000),
                        PrimaryID=paste0("ID", 1:5000))
    cntr2 <- data.frame(log2FoldChange=cntr1$log2FoldChange + 
                                       rnorm(5000),
                        pvalue=runif(5000) * cntr1$pvalue,
                        PrimaryID=paste0("ID", 1:5000))
    cntr1$SecondaryID <- sample(cntr1$PrimaryID, replace=TRUE)
    cntr2$SecondaryID <- sample(cntr2$PrimaryID, replace=TRUE)
    rownames(cntr2) <- paste0("ID", 1:5000)
    cntr <- list("Contrast 1"=cntr1, "Contrast 2"=cntr2)
    shinyApp(ui=fluidPage(discoUI("disco", names(cntr))),
             server=function(input, output, session) {
                discoServer("disco", cntr)
             })
}


bihealth/bioshmods documentation built on July 1, 2023, 4:32 a.m.