|
a |
|
b/setup_renv.R |
|
|
1 |
# Install renv if not already installed |
|
|
2 |
if (!requireNamespace("renv", quietly = TRUE)) { |
|
|
3 |
install.packages("renv", repos = "https://cloud.r-project.org") |
|
|
4 |
} |
|
|
5 |
|
|
|
6 |
# Initialize renv |
|
|
7 |
renv::init(force = TRUE) |
|
|
8 |
|
|
|
9 |
# Install BiocManager first |
|
|
10 |
if (!requireNamespace("BiocManager", quietly = TRUE)) { |
|
|
11 |
install.packages("BiocManager") |
|
|
12 |
} |
|
|
13 |
|
|
|
14 |
# Install Bioconductor packages first |
|
|
15 |
BiocManager::install(c("MAST", "DESeq2", "SingleCellExperiment")) |
|
|
16 |
|
|
|
17 |
# Install CRAN packages |
|
|
18 |
renv::install(c( |
|
|
19 |
"svDialogs", |
|
|
20 |
"vroom", |
|
|
21 |
"dplyr", |
|
|
22 |
"DT", |
|
|
23 |
"Seurat", |
|
|
24 |
"harmony", |
|
|
25 |
"patchwork", |
|
|
26 |
"ggplot2", |
|
|
27 |
"ggrepel", |
|
|
28 |
"ggvenn", |
|
|
29 |
"openxlsx", |
|
|
30 |
"progress", |
|
|
31 |
"rio", |
|
|
32 |
"pheatmap", |
|
|
33 |
"ggfortify", |
|
|
34 |
"devtools", |
|
|
35 |
"Rcpp", |
|
|
36 |
"RcppArmadillo" |
|
|
37 |
)) |
|
|
38 |
|
|
|
39 |
# Install presto from GitHub with explicit dependencies |
|
|
40 |
renv::install("immunogenomics/presto", type = "github") |
|
|
41 |
|
|
|
42 |
# Verify presto installation |
|
|
43 |
if (!requireNamespace("presto", quietly = TRUE)) { |
|
|
44 |
stop("Failed to install presto package") |
|
|
45 |
} |
|
|
46 |
|
|
|
47 |
# Snapshot the current state |
|
|
48 |
renv::snapshot() |