-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.R
117 lines (84 loc) · 3.47 KB
/
global.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
### Author: Franck Soubès
### Bioinformatics Master Degree - University of Bordeaux, France
### Link: https://github.com/GeT-TRiX/MA_Trix_App/
### Where: GET-TRiX's facility
### Application: MATRiX is a shiny application for Mining and functional Analysis of TRanscriptomics data
### Licence: GPL-3.0
# increase loading files
options(shiny.maxRequestSize=128000000)
options(digits=3)
userId <- Sys.getenv("SHINYPROXY_USERNAME")
root <- ifelse(userId != "", paste("/root/MA_Trix_App/data/", userId, sep = ""), "/home/fsoubes/dockerize_MATRiX/MA_Trix_App/data/gettrix")
print(root)
cutheatmlist = list( Boxplot = c( `True` = 'Boxplot'), Heatmap=c(`True` = "Heatmap"),
Stripchart=c(`Without boxplot`="LB", `With boxplot` = "WB"))
categoerygen = c( `BP`= "GOTERM_BP_ALL", `MF` = "GOTERM_MF_ALL", `CC`= "GOTERM_CC_ALL", `Kegg`= "KEGG_PATHWAY")
# Loading packages
#sudo apt-get install libv8-dev for V8 package
list.of.packages <- c("AnnotationDbi","shiny","shinythemes","shinyjs","ggplot2","shinyBS","plyr","shinyFiles","xlsx","stringr",
"BH","data.table","DT","readr","colourpicker","shinydashboard","heatmaply",
"tools","R.devices","FactoMineR","factoextra","gplots","V8","RColorBrewer","foreach","doParallel",
"gridExtra","plotly","dplyr","reticulate","Hmisc", "devEMF")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
lapply(list.of.packages,function(x){
suppressPackageStartupMessages(library(x,character.only=TRUE))})
source("css/csstips.R")
source("function/PCA.R")
source("function/heatmtruncated.R")
source("function/formatingtables.R")
source("function/decideTestTrix.R")
source("function/ggstrip_groups.r")
source("function/vennplot.R")
source("function/create_forked_task.R")
source("function/cutheat.R")
source("function/gosearch.R")
source("function/highchartconverter.R")
source("function/EnhancedVolcano.R")
source("./module/csvmodules.R")
source("./module/savemodules.R")
source("./module/Selgroup.R")
source("./module/enrichmodule.R")
source("./module/groupcol.R")
source("./module/magnificentables.R")
source("./module/Savemoduletable.R")
source("./module/getdegenes.R")
################################
######## Chat env ##
################################
# Globally define a place where all users can share some reactive data.
vars <- reactiveValues(chat=NULL, users=NULL)
# Restore the chat log from the last session.
if (file.exists("chat.Rds") && userId == ""){
vars$chat <- readRDS("chat.Rds")
} else if(file.exists("./chat/chat.Rds") && userId != ""){
vars$chat <- readRDS("./chat/chat.Rds")
} else {
vars$chat <- "Welcome to MATRiX Chat!"
}
#' Get the prefix for the line to be added to the chat window. Usually a newline
#' character unless it's the first line.
linePrefix <- function(){
if (is.null(isolate(vars$chat))){
return("")
}
return("<br />")
}
################################
######## Variables env ##
################################
firstcol = "green"
intercol = "black"
lastcol = "red"
wd_path= getwd()
firstdim = 1
secdim = 2
`%next%` <- shiny:::`%OR%`
palette = brewer.pal(8,"Dark2") %>%
list(brewer.pal(10,"Paired")) %>%
unlist()
textInputRow<-function (inputId, label, value = "") {
div(style="display:inline-block",
tags$label(label, `for` = inputId),
tags$input(id = inputId, type = "text", value = value,class="input-small"))
}