Commit 5eb3bbd3 authored by Thomas Schwarzl's avatar Thomas Schwarzl

added writing of description table to server

parent b09dcb35
......@@ -3,3 +3,4 @@
.RData
.Ruserdata
.DS_Store
app/www/data/RBPbase_*
.Ruserdata
# History files
.Rhistory
.RData
# Example code in package build process
*-Ex.R
.Rproj.user
# ShinyApps manifest
*.dcf
# Fonts
*.ttc
# DS Store
.DS_Store
# Log Files
logfile*.txt
# Packrat
packrat.lock
......@@ -75,7 +75,7 @@ addSumColumns <- function(RICTABLE, selected_organism, RIC_STUDIES, selected_RIC
getDescriptiveTable <- function(x) {
getDescriptiveTable <- function(x, ALLANNO) {
x <- x %>% mutate_all(list(
~if(is.logical(.)) {
ifelse(., "YES", "no")
......@@ -84,18 +84,19 @@ getDescriptiveTable <- function(x) {
}
))
x <- change_col_names(x)
x <- change_col_names(x, ALLANNO)
x
}
get_descriptive_for_ricbaseid <- function(x, ALLANNO) {
data.frame(base = x, stringsAsFactors = F) %>%
left_join(y = ALLANNO, by = c("base" = "RBPBASEID")) %>%
mutate(DescriptiveID = ifelse(is.na(DescriptiveID), base, DescriptiveID)) %>%
.[["DescriptiveID"]]
mutate(DescriptiveID = ifelse(is.na(DescriptiveID), base, paste0(DescriptiveID, '\n', base))) %>%
pull(DescriptiveID)
}
get_tooltip_for_ricbaseid <- function(x, ALLANNO) {
data.frame(base = x, stringsAsFactors = F) %>%
left_join(y = ALLANNO, by = c("base" = "RBPBASEID")) %>%
......
......@@ -20,11 +20,15 @@ require(openxlsx)
require(ggExtra)
require(purrr)
## output directory
data_dir <- file.path("www", "data")
## --------- Data from prepared table
load("www/data/ANNO_STUDIES.Rda")
load("www/data/RIC_STUDIES.Rda")
load("www/data/COMPILED_TABLE.Rda")
load("www/data/ORGANISM_TABLE.Rda")
load(file.path(data_dir, "ANNO_STUDIES.Rda"))
load(file.path(data_dir, "RIC_STUDIES.Rda"))
load(file.path(data_dir, "COMPILED_TABLE.Rda"))
load(file.path(data_dir, "ORGANISM_TABLE.Rda"))
source("annotationFunctions.R")
source("server_studies_table.R")
source("server_anno_table.R")
......@@ -32,12 +36,30 @@ source("server_plots.R")
source("server_table.R")
## --------- Options
options(shiny.reactlog=TRUE)
#options(shiny.reactlog=TRUE)
## --------- Preprossed data
## --------- Write Output data
## All organisms
all_organisms <- getAllOrganismsForSuperset(RIC_STUDIES)
ALLANNO <- bind_rows(ANNO_STUDIES, RIC_STUDIES)
ORGANISMS <- getOrganismSelectionList(RIC_STUDIES)
## Store Preprocessed Excel table
for(i in all_organisms) {
#write.xlsx(x = COMPILED_TABLE[[i]], file = file.path(output_directory, paste0("RBPbase_", i, "_table.xlsx")))
output_file <- file.path(data_dir, paste0("RBPbase_", i, "_DescriptiveID.xlsx"))
if(!file.exists(output_file)) {
write.xlsx(x = getDescriptiveTable(COMPILED_TABLE[[i]], ALLANNO), file = output_file)
}
}
## --------- Preprossed data
jscode.autoHeightDT <- '
autoHeightDT = function() {
var offset = 100; // pixels used for other elements like title, buttons, etc
......@@ -59,8 +81,7 @@ jscode.autoHeightDT <- '
'
all_organisms <- getAllOrganismsForSuperset(RIC_STUDIES)
#all_studies <- colnames(UNIQUETABLE[[1]])[ grepl(colnames(UNIQUETABLE[[1]]), pattern = "^.._.+")]
cbbPalette <- c("#D55E00", "#0072B2", "#888888", "#E69F00", "#009E73", "#F0E442", "#56B4E9", "#CC79A7")
cbbPalette2 <- c("#D55E00", "#F0E442", "#0072B2", "#888888", "#E69F00", "#009E73", "#56B4E9", "#CC79A7")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment