-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload_packages.R
44 lines (37 loc) · 1.38 KB
/
load_packages.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
# Package names
packages <- c("ggplot2", 'data.table',
"matrixStats",
"mclust", "tictoc", "mvtnorm", "reshape2", "dplyr", "sparcl",
'cowplot','gghighlight','gridExtra','ggpubr',
'ConsensusClusterPlus',
'Rtsne',
'SC3',
'scater',
'mclust',
'Matrix',
'Seurat')
########### bio packages
package_bio = c('ConsensusClusterPlus','SC3',
'scater','Seurat')
installed_packages <- package_bio %in% rownames(installed.packages())
if (any(installed_packages == FALSE)) {
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(package_bio[!installed_packages])
}
# Install packages not yet installed
installed_packages <- packages %in% rownames(installed.packages())
if (any(installed_packages == FALSE)) {
install.packages(packages[!installed_packages])
}
install.packages()
# Packages loading
invisible(lapply(packages, library, character.only = TRUE))
package_bio = c('ConsensusClusterPlus')
installed_packages <- package_bio %in% rownames(installed.packages())
if (any(installed_packages == FALSE)) {
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(package_bio[!installed_packages])
}
BiocManager::install('ConsensusClusterPlus')