Skip to content

Commit

Permalink
Merge pull request #114 from guanguiwensy/patch-2
Browse files Browse the repository at this point in the history
Update server.R
  • Loading branch information
zx8754 authored Mar 8, 2024
2 parents 8f4800d + eae5a4f commit 5e2c9e6
Showing 1 changed file with 50 additions and 2 deletions.
52 changes: 50 additions & 2 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ shinyServer(function(input, output, session) {

# Data level 1 - Raw Input ------------------------------------------------
datAssoc <- reactive({
#fread("Data/ProstateData/OncoArrayFineMapping/plotData/chr2_241657087_242920971_assoc.txt",
# header = TRUE)
req(input$dataType)
switch(input$dataType,
OncoArrayFineMapping = {
Expand Down Expand Up @@ -486,6 +484,56 @@ shinyServer(function(input, output, session) {

output$PlotwgEncodeBroadHistone <- renderPlot({print(plotObjwgEncodeBroadHistone())})

plotObjwgEncodeBroadHistone_H3k4me1 <- reactive({

gg <- try({
plotHistone(folder = "Data/wgEncodeBroadHistone/",
Type = "H3k4me1",
chr = RegionChr(),
xStart = zoomStart(),
xEnd = zoomEnd(),
pad = TRUE
) + theme_LE()}, silent = TRUE)

if(class(gg) == "try-error"){
gg <- plotBlank(zoomStart(), zoomEnd(),
yLabel = expression(ENCODE[]),
textAnnot = "Error: Histone bigwig files are missing.") +
theme_LE() #+
#ylab(expression(ENCODE[]))
}

#return
gg
})

output$PlotwgEncodeBroadHistone_H3k4me1 <- renderPlot({print(plotObjwgEncodeBroadHistone_H3k4me1())})

plotObjwgEncodeBroadHistone_H3k4me3 <- reactive({

gg <- try({
plotHistone(folder = "Data/wgEncodeBroadHistone/",
chr = RegionChr(),
Type = "H3k4me3",
xStart = zoomStart(),
xEnd = zoomEnd(),
pad = TRUE
) + theme_LE()}, silent = TRUE)

if(class(gg) == "try-error"){
gg <- plotBlank(zoomStart(), zoomEnd(),
yLabel = expression(ENCODE[]),
textAnnot = "Error: Histone bigwig files are missing.") +
theme_LE() #+
#ylab(expression(ENCODE[]))
}

#return
gg
})

output$PlotwgEncodeBroadHistone_H3k4me3 <- renderPlot({print(plotObjwgEncodeBroadHistone_H3k4me3())})

# Plot: BedGraph ------------------------------------------------------------
# plotObjBedGraph <- reactive({
# plotBlank(xStart = 1, xEnd = 10, yLabel = "test") + theme_LE()
Expand Down

0 comments on commit 5e2c9e6

Please sign in to comment.