-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunStartup.R
134 lines (120 loc) · 3.46 KB
/
runStartup.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Run before execution of the Rmarkdown documents
knitr::opts_chunk$set(
eval = TRUE,
message = TRUE,
warning = TRUE,
comment = "#>"
)
# Define rootdir and cachedir
outdir <- paste0(rootdir, "/analysis_results/")
suppressWarnings(dir.create(outdir, recursive = TRUE))
# Disable BLAS multithreading
RhpcBLASctl::blas_set_num_threads(1)
RhpcBLASctl::omp_set_num_threads(1)
# For MAGeCK
Sys.setenv(MAGECKPATH = "/home/rstudio/.local/bin/")
suppressMessages({
library(AnnotationDbi)
library(ashr)
library(batchelor)
library(BiocParallel)
library(biomaRt)
library(Biostrings)
library(BSgenome.Mmusculus.UCSC.mm10)
library(chromVAR)
library(ComplexHeatmap)
ht_opt$message <- FALSE
library(CreateGeneSignatures)
library(data.table)
library(DESeq2)
library(edgeR)
library(EnrichedHeatmap)
library(fgsea)
library(GenomicRanges)
library(GEOquery)
library(ggpointdensity)
library(ggpubr)
library(ggrepel)
library(ggsignif)
library(ggupset)
library(glmGamPoi)
library(gprofiler2)
library(gridtext)
library(hexbin)
library(imputeLCMD)
library(limma)
library(magrittr)
library(matrixStats)
library(Matrix)
library(memes)
library(motifmatchr)
library(MSnbase)
library(openxlsx)
library(org.Mm.eg.db)
library(patchwork)
library(S4Vectors)
library(scater)
library(scDblFinder)
library(scran)
library(sctransform)
library(scuttle)
library(SingleCellExperiment)
library(SingleR)
library(slingshot)
library(SummarizedExperiment)
library(TFBSTools)
library(tidyverse)
library(tximport)
library(viridis)
library(vizzy)
library(UCell)
})
source(paste0(rootdir, "/functions.R"))
# BiocParallel (always use bplapply instead of mclapply)
mc_workers <- floor(parallel::detectCores() * 0.9)
doParallel::registerDoParallel(mc_workers)
bpparam <- BiocParallel::DoparParam()
list.ggplot <- list()
list.ggplot$colorblind_cols <- c(
"#E69F00", "#56B4E9", "#009E73", "#F0E442",
"#0072B2", "#D55E00", "#CC79A7", "#661100",
"#332288", "gray40", "black"
)
# make brighter and darker
list.ggplot$colorblind_cols <-
c(
list.ggplot$colorblind_cols,
colorspace::lighten(list.ggplot$colorblind_cols, .5),
colorspace::lighten(list.ggplot$colorblind_cols, .9)
)
# some global options for ggplot, to achieve some standard appearances:
list.ggplot$theme <- ggplot2::theme_bw # default theme
list.ggplot$themesize <- 12 # base_size option
list.ggplot$pointsize <- 0.5 # point size for UMAPs
list.ggplot$pointsize_larger <- 3 # for dotplots with few points
list.ggplot$textsize <- 3.5 #
list.ggplot$ablinesize <- .5 #
list.ggplot$linesize <- 1 #
list.ggplot$umap_alpha <- 0.6 # for UMAPs: alpha of points
list.ggplot$legendsize <- 3
list.ggplot$genotype_colors <- c("#999933", "#4d77f5")
# set the global theme:
theme_set(list.ggplot$theme(base_size = list.ggplot$themesize))
theme_update(
axis.text = element_text(size = list.ggplot$themesize),
axis.title = element_text(size = list.ggplot$themesize),
legend.text = element_text(size = list.ggplot$themesize),
legend.title = element_text(size = list.ggplot$themesize),
strip.text = element_text(size = list.ggplot$themesize),
strip.background = element_rect(fill = "white"),
text = element_text(size = list.ggplot$themesize)
)
gg.noX <- theme(
axis.title.x = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank()
)
base::options(
ggplot2.discrete.colour = list.ggplot$colorblind_cols,
ggplot2.discrete.fill = list.ggplot$colorblind_cols
)