Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fc/shiny app #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 94 additions & 25 deletions app_1/app.R
Original file line number Diff line number Diff line change
@@ -1,37 +1,106 @@
library(shiny)
library(shinythemes)

library(maftools)

endometrial_maf <- tcgaLoad(study= "UCEC")
ui <- fluidPage(
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 UI for app that draws a histogram ----
ui <- fluidPage(
#Sidebar panel for inputs ----
sidebarPanel(
checkboxGroupInput("Data", label = h3("Data Types to View"), choices = c("WXS", "RNAseq", "scRNAseq", "Cell Line"), selected = NULL)),
server <- function(input, output) {
output$deseq_summary <- renderPrint({
summary(results(dds, alpha=input$alpha))
})

textInput("Gene of Interest","Gene of Interest for RNAseq"),
output$maplot <- renderPlot({
plotMA(res, ylim= c(-2,2))
})

output$countplot <- renderPlot({
plotCounts(dds, gene=which.min(res$padj), intgroup="condition")
})

# App title ----
titlePanel("ReproCanAtlas"),

# Main panel for displaying outputs ----
output$lfcplot <- renderPlot({
plotMA(resLFC, ylim= c(-2,2))
})

mainPanel(
plotOutput(outputId = "summary"),
plotOutput(outputId = "oncoplot"))
)



# Define server logic required to ----
server <- function(input, output) {

output$summary <- renderPlot(plotmafSummary(maf = endometrial_maf, rmOutlier = TRUE, addStat = 'median', dashboard = TRUE, titvRaw = FALSE))
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$titv <- 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$oncoplot <- renderPlot(oncoplot(maf = endometrial_maf, top = 10))
}
}


shinyApp(ui = ui, server = server)
12 changes: 12 additions & 0 deletions app_1/install.R
Original file line number Diff line number Diff line change
@@ -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")