Permalink
Browse files

Merge pull request #100 from databio/dev

1.3.0 release
  • Loading branch information...
vpnagraj committed Oct 2, 2018
2 parents 9a42c57 + 86bd5ea commit 1790e099f3c383b8ab47b7346fbb5829aa95bee5
@@ -14,3 +14,4 @@ apps/LOLAweb/shinylog
apps/LOLAweb/results
apps/LOLAweb/userSets
apps/LOLAweb/scratch.R
*.rdb
@@ -97,7 +97,13 @@ The columns in the results table are:
<a name="how-to-cite"> </a>
### How do I cite LOLAweb?

LOLAweb is pending publication. In the interim, please cite the LOLA R package:
LOLAweb is published in *Nucleic Acids Research*:

V. P. Nagraj, N. E. Magee and N. C. Sheffield, "LOLAweb: a containerized web server for interactive genomic locus overlap enrichment analysis," Nucleic Acids Research, vol. 46, no. w1, pp. w194-w199, Jul. 2018.

[https://doi.org/10.1093/nar/gky464](https://doi.org/10.1093/nar/gky464)

The LOLA R package is published in *Bioinformatics*:

N. C. Sheffield and C. Bock, “LOLA: enrichment analysis for genomic region sets and regulatory elements in R and Bioconductor,” Bioinformatics, vol. 32, no. 4, pp. 587–589, Oct. 2016.

@@ -133,7 +133,11 @@ ui <- list(
uiOutput("slider_pvalue"),
uiOutput("select_collection"),
uiOutput("select_sort"),
uiOutput("select_userset")),
uiOutput("select_userset"),
shinyjs::hidden(
downloadButton("all_plots_dl",
label = "Download all plots",
class = "dt-button"))),
column(10,
shinyjs::hidden(
div(
@@ -210,7 +214,8 @@ ui <- list(
),
tabPanel("Run summary",
h4("Run summary"),
tableOutput("run_sum"), style = "font-size:18px;")
tableOutput("run_sum"),
style = "font-size:18px;")
),
id = "result-tabs")))
)
@@ -740,7 +745,6 @@ server <- function(input, output, session) {
shinyjs::show("gear2")
shinyjs::show("result-tabs")


# show help text for results sliders and plots
shinyjs::show("infoplot_div")
shinyjs::show("infodisplay_div")
@@ -770,6 +774,8 @@ server <- function(input, output, session) {

shinyjs::hide("gear2")
shinyjs::show("scatterhead")
shinyjs::show("all_plots_dl")


}

@@ -1064,7 +1070,7 @@ server <- function(input, output, session) {
".pdf",
sep="") },
content = function(file) {
ggsave(file, plot = scatterplot_input()
ggsave(file, plot = scatterplot_input() + theme(axis.text = element_text(size = 9), text = element_text(size = 9))
, device = "pdf")
}
)
@@ -1084,7 +1090,7 @@ server <- function(input, output, session) {
".pdf",
sep="") },
content = function(file) {
ggsave(file, plot = plot_input(dat(), "oddsRatio", "Odds ratio", input$select_sort_i)
ggsave(file, plot = plot_input(dat(), "oddsRatio", "Odds ratio", input$select_sort_i) + theme(axis.text = element_text(size = 9), text = element_text(size = 9))
, device = "pdf")
}
)
@@ -1118,7 +1124,7 @@ server <- function(input, output, session) {
".pdf",
sep="") },
content = function(file) {
ggsave(file, plot = plot_input(dat(), "support", "Support", input$select_sort_i)
ggsave(file, plot = plot_input(dat(), "support", "Support", input$select_sort_i) + theme(axis.text = element_text(size = 9), text = element_text(size = 9))
, device = "pdf")
}
)
@@ -1154,7 +1160,7 @@ server <- function(input, output, session) {
".pdf",
sep="") },
content = function(file) {
ggsave(file, plot = plot_input(dat(), "pValueLog", "log(p value)", input$select_sort_i)
ggsave(file, plot = plot_input(dat(), "pValueLog", "log(p value)", input$select_sort_i) + theme(axis.text = element_text(size = 9), text = element_text(size = 9))
, device = "pdf")
}
)
@@ -1167,7 +1173,7 @@ server <- function(input, output, session) {

if (is.null(genDist)) {

NULL
missing_plot()

} else {

@@ -1195,7 +1201,7 @@ server <- function(input, output, session) {

if (is.null(TSSDist)) {

NULL
missing_plot()

} else {

@@ -1222,7 +1228,7 @@ server <- function(input, output, session) {

if(is.null(gp)) {

NULL
missing_plot()

} else {

@@ -1247,7 +1253,7 @@ server <- function(input, output, session) {
".pdf",
sep="") },
content = function(file) {
ggsave(file, plot = distrib_plot_input(), device = "pdf")
ggsave(file, plot = distrib_plot_input() + theme(axis.text = element_text(size = 9), text = element_text(size = 9)), device = "pdf", width = 11, height = 5)
}
)

@@ -1256,19 +1262,74 @@ server <- function(input, output, session) {
".pdf",
sep="") },
content = function(file) {
ggsave(file, plot = dist_plot_input(), device = "pdf")
ggsave(file, plot = dist_plot_input() + theme(axis.text = element_text(size = 9), text = element_text(size = 9)), device = "pdf")
}
)

output$part_plot_dl <- downloadHandler(
filename = function() { paste("paritions",
filename = function() { paste("partitions",
".pdf",
sep="") },
content = function(file) {
ggsave(file, plot = part_plot_input(), device = "pdf")
ggsave(file, plot = part_plot_input() + theme(axis.text = element_text(size = 9), text = element_text(size = 9)), device = "pdf")
}
)

# to zip all plots and save individually ...

output$all_plots_dl <- downloadHandler(
filename = function() {
paste("lolawebplots", "zip", sep=".")
},
content = function(fname) {

ggsave(filename = "scatter.pdf",
plot = scatterplot_input() + theme(axis.text = element_text(size = 9), text = element_text(size = 9)),
device = "pdf",
path = "plots")

ggsave(filename = "oddsratio.pdf",
plot = plot_input(dat(), "oddsRatio", "Odds ratio", input$select_sort_i) + theme(axis.text = element_text(size = 9), text = element_text(size = 9)),
device = "pdf",
path = "plots")

ggsave(filename = "support.pdf",
plot = plot_input(dat(), "support", "Support", input$select_sort_i) + theme(axis.text = element_text(size = 9), text = element_text(size = 9)),
device = "pdf",
path = "plots")

ggsave(filename = "pvalue.pdf",
plot = plot_input(dat(), "pValueLog", "log(p value)", input$select_sort_i) + theme(axis.text = element_text(size = 9), text = element_text(size = 9)),
device = "pdf",
path = "plots")

# using pdf() device here bc custom aspect ratio not working with ggsave() in this case
pdf("plots/gendist.pdf", width = 11, height = 5)
print(distrib_plot_input() + theme(axis.text = element_text(size = 9), text = element_text(size = 9)))
dev.off()

ggsave(filename = "tssdist.pdf",
plot = dist_plot_input() + theme(axis.text = element_text(size = 9), text = element_text(size = 9)),
device = "pdf",
path = "plots")

ggsave(filename = "partitions.pdf",
plot = part_plot_input() + theme(axis.text = element_text(size = 9), text = element_text(size = 9)),
device = "pdf",
path = "plots")

# identify files to be zipped and zip them
fs <- list.files("plots", full.names = TRUE)
zip(zipfile=fname, files=fs)

# delete tmp plot files after zip is done
unlink(fs)

},
contentType = "application/zip"

)



# data table
@@ -60,6 +60,22 @@ plot_input <- function(res, metric, ylabel, sortcol) {

}

# missing_plot() creates
missing_plot <- function() {

ggplot(data.frame(x=1:5, y = 1:5), aes(x, y)) +
geom_blank() +
annotate("text", x = 3, y = 4, label = "Unable to render plot", size = 10, col = "red") +
xlab("") +
ylab("") +
theme(line = element_blank(),
rect = element_blank(),
axis.ticks.length = unit(0,"cm"),
axis.text = element_blank(),
legend.position = "none",
panel.spacing = unit(0,"lines"),
plot.margin = unit(c(0, 0, 0, 0), "lines"))
}

# This function just wraps the base Sys.gentenv function to provide a default
# value for the case that the environment variable is not specified.
@@ -13,6 +13,10 @@ RUN git clone https://github.com/databio/LOLAweb.git
# add dir for cache
RUN mkdir LOLAweb/cache
RUN chown -R shiny:shiny LOLAweb/cache

# add plots dir for zipping up all figures to download with one button
RUN mkdir LOLAweb/apps/LOLAweb/plots
RUN chown -R shiny:shiny LOLAweb/apps/LOLAweb/plots

# run the server setup script
CMD ["/usr/bin/shiny-server.sh"]
@@ -2,6 +2,8 @@

# Shiny LOLAweb for Docker

The `databio/lolaweb` container is based on the `databio/shinybase` container, which you can find in its [github repository](https://github.com/databio/shinyBase) or [on dockerhub](https://hub.docker.com/r/databio/shinybase/).

## `build` the container image yourself

1. Clone this repository
@@ -14,5 +14,9 @@ RUN git clone -b dev https://github.com/databio/LOLAweb.git
RUN mkdir LOLAweb/cache
RUN chown -R shiny:shiny LOLAweb/cache

# add plots dir for zipping up all figures to download with one button
RUN mkdir LOLAweb/apps/LOLAweb/plots
RUN chown -R shiny:shiny LOLAweb/apps/LOLAweb/plots

# run the server setup script
CMD ["/usr/bin/shiny-server.sh"]
@@ -5,6 +5,10 @@
mkdir -p /var/log/shiny-server
chown shiny.shiny /var/log/shiny-server

# make sure relevant environment variables are visible to shiny server .Renviron
env | grep "LWLOCAL\|LWREF" > /home/shiny/.Renviron
chown shiny.shiny /home/shiny/.Renviron

exec shiny-server 2>&1

# done
@@ -5,6 +5,10 @@
mkdir -p /var/log/shiny-server
chown shiny.shiny /var/log/shiny-server

# make sure relevant environment variables are visible to shiny server .Renviron
env | grep "LWLOCAL\|LWREF" > /home/shiny/.Renviron
chown shiny.shiny /home/shiny/.Renviron

exec shiny-server 2>&1

# done

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

0 comments on commit 1790e09

Please sign in to comment.