-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathsetup_microbiome_analysis.R
86 lines (68 loc) · 2.84 KB
/
setup_microbiome_analysis.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
############################################################################################################################################
# #
# START OF CODE #
# #
############################################################################################################################################
# These are some R pacakges I commonly use for analysis. Everytime I update R to latest version, I run this installation to in setup my environment.
# Copy from here
setup_microbiome_analysis <- function(){
.packages = c("ape",
"gridExtra",
"picante",
"data.table",
"RColorBrewer",
"DT",
"reshape",
"reshape2",
"magrittr",
"markdown",
"ggpubr",
"tibble",
"pheatmap",
"dplyr",
"viridis",
"devtools",
"rmdformats",
"intergraph",
"network",
"igraph",
"ggplot2",
"gridExtra",
"knitr",
"vegan",
"plyr",
"dplyr",
"ggrepel",
"ggnetwork",
"ade4",
"rmarkdown",
"formatR",
"caTools",
"GGally")
.bioc_packages <- c("phyloseq",
"microbiome",
"phangorn",
"genefilter")
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
# Install CRAN packages (if not already installed)
.inst <- .packages %in% installed.packages()
if(length(.packages[!.inst]) > 0) install.packages(.packages[!.inst])
.inst <- .bioc_packages %in% installed.packages()
if(any(!.inst)) {
BiocManager::install(.bioc_packages[!.inst])
}
if (!("microbiomeutilities" %in% installed.packages())) {
devtools::install_github("microsud/microbiomeutilities")
}
if (!("SpiecEasi" %in% installed.packages())) {
devtools::install_github("zdk123/SpiecEasi")
}
if (!("ggnet" %in% installed.packages())) {
devtools::install_github("briatte/ggnet")
}
message("If there was no error then you are ready to do microbiome data analysis")
}
setup_microbiome_analysis()
# Copy until here previous line!
####################################################END OF CODE###########################################################################