forked from BIONF/PhyloProfile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphyloprofile.R
46 lines (38 loc) · 1.6 KB
/
phyloprofile.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
#####################################
### 1) install and load packages ###
### 2) start the PhyloProfile app ###
#####################################
### list of dependent packages
packages <- c("shiny","shinyBS","shinyjs","colourpicker","ggplot2","reshape2","DT","plyr","dplyr","tidyr","scales","grid","gridExtra","ape","stringr","gtable","dendextend","ggdendro","gplots","data.table","taxize","zoo","RCurl","devtools","Matching")
### find missing packages and install them
missingPkg <- packages[!packages %in% rownames(installed.packages())]
if(length(missingPkg)){
install.packages(missingPkg, dependencies = TRUE, repos="http://cran.us.r-project.org")
}
### check version and install ggplot2 (gplot2 v2.1 and below has some issues with the ordering)
version_above <- function(pkg, than) {
compareVersion(as.character(packageVersion(pkg)), than)
}
if ("ggplot2" %in% rownames(installed.packages())) {
if (version_above("ggplot2","2.2.0") == -1) {
source("https://bioconductor.org/biocLite.R")
biocLite("ggplot2")
}
} else {
source("https://bioconductor.org/biocLite.R")
biocLite("ggplot2")
}
### install biostrings from bioconductor
if (!("Biostrings" %in% rownames(installed.packages()))) {
source("https://bioconductor.org/biocLite.R")
biocLite("Biostrings")
}
### install shinycssloaders using devtools
if (!("shinycssloaders" %in% rownames(installed.packages()))) {
devtools::install_github('andrewsali/shinycssloaders', force = TRUE)
}
### load require packages
sapply(packages, require, character.only = TRUE)
require(Biostrings)
### run phyloprofile shiny app
shiny::runApp(,launch.browser=TRUE)