Skip to content

Commit

Permalink
Merge branch 'release/v0.1.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
visze committed May 7, 2019
2 parents 3ab924a + 0d9560f commit 045e3d4
Show file tree
Hide file tree
Showing 8 changed files with 816 additions and 9 deletions.
34 changes: 34 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
dist: trusty # Use Ubuntu 14.04 image (instead of 12.04)
language: r
sudo: false
r: 3.5.1

# Install packrat if needed and have it restore packages.
install:
- R -e 'if (system.file(package="packrat") == "") install.packages("packrat")'
- R -e "packrat::packify(); packrat::restore()"

cache:
# Main R library
packages: true
directories:
# Packrat packages
- packrat/lib
# PhantomJS
- travis_phantomjs

# Install PhantomJS (if not cached)
before_install:
- "export PHANTOMJS_VERSION=2.1.1"
- "phantomjs --version"
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH"
- "hash -r"
- "phantomjs --version"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then hash -r; fi"
- "phantomjs --version"

script:
- R -f run_tests.R
23 changes: 17 additions & 6 deletions app.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ server <- function(input, output, session) {
DT::DTOutput(paste0(name,'_table'))
),
# Plot View using ggplot
tabPanel("Variant plot", plotlyOutput(paste0(name,'_plot'))
tabPanel("Variant plot", plotlyOutput(paste0(name,'_plot')),
checkboxInput(paste0(name,"_colorblind"), "Colorblind visualization", value = FALSE)
)
)
)
Expand All @@ -151,7 +152,7 @@ server <- function(input, output, session) {
# function to render the table/plot for a specific selected element (by name)
# is dependend on the release, barcodes, p-value threshsold, true/false deletions,
# range of the plot and needs output and session element
renderElement <- function(name,release,barcodes, threshold, deletions, range, output,session) {
renderElement <- function(name,release,barcodes, threshold, deletions, range, output,session, colorPalette) {
# check first if elements are not null
if(!is.null(release) & !is.null(barcodes) & !is.null(threshold)) {
# values cannot be NA (possible if out of range is selected, like <1 barcoded)
Expand All @@ -178,11 +179,13 @@ server <- function(input, output, session) {
# and the function getPlot from the same source to plot the ggplot
plotData <- modify.filterdata(data_general, barcodes,threshold,deletions,range)
if (plotData %>% nrow > 0) {
isolate({
output[[paste0(name,"_plot")]] <- renderPlotly({
p <- getPlot(plotData,name,release)
p <- getPlot(plotData,name,release,colorPalette)
ggplotly(p) %>%
layout(autosize=TRUE) %>% layout(xaxis=list(fixedrange=TRUE)) %>% layout(yaxis=list(fixedrange=TRUE)) %>%
config(displayModeBar = F)
},quoted = TRUE)
})
}
}
Expand Down Expand Up @@ -213,15 +216,15 @@ server <- function(input, output, session) {
isolate({
appendTab("promoterNavigation", experimentPage(name))
updateRegionSlider(session, paste0(name,"_region"), name, "GRCh37")
renderElement(name,"GRCh37",10,1e-5,TRUE,NULL,output,session)
renderElement(name,"GRCh37",10,1e-5,TRUE,NULL,output,session, "default")
})
}
for (name in enhancers$Element){
session$userData$actualSelectedRelease[[name]] <- "GRCh37"
isolate({
appendTab("enhancerNavigation", experimentPage(name))
updateRegionSlider(session, paste0(name,"_region"), name, "GRCh37")
renderElement(name,"GRCh37",10,1e-5,TRUE,NULL,output,session)
renderElement(name,"GRCh37",10,1e-5,TRUE,NULL,output,session,"default")
})
}

Expand All @@ -239,8 +242,16 @@ server <- function(input, output, session) {
release <- input[[paste0(name,"_reference")]]
barcodes <- input[[paste0(name,"_barcodes")]]
pValue <- input[[paste0(name,"_pvalue")]]

deletions <- input[[paste0(name,"_deletions")]]

colorblind <- input[[paste0(name,"_colorblind")]]

if(!is.null(colorblind) && colorblind) {
colorPalette <- "colorblind"
} else {
colorPalette <- "default"
}

# update the slider if the release changed
if (!is.null(release) && session$userData$actualSelectedRelease[[name]] != release) {
Expand All @@ -250,7 +261,7 @@ server <- function(input, output, session) {
# update data table and plot
range <- input[[paste0(name,"_region")]]
isolate({
renderElement(name,release,barcodes,pValue,deletions,range,output,session)
renderElement(name,release,barcodes,pValue,deletions,range,output,session,colorPalette)
})
}
})
Expand Down
Loading

0 comments on commit 045e3d4

Please sign in to comment.