From c2ef955d1a9524cc91fbb6d36bfd3ef0180c2ce7 Mon Sep 17 00:00:00 2001 From: gitmee Date: Sat, 6 Aug 2022 21:25:00 -0700 Subject: [PATCH 1/3] reactive app --- app_1/app.R | 140 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 124 insertions(+), 16 deletions(-) diff --git a/app_1/app.R b/app_1/app.R index ace8557..2d2fcd5 100644 --- a/app_1/app.R +++ b/app_1/app.R @@ -1,35 +1,143 @@ +library(shiny) +library(shinythemes) -library(maftools) -endometrial_maf <- tcgaLoad(study= "UCEC") +# library(maftools) +# endometrial_maf <- tcgaLoad(study= "UCEC") -# Define UI for app that draws a histogram ---- ui <- fluidPage( #Sidebar panel for inputs ---- - sidebarPanel( - checkboxGroupInput("Data_Types", label = h3("Data Types to View"), choices = c("WXS", "RNAseq", "scRNAseq", "Cell Line"), selected = NULL)), + # sidebarPanel( + # checkboxGroupInput("Data_Type", label = h3("Data Types to View"), choices = c("Summary", "WXS", "RNAseq", "scRNAseq", "Cell Line"), selected = NULL)), + # App title ---- - titlePanel("ReproCanAtlas"), + # titlePanel("ReproCanAtlas"), - # Main panel for displaying outputs ---- + # Main panel for displaying outputs ---- + #mainPanel( + #splitLayout(plotOutput(outputId = "summary"), + # plotOutput(outputId = "oncoplot")) + #) + + # Display Panels ---- + # sidebarLayout( + # sidebarPanel( + # selectInput("choice", label=h3("Data Types to View"), choices=c("Summary", "WXS", "RNAseq", "scRNAseq", "Cell Line")) + # ), + # mainPanel( + # tabsetPanel( + # id="main", + # type="hidden", + # tabPanelBody("Summary", "Panel 1 content"), + # tabPanelBody("WXS", "Panel 2 content"), + # tabPanelBody("RNASeq", "Panel 3 content"), + # tabPanelBody("scRNASeq", "Panel 2 content"), + # tabPanelBody("Cell Line", "Panel 2 content") + # ) + # ) + # ) - mainPanel( - splitLayout(plotOutput(outputId = "summary"), - plotOutput(outputId = "oncoplot")) + shinythemes::themeSelector(), + navbarPage( + "ReproCanAtlas", + tabPanel("Start", + sidebarPanel( + textInput("tissue_type", "Tissue Type:", "Endometrial"), + textInput("project", "Project:", "UCEC"), + textInput("data_source", "Data Source:", "TCGA"), + sliderInput("alpha", "Alpha:", 0.001, 0.05, 0.05), + actionButton("analyze", "Analyze", class = "btn-primary") + ), + mainPanel( + tabsetPanel( + tabPanel("DESeq Summary", verbatimTextOutput("deseq_summary")), + tabPanel("MA Plot", plotOutput("maplot")), + tabPanel("Counts", plotOutput("countplot")), + tabPanel("Log2 Fold Change", plotOutput("lfcplot")), + tabPanel("Mean SD", plotOutput("sdplot")), + tabPanel("Groups", plotOutput("groupsplot")) + ) + ) + ), + tabPanel("Mutation Analysis", + mainPanel( + tabsetPanel( + tabPanel("MAF Summary", plotOutput("maf_summary")), + tabPanel("Oncoplot", plotOutput("oncoplot")), + tabPanel("Transition and Transversion Ratios", plotOutput("titv")), + tabPanel("Amino Acid Changes", textInput("gene_input", label="Gene:", value="PTEN"), plotOutput("aa_lollipop")), + tabPanel("Inter Variant Distance", plotOutput("ivd")), + tabPanel("Somatic Interactions", plotOutput("somatic_interactions")), + tabPanel("Oncodrive", plotOutput("oncodrive")) + ) + ) + ) ) -) +) # Define server logic required to ---- server <- function(input, output) { + output$deseq_summary <- renderPrint({ + summary(results(dds, alpha=input$alpha)) + }) + + output$maplot <- renderPlot({ + plotMA(res, ylim= c(-2,2)) + }) + + output$countplot <- renderPlot({ + plotCounts(dds, gene=which.min(res$padj), intgroup="condition") + }) + + output$lfcplot <- renderPlot({ + plotMA(resLFC, ylim= c(-2,2)) + }) + + output$sdplot <- renderPlot({ + meanSdPlot(assay(ntd)) + }) + + output$groupsplot <- renderPlot({ + q + }) + + output$maf_summary <- renderPlot({ + plotmafSummary(maf = endometrial_maf, rmOutlier = TRUE, addStat = 'median', dashboard = TRUE, titvRaw = FALSE) + }) + + output$oncoplot <- renderPlot({ + oncoplot(maf = endometrial_maf, top = 10) + }) + + output$titvplot <- renderPlot({ + plotTiTv(res = laml.titv) + }) + + output$ivd <- renderPlot({ + rainfallPlot(maf = endometrial_maf, detectChangePoints = TRUE, pointSize = 0.4) + }) + + output$aa_lollipop <- renderPlot({ + lollipopPlot( + maf = endometrial_maf, + gene = input$gene_input, + AACol = 'HGVSp_Short', + showMutationRate = TRUE + ) + }) + + output$somatic_interactions <- renderPlot({ + somaticInteractions(maf = endometrial_maf, top = 25, pvalue = c(0.05, 0.1)) + }) + + output$oncodrive <- renderPlot({ + plotOncodrive(res = laml.sig, fdrCutOff = 0.1, useFraction = TRUE, labelSize = 0.5) + }) - output$summary <- renderPlot(plotmafSummary(maf = endometrial_maf, rmOutlier = TRUE, addStat = 'median', dashboard = TRUE, titvRaw = FALSE)) - - output$oncoplot <- renderPlot(oncoplot(maf = endometrial_maf, top = 10)) - - } +} shinyApp(ui = ui, server = server) From 5d704ca137f8a8a5ca54ef6f0b404069bfc134be Mon Sep 17 00:00:00 2001 From: gitmee Date: Sat, 6 Aug 2022 21:28:31 -0700 Subject: [PATCH 2/3] shiny app --- app_1/install.R | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app_1/install.R diff --git a/app_1/install.R b/app_1/install.R new file mode 100644 index 0000000..d86229e --- /dev/null +++ b/app_1/install.R @@ -0,0 +1,12 @@ +if (!require("BiocManager", quietly = TRUE)) + install.packages("BiocManager") + +BiocManager::install("recount3") +BiocManager::install("tximport") +BiocManager::install("GenomicFeatures") +BiocManager::install("TxDb.Hsapiens.UCSC.hg19.knownGene") +BiocManager::install("vsn") +BiocManager::install("DESeq2") +BiocManager::install("maftools") +BiocManager::install("apeglm") +install.packages("tidyverse") From c8640b8097b18e0525de283bbe5f10e5789dc066 Mon Sep 17 00:00:00 2001 From: gitmee Date: Sat, 6 Aug 2022 21:41:42 -0700 Subject: [PATCH 3/3] fixed plot id titv typo --- app_1/app.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app_1/app.R b/app_1/app.R index de07eac..85a117f 100644 --- a/app_1/app.R +++ b/app_1/app.R @@ -75,7 +75,7 @@ server <- function(input, output) { oncoplot(maf = endometrial_maf, top = 10) }) - output$titvplot <- renderPlot({ + output$titv <- renderPlot({ plotTiTv(res = laml.titv) })