-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.packages.R
executable file
·74 lines (67 loc) · 1.89 KB
/
install.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
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
## Promotes the installation of all R packages necessary to BRASUZ1 analysis ##
# Help function to install the R packages available in the CRAN
use_package <- function(p){
if (!is.element(p, installed.packages()[, 1])){
install.packages(p, dep = TRUE)
require(p, character.only = TRUE)
}else{
require(p, character.only = TRUE)
}
}
############
### CRAN ###
############
# List of necessary R packages from CRAN
packages <- c("alluvial",
"berryFunctions",
"corrplot",
"data.table",
"docopt",
"doMC",
"dplyr",
"foreach",
"gdata",
"ggfortify",
"ggplot2",
"ggsci",
"ggthemes",
"googleVis",
"gridExtra",
"gridGraphics",
"Matching",
"plyr",
"RColorBrewer",
"reshape2",
"sjstats",
"splitstackshape",
"stringr",
"tidyr",
"tidyverse",
"VennDiagram")
# install and/or load the packages from CRAN
for (i in packages){
use_package(i)
}
####################
### Bioconductor ###
####################
# List of necessary packages from bioconductor
bioc_packages <- c("AnnotationForge",
"biomaRt",
"clusterProfiler",
"DESeq2",
"edgeR",
"GenomicRanges",
"ggbio",
"Gviz",
"rtracklayer")
#Install and/or load the Bioconductor packages
for (p in bioc_packages){
if (is.element(p, installed.packages()[, 1]) == FALSE){
source("https://bioconductor.org/biocLite.R")
biocLite(paste(p))
require(p, character.only = TRUE)
}else{
require(p, character.only = TRUE)
}
}