app.R 2 KB
Newer Older
jlopez's avatar
Proto    
jlopez committed
1
2
3
4
5
6
library(shiny)
library(shinydashboard)
library(shinyjs)
library(shinycssloaders)
library(DT)
library(dplyr)
jlopez's avatar
Fix bug    
jlopez committed
7
library(tools)
jlopez's avatar
jlopez committed
8
library(githubinstall)
jlopez's avatar
jlopez committed
9
require(stringi)
jlopez's avatar
jlopez committed
10
library(devtools)
jlopez's avatar
jlopez committed
11
library(yaml)
jlopez's avatar
Proto    
jlopez committed
12

jlopez's avatar
Fix bug    
jlopez committed
13
source("./R/helper_functions.R", local = T)
jlopez's avatar
Proto    
jlopez committed
14
15
16
17
18
source("./R/menugauche.R", local = T)
source("./pages/pages_def_home.R", local = T)

options(encoding = 'UTF-8')

jlopez's avatar
jlopez committed
19
20
21
22
23
24
jscode <- "
shinyjs.collapse = function(boxid) {
$('#' + boxid).closest('.box').find('[data-widget=collapse]').click();
}
"

jlopez's avatar
Proto    
jlopez committed
25
26
27
28
29
30
31
32
#style <- tags$style(HTML(readLines("www/added_styles.css")) )
UI <- dashboardPage(
  skin = "green",
  dashboardHeader(title = "RPACIB"),
  dashboardSidebar(MenuGauche),
  dashboardBody(
    
    shinyjs::useShinyjs(),
jlopez's avatar
jlopez committed
33
    extendShinyjs(text = jscode),
jlopez's avatar
Proto    
jlopez committed
34
35
36
37
38
39
40
41
42
43
44
    tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "bootstrap.min.readable.css")) ,
    #tags$head(style),

    tabItems(
      tabItem(tabName = "Home",         tabHome)
    )
  )
)

server <- function( input, output, session) {
  
jlopez's avatar
jlopez committed
45
46
  source("https://bioconductor.org/biocLite.R")
  
jlopez's avatar
Fix bug    
jlopez committed
47
  session$userData <- c()
jlopez's avatar
Proto    
jlopez committed
48
  
jlopez's avatar
Fix bug    
jlopez committed
49
  disable("rcranpackagelist")
jlopez's avatar
Proto    
jlopez committed
50
  
jlopez's avatar
Fix bug    
jlopez committed
51
52
53
  #allCRAN <<- as.data.frame(available.packages(repo = "http://cran.us.r-project.org")[, c("Package")])
  allCRAN <<- as.data.frame(getPackagesWithTitle())
  allBIO <<- as.data.frame(available.packages(repo = biocinstallRepos()[1])[, c("Package", "Version")])
jlopez's avatar
jlopez committed
54
  allGITHUB <<- data.frame(Package=character(), Version=character())
jlopez's avatar
jlopez committed
55
56
57
58
59
60
61
62
63
64
65
66
  TMP <<- yaml.load_file("container.yaml")$containers 
  i = 1
  j = 1
  allBIOCONTAINER <<- list()
  for(x in TMP) {
    if(length(TMP[[i]]$install) > 0) {
      
      allBIOCONTAINER[[j]] <<- TMP[[i]]
      j = j + 1
    }
    i = i + 1
  }
jlopez's avatar
Proto    
jlopez committed
67
  
jlopez's avatar
jlopez committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  allWORKFLOWS <<- list()
  TMP <<- yaml.load_file("workflow.yaml")$workflows 
  i = 1
  j = 1
  allWORKFLOWS <<- list()
  for(x in TMP) {
    if(length(TMP[[i]]$install) > 0) {
      
      allWORKFLOWS[[j]] <<- TMP[[i]]
      j = j + 1
    }
    i = i + 1
  }
  
jlopez's avatar
Fix bug    
jlopez committed
82
83
  hide("downloadContainerFile")

jlopez's avatar
Proto    
jlopez committed
84
85
86
87
  source("./server/opt_home.R", local=TRUE)
}

shinyApp(ui = UI, server = server)