diff --git a/.travis.yml b/.travis.yml index 08dad3a..d3187b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,21 +17,21 @@ before_install: install: - if [ "$TRAVIS_BRANCH" == "master" ]; then cd docker/ ; - docker build --no-cache -t databio/lolaweb:latest . ; - docker push databio/lolaweb:latest; - aws sqs send-message --queue-url 'https://queue.amazonaws.com/474683445819/lola-updates' --message-body $TRAVIS_BRANCH; + docker build --no-cache -t databio/lolaweb:latest . || exit 1; + docker push databio/lolaweb:latest || exit 1; + aws sqs send-message --queue-url 'https://queue.amazonaws.com/474683445819/lola-updates' --message-body $TRAVIS_BRANCH || exit 1; fi - if [ "$TRAVIS_BRANCH" == "staging" ]; then cd docker/staging/ ; - docker build --no-cache -t databio/lolaweb:staging . ; - docker push databio/lolaweb:staging; - aws sqs send-message --queue-url 'https://queue.amazonaws.com/474683445819/lola-updates' --message-body $TRAVIS_BRANCH; + docker build --no-cache -t databio/lolaweb:staging . || exit 1; + docker push databio/lolaweb:staging || exit 1; + aws sqs send-message --queue-url 'https://queue.amazonaws.com/474683445819/lola-updates' --message-body $TRAVIS_BRANCH || exit 1; fi - if [ "$TRAVIS_BRANCH" == "dev" ]; then cd docker/dev/ ; - docker build --no-cache -t databio/lolaweb:dev . ; - docker push databio/lolaweb:dev; - aws sqs send-message --queue-url 'https://queue.amazonaws.com/474683445819/lola-updates' --message-body $TRAVIS_BRANCH; + docker build --no-cache -t databio/lolaweb:dev . || exit 1; + docker push databio/lolaweb:dev || exit 1; + aws sqs send-message --queue-url 'https://queue.amazonaws.com/474683445819/lola-updates' --message-body $TRAVIS_BRANCH || exit 1; fi notifications: diff --git a/README.md b/README.md index 1d378c6..f18ca85 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This repository contains two components: 1) the shiny [app source code](apps/LOL ## Shiny app -LOLAweb is implemented as an interactive shiny app. You can run this app locally by following the [instructions in the appfolder](apps/LOLAweb/). +LOLAweb is implemented as an interactive Shiny app. You can run this app locally by following the [instructions in the appfolder](apps/LOLAweb/). ## Dockerfile diff --git a/apps/LOLAweb/app.R b/apps/LOLAweb/app.R index a47a7d3..041da0b 100644 --- a/apps/LOLAweb/app.R +++ b/apps/LOLAweb/app.R @@ -15,6 +15,8 @@ library(GenomicDistributions) setCacheDir("cache") +# get lolaweb version +lw_version <- system(command = "git rev-parse HEAD | cut -c1-9", intern = TRUE) ui <- list( @@ -90,7 +92,7 @@ ui <- list( actionButton("run", "RUN LOLA", class = "runLOLA"), - HTML("
Sample Results
") + HTML("
Sample Results
") ), class = "headerBox"), fluidRow( @@ -100,7 +102,7 @@ ui <- list( htmlOutput("messages")) )), tabPanel("Results", - fluidRow(div(HTML("
Results is currently empty.
To generate result output, visit Run or view sample results.
"), id = "noresultsmsg") + fluidRow(div(HTML("
Results is currently empty.
To generate result output, visit Run or view sample results.
"), id = "noresultsmsg") ), fluidRow( column(2, @@ -120,7 +122,7 @@ ui <- list( uiOutput("select_userset"), conditionalPanel(condition = "output.res", h4("Run Summary"), - tableOutput("run_sum")) + tableOutput("run_sum"), style = "font-size:10px;") ), column(10, tags$h4(htmlOutput("link")), @@ -173,7 +175,11 @@ ui <- list( tabPanel("About", includeHTML("about.html") ), - footer = div(HTML("
Powered by SOMRC
A Project of the Sheffield Lab
Source code on Github
Try it yourself with Docker
"), align = "right", style = " bottom:0; width:100%; height:10px; padding: 10px; padding-bottom:20px; z-index: 1000;"), + footer = div(HTML( + paste0("
Powered by SOMRC
A Project of the Sheffield Lab
Source code on Github
Try it yourself with Docker", + "
LOLAweb commit ", lw_version, "
") + ), + align = "right", style = " bottom:0; width:100%; height:10px; padding: 10px; padding-bottom:20px; z-index: 1000;"), id = "mainmenu" ) ) @@ -416,7 +422,9 @@ server <- function(input, output, session) { if(input$checkbox) { - userUniverse = read.table(file = input$useruniverse$datapath, header = F) + # userUniverse = read.table(file = input$useruniverse$datapath, header = F) + userUniverse = readBed(file = input$useruniverse$datapath) + universename <- input$useruniverse$datapath @@ -424,14 +432,16 @@ server <- function(input, output, session) { datapath <- paste0("universes/", input$refgenome, "/", input$defaultuniverse) - userUniverse = read.table(file = datapath, header = F) + # userUniverse = read.table(file = datapath, header = F) + userUniverse = readBed(file = datapath) + universename <- input$defaultuniverse } - colnames(userUniverse) <- c('chr','start','end','id','score','strand') - userUniverse <- with(userUniverse, GRanges(chr, IRanges(start+1, end), strand, score, id=id)) - + # colnames(userUniverse) <- c('chr','start','end','id','score','strand') + # userUniverse <- with(userUniverse, GRanges(chr, IRanges(start+1, end), strand, score, id=id)) + userSetsRedefined = redefineUserSets(userSets, userUniverse) # load region data for each reference genome @@ -472,7 +482,8 @@ server <- function(input, output, session) { query_set = paste(gsub(".bed","",unique(resRedefined$userSet)), collapse = "\n"), genome = input$refgenome, universe = gsub(".bed", "", universename), - region_db = input$loladb + region_db = input$loladb, + commit = lw_version ) # create named list of multiple objects for plotting @@ -718,7 +729,8 @@ server <- function(input, output, session) { "Regions ", "Genome ", "Universe ", - "Database "), + "Database ", + "Commit "), y = c(as.character(rawdat_res$run_sum$start_time), as.character(rawdat_res$run_sum$end_time), @@ -727,7 +739,8 @@ server <- function(input, output, session) { as.character(rawdat_res$run_sum$query_set), as.character(rawdat_res$run_sum$genome), as.character(rawdat_res$run_sum$universe), - as.character(rawdat_res$run_sum$region_db) + as.character(rawdat_res$run_sum$region_db), + as.character(rawdat_res$run_sum$commit) ) , stringsAsFactors = FALSE) diff --git a/apps/LOLAweb/scratch.R b/apps/LOLAweb/scratch.R index 3ca8360..117a602 100644 --- a/apps/LOLAweb/scratch.R +++ b/apps/LOLAweb/scratch.R @@ -7,10 +7,11 @@ source("themes.R") dbPath = system.file("extdata", "hg19", package="LOLA") regionDB = loadRegionDB(dbLocation=dbPath) + data("sample_universe", package="LOLA") # data("sample_input", package="LOLA") -userSet = read.table(file = "lola_vignette_data/setB_complete.bed", header = F) +userSet = read.table(file = "lola_vignette_data/setB_100.bed", header = F) colnames(userSet) <- c('chr','start','end','id','score','strand') userSet <- with(userSet, GRanges(chr, IRanges(start+1, end), strand, score, id=id)) userSetsRedefined = redefineUserSets(userSet, userUniverse) @@ -264,4 +265,18 @@ x <- system.time({ rnorm(1000000) }) + +userSet = readBed(file = "lola_vignette_data/setB_100.bed") +dbPath = "reference/Core/hg38/" +regionDB = loadRegionDB(dbLocation=dbPath) + +userUniverse = readBed("universes/hg38/tiles.hg38.5000.bed") +userUniverse = read.table(file = "universes/hg38/tiles.hg38.5000.bed", header = F) +colnames(userUniverse) <- c('chr','start','end','id','score','strand') +userUniverse <- with(userUniverse, GRanges(chr, IRanges(start+1, end), strand, score, id=id)) + +userSetsRedefined = redefineUserSets(userSet, userUniverse) + + +resRedefined = runLOLA(userSetsRedefined, userUniverse, regionDB, cores=1) \ No newline at end of file