Skip to content

Commit

Permalink
Merge pull request #64 from databio/dev
Browse files Browse the repository at this point in the history
fixing hg38 bug and  now including commit hash
  • Loading branch information
vpnagraj authored Mar 20, 2018
2 parents 72f1008 + 3d581be commit fb91669
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 23 deletions.
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
37 changes: 25 additions & 12 deletions apps/LOLAweb/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(

Expand Down Expand Up @@ -90,7 +92,7 @@ ui <- list(
actionButton("run",
"RUN LOLA",
class = "runLOLA"),
HTML("<div style='padding-top:15px; padding-left:5px;'><a href = '?key=UDYOXT3MC1E2VF7'>Sample Results</a></div>")
HTML("<div style='padding-top:15px; padding-left:5px;'><a href = '?key=C5SQHB6RAM12EZF'>Sample Results</a></div>")
),
class = "headerBox"),
fluidRow(
Expand All @@ -100,7 +102,7 @@ ui <- list(
htmlOutput("messages"))
)),
tabPanel("Results",
fluidRow(div(HTML("<div class='alert alert-warning'><strong>Results</strong> is currently empty.<br>To generate result output, visit <strong>Run</strong> or view <a href = '?key=UDYOXT3MC1E2VF7'>sample results</a>.</div>"), id = "noresultsmsg")
fluidRow(div(HTML("<div class='alert alert-warning'><strong>Results</strong> is currently empty.<br>To generate result output, visit <strong>Run</strong> or view <a href = '?key=C5SQHB6RAM12EZF'>sample results</a>.</div>"), id = "noresultsmsg")
),
fluidRow(
column(2,
Expand All @@ -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")),
Expand Down Expand Up @@ -173,7 +175,11 @@ ui <- list(
tabPanel("About",
includeHTML("about.html")
),
footer = div(HTML("<div>Powered by <a href = 'https://somrc.virginia.edu' target ='blank'>SOMRC</a><br>A Project of the <a href ='http://databio.org/' target = 'blank'>Sheffield Lab</a><br>Source code on <a href ='https://github.com/databio/LOLAweb' target = 'blank'>Github</a><br>Try it yourself with <a href='https://github.com/databio/LOLAweb/blob/master/docker/README.md' target = 'blank'>Docker</a></div>"), align = "right", style = " bottom:0; width:100%; height:10px; padding: 10px; padding-bottom:20px; z-index: 1000;"),
footer = div(HTML(
paste0("<div>Powered by <a href = 'https://somrc.virginia.edu' target ='blank'>SOMRC</a><br>A Project of the <a href ='http://databio.org/' target = 'blank'>Sheffield Lab</a><br>Source code on <a href ='https://github.com/databio/LOLAweb' target = 'blank'>Github</a><br>Try it yourself with <a href='https://github.com/databio/LOLAweb/blob/master/docker/README.md' target = 'blank'>Docker</a>",
"<br>LOLAweb commit <a href ='https://github.com/databio/lolaweb/commit/", lw_version, "'>", lw_version, "</a></div>")
),
align = "right", style = " bottom:0; width:100%; height:10px; padding: 10px; padding-bottom:20px; z-index: 1000;"),
id = "mainmenu"
)
)
Expand Down Expand Up @@ -416,22 +422,26 @@ 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

} else {

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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand All @@ -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)

Expand Down
17 changes: 16 additions & 1 deletion apps/LOLAweb/scratch.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

0 comments on commit fb91669

Please sign in to comment.