Maintenance - Mise à jour mensuelle Lundi 1 Juin 2020 entre 7h00 et 9h00

global.R 2.96 KB
Newer Older
fsoubes's avatar
fsoubes committed
1 2 3 4 5 6 7 8 9 10
### Author: Franck Soubès
### Bioinformatics Master Degree - University of Bordeaux, France
### Link: https://github.com/fsoubes/MA_Trix_App
### Where: GET-TRiX's facility
### Application: MATRiX is a shiny application for Microarray Analysis on Transcriptomic impact of Xenobiotics
### Licence: GPL-3.0


# increase loading files
options(shiny.maxRequestSize=128000000)
fsoubes's avatar
fsoubes committed
11
options(digits=3)
fsoubes's avatar
fsoubes committed
12

fsoubes's avatar
fsoubes committed
13
cutheatmlist = list( Boxplot = c( `True` = 'Boxplot'), Heatmap=c(`True` = "Heatmap"),
fsoubes's avatar
fsoubes committed
14 15 16 17 18 19 20 21
                     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
fsoubes's avatar
fsoubes committed
22
list.of.packages <- c("AnnotationDbi","shiny","shinythemes","shinyjs","ggplot2","shinyBS","plyr","shinyFiles",
fsoubes's avatar
fsoubes committed
23
                      "BH","data.table","DT","readr","colourpicker","shinydashboard","heatmaply",
fsoubes's avatar
fsoubes committed
24
                      "tools","devEMF","R.devices","FactoMineR","factoextra","gplots","V8",
fsoubes's avatar
fsoubes committed
25
                      "RColorBrewer","foreach","doParallel","gridExtra","plotly","dplyr","reticulate","Hmisc")
fsoubes's avatar
fsoubes committed
26 27 28 29 30 31



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){
fsoubes's avatar
fsoubes committed
32
suppressPackageStartupMessages(library(x,character.only=TRUE))})
fsoubes's avatar
fsoubes committed
33 34

library(shinyFiles)
fsoubes's avatar
fsoubes committed
35
source("function/delayinput.R")
fsoubes's avatar
fsoubes committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
source("css/owncss.R")
source("function/formating.R")
source("function/PCA.R")
source("function/heatmtruncated.R")
source("function/formating.R")
source("function/PCA.R")
source("function/decideTestTrix.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")



fsoubes's avatar
fsoubes committed
53

fsoubes's avatar
fsoubes committed
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
################################
######## 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")){
  vars$chat <- readRDS("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",
fsoubes's avatar
fsoubes committed
101
      tags$label(label, `for` = inputId),
fsoubes's avatar
fsoubes committed
102 103
      tags$input(id = inputId, type = "text", value = value,class="input-small"))
}