discoUI | R Documentation |
Shiny Module – disco plots
discoUI(id, cntr_titles)
discoServer(
id,
cntr,
annot = NULL,
selcols = c("PrimaryID", "ENTREZ", "SYMBOL"),
primary_id = "PrimaryID",
gene_id = NULL
)
id |
identifier of the shiny module (character vector) |
cntr_titles |
character vector containing the IDs of the contrasts
(same as |
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 |
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 |
Returns a reactive expression returning the ID of the activated gene
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)
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.