-
Notifications
You must be signed in to change notification settings - Fork 6
/
installPkgsR.R
104 lines (89 loc) · 3.82 KB
/
installPkgsR.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
#!/usr/bin/Rscript
# Check and install if the package is not installed and then load them into the R session.
instpkg <- function(pkg,repo){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg) && repo == 'CRAN') {
install.packages(new.pkg, dependencies = TRUE, repos='https://cloud.r-project.org/')
}
sapply(pkg, require, character.only = TRUE)
}
# CRAN R packages
CRANpkgs <- c("shinyBS", "shinydashboard", "shinydashboardPlus", "shinyFiles", "shinyWidgets", "shinyalert", "Seurat", "htmltools", "shinycssloaders", "shinyjs", "DT", "devtools", "dplyr", "knitr", "kableExtra", "knitcitations", "nycflights13",
"Matrix", "plotly", "reticulate", "pryr", "tools", "igraph", "heatmaply", "data.table", "ggthemes", "evaluate", "psych", "ggjoy", "formattable", "gridExtra", "cowplot", "ggrepel", "data.table", "stringr", "rmarkdown")
instpkg(CRANpkgs, "CRAN")
# check if Dev Shiny installed
pkg <- "shiny"
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg)) {
devtools::install_github("rstudio/shiny", dependencies=FALSE)
}
sapply(pkg, require, character.only = TRUE)
# check if ggplot2 installed
pkg <- "ggplot2"
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg)) {
devtools::install_github("hadley/ggplot2", dependencies=FALSE)
}
sapply(pkg, require, character.only = TRUE)
# check if Seurat installed
#pkg <- "Seurat"
#new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
#if (length(new.pkg)) {
# devtools::install_github("satijalab/seurat", ref = "develop", dependencies=TRUE)
# }
#sapply(pkg, require, character.only = TRUE)
# check if leonawicz/apputils installed
pkg <- "apputils"
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg)) {
devtools::install_github("leonawicz/apputils", dependencies=TRUE)
}
sapply(pkg, require, character.only = TRUE)
# check if Seurat installed
pkg <- "threejs"
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg)) {
devtools::install_github("bwlewis/rthreejs", dependencies=FALSE)
}
sapply(pkg, require, character.only = TRUE)
# check if dashboardthemes installed
pkg <- "dashboardthemes"
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg)) {
devtools::install_github("nik01010/dashboardthemes", dependencies=FALSE)
}
sapply(pkg, require, character.only = TRUE)
# check if MAST installed
pkg <- "MAST"
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg)) {
source("https://bioconductor.org/biocLite.R")
biocLite("MAST")
}
sapply(pkg, require, character.only = TRUE)
# check if UMAP installed
#pkg <- "umap"
#new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
#if (length(new.pkg)) {
# reticulate::py_install(c("numpy", "scipy", "scikit-learn", "numba", "umap-learn"))
#}
#sapply(pkg, require, character.only = TRUE)
# check if FI-tSNE installed
FItSNEpath <- reactiveValues(val=NULL)
#FItSNEpath$val <- Sys.which("fast_tsne")[[1]]
FItSNEbin <- "FIt-SNE-master/bin"
if(!file.exists(paste0(FItSNEbin,"/fast_tsne"))){
#system("git clone https://github.com/FFTW/fftw3.git")
#system("sh fftw3/bootstrap.sh")
#system("fftw3/configure --prefix=fftw3")
#system("make")
#system("make install")
#system("wget https://github.com/KlugerLab/FIt-SNE/archive/ec25f1b36598a2d21869d10a258ac366a12f0b05.zip")
system("unzip FIt-SNE-master.zip")
#system("rm -r v1.0.0.zip")
#system("git clone https://github.com/KlugerLab/FIt-SNE.git")
system("g++ -std=c++11 -O3 FIt-SNE-master/src/sptree.cpp FIt-SNE-master/src/tsne.cpp FIt-SNE-master/src/nbodyfft.cpp -o FIt-SNE-master/bin/fast_tsne -pthread -lfftw3 -lm")
FItSNEpath$val <- as.character("FIt-SNE-master/bin")
} else {
FItSNEpath$val <- as.character("FIt-SNE-master/bin")
}