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

create project with renv, add support for SVG #5

Open
wants to merge 2 commits into
base: master
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

.Rhistory
rsconnect/shinyapps.io/goedhart/VolcaNoseR.dcf
.Rproj.user
458 changes: 458 additions & 0 deletions README.html

Large diffs are not rendered by default.

26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
# VolcaNoseR
A Shiny App for making Volcano plots

A Shiny App for making Volcano plots based on [VolcaNoseR](https://github.com/JoachimGoedhart/VolcaNoseR/)

### Running the App

The web-tool runs from a shiny server, and can be accessed at:

o [https://huygens.science.uva.nl/VolcaNoseR/](https://huygens.science.uva.nl/VolcaNoseR/)

o [https://goedhart.shinyapps.io/VolcaNoseR/](https://goedhart.shinyapps.io/VolcaNoseR/), while bandwidth lasts

Alternatively, the app can run from R/Rstudio and this is perhaps the best option for loading large files. See instructions below
o [Check](https://fuzzylife.shinyapps.io/VolcaNoseR/), while bandwidth lasts

#### Preparations
Note that the app depends on several R packages that need to be installed (shiny, ggplot2, dplyr, magrittr, ggrepel, DT, shinycssloaders, RCurl, readxl).

Run this command in R/Rstudio to download and install all the packages (only needs to be done once):
#### Server
o [Install](https://rstudio.com/products/shiny/download-server/ubuntu/)
```
sudo su - -c "R -e \"install.packages(c('ggplot2','dplyr','ggrepel','shinycssloaders','readxl','DT', 'RCurl','svglite')repos='https://cran.rstudio.com/')\""
```
install.packages("shiny", "ggplot2", "dplyr", "magrittr", "ggrepel", "DT", "shinycssloaders", "RCurl", "readxl")
o log monitor *example*
```
tail -f /var/log/shiny-server/VolcaNoseR-shiny-*.log
```

o The first option is running it directly from Github. In the command line (in R or Rstudio) type:
```
shiny::runGitHub('VolcaNoseR', 'JoachimGoedhart')
shiny::runGitHub('VolcaNoseR', 'animesh')
```
o The second option is download the app and to use it offline:

Expand Down
16 changes: 16 additions & 0 deletions VolcaNoseR.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 12
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

QuitChildProcessesOnExit: Yes
DisableExecuteRprofile: Yes
44 changes: 28 additions & 16 deletions app.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ options(shiny.maxRequestSize=10*1024^2)
#Load necessary packages

library(shiny)
library(svglite)
library(ggplot2)
library(magrittr)
library(dplyr)
Expand Down Expand Up @@ -344,7 +345,7 @@ ui <- fluidPage(
tabPanel("Plot",h3("Volcano Plot"
),
downloadButton("downloadPlotPDF", "Download pdf-file"),
# downloadButton("downloadPlotSVG", "Download svg-file"),
downloadButton("downloadPlotSVG", "Download svg-file"),
downloadButton("downloadPlotPNG", "Download png-file"),

actionButton("settings_copy", icon = icon("clone"),
Expand Down Expand Up @@ -1392,21 +1393,32 @@ output$hover_info <- renderUI({

######### DEFINE DOWNLOAD BUTTONS FOR ORDINARY PLOT ###########

output$downloadPlotPDF <- downloadHandler(
filename <- function() {
paste("VolcaNoseR_", Sys.time(), ".pdf", sep = "")
},
content <- function(file) {
pdf(file, width = input$plot_width/72, height = input$plot_height/72)
plot(plot_data())

dev.off()
},
contentType = "application/pdf" # MIME type of the image
)


output$downloadPlotPNG <- downloadHandler(
output$downloadPlotPDF <- downloadHandler(
filename <- function() {
paste("VolcaNoseR_", Sys.time(), ".pdf", sep = "")
},
content <- function(file) {
pdf(file, width = input$plot_width/72, height = input$plot_height/72)
plot(plot_data())

dev.off()
},
contentType = "application/pdf" # MIME type of the image
)


output$downloadPlotSVG <- downloadHandler(
filename <- function() {
paste("VolcaNoseR_", Sys.Date(), ".svg", sep = "")
},
content <- function(file) {
ggplot2::ggsave(file=file,plot=plot_data())
},
contentType = "application/svg" # MIME type of the image
)


output$downloadPlotPNG <- downloadHandler(
filename <- function() {
paste("VolcaNoseR_", Sys.time(), ".png", sep = "")
},
Expand Down
12 changes: 12 additions & 0 deletions rsconnect/shinyapps.io/fuzzylife/VolcanoseR.dcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: VolcanoseR
title: VolcanoseR
username:
account: fuzzylife
server: shinyapps.io
hostUrl: https://api.shinyapps.io/v1
appId: 3388466
bundleId: 3975914
url: https://fuzzylife.shinyapps.io/VolcaNoseR/
when: 1607704032.45113
asMultiple: FALSE
asStatic: FALSE
13 changes: 0 additions & 13 deletions rsconnect/shinyapps.io/goedhart/VolcaNoseR.dcf

This file was deleted.