Skip to content

Commit 3af3f87

Browse files
committed
Update design variable names
1 parent 8ec0642 commit 3af3f87

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

config/design_plots.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ theme_update(
2626
)
2727

2828
# Gene palette
29-
gene_colors <- c(
29+
GENE_PALETTE <- c(
3030
M = "#B4D4B4",
3131
N = "#B7B7B8",
3232
orf1ab = "#9CC4DC",
@@ -48,26 +48,26 @@ DIVERSITY_PALETTE <- c(
4848
)
4949

5050
# M-L tree colors and labels
51-
tree_colors <- c(
51+
TREE_PALETTE <- c(
5252
tip_label = "#D944AA99",
5353
boot_alrt_pass = "#64ACEEB2"
5454
)
5555

56-
node.size <- c(
56+
TREE_NODE_SIZE <- c(
5757
tip_label = 2,
5858
boot_alrt_pass = 0.8
5959
)
6060

6161
# Nucleotide variants classification colors and labels
62-
NV_colors <- c(
62+
NV_TYPE_PALETTE <- c(
6363
Frameshift = "#568D63",
6464
"In frame" = "black",
6565
Intergenic = "#B27CF9",
6666
No = "#AE584A",
6767
Yes = "#0248FD"
6868
)
6969

70-
NV_names <- c(
70+
NV_TYPE_NAMES <- c(
7171
Frameshift = "Frameshift",
7272
"In frame" = "Inframe",
7373
Intergenic = "Intergenic",
@@ -76,17 +76,17 @@ NV_names <- c(
7676
)
7777

7878
# dn ds colors and labels
79-
dnds.labels <- c(
79+
DNDS_LABELS <- c(
8080
dn = "dN",
8181
ds = "dS"
8282
)
8383

84-
dnds.colors <- c(
84+
DNDS_COLORS <- c(
8585
dn = "#E53E47",
8686
ds = "#2C47F5"
8787
)
8888

89-
dnds.shapes <- c(
89+
DNDS_SHAPES <- c(
9090
dn = 2,
9191
ds = 4
9292
)

workflow/scripts/report/NV_description.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ variants <- vcf %>%
189189
inherit.aes = FALSE,
190190
width = 0.3
191191
) +
192-
scale_fill_manual(values = gene_colors) +
192+
scale_fill_manual(values = GENE_PALETTE) +
193193
xlim(c(0, 29903)) +
194194
scale_color_manual(
195-
labels = NV_names,
196-
values = NV_colors
195+
labels = NV_TYPE_NAMES,
196+
values = NV_TYPE_PALETTE
197197
) +
198198
scale_y_discrete(drop = FALSE) +
199199
labs(
@@ -227,7 +227,7 @@ window_plot <- window %>%
227227
limits = c(0, max(window$fractions) + 0.005)
228228
) +
229229
xlim(c(0, 29903)) +
230-
scale_color_manual(values = gene_colors) +
230+
scale_color_manual(values = GENE_PALETTE) +
231231
labs(
232232
y = "Proportion of \n sites with NV",
233233
x = "",
@@ -312,7 +312,7 @@ window_plot_spike <- window %>%
312312
) +
313313
xlim(c(min(spike_pos), max(spike_pos))) +
314314
scale_color_manual(
315-
values = gene_colors,
315+
values = GENE_PALETTE,
316316
guide = "none"
317317
) +
318318
labs(
@@ -337,8 +337,8 @@ variants_spike <- vcf_spike %>%
337337
geom_point(size = 3) +
338338
xlim(c(min(spike_pos), max(spike_pos))) +
339339
scale_color_manual(
340-
labels = NV_names,
341-
values = NV_colors
340+
labels = NV_TYPE_NAMES,
341+
values = NV_TYPE_PALETTE
342342
) +
343343
scale_y_discrete(drop = FALSE) +
344344
labs(

workflow/scripts/report/evo_plots.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ plot <- plot_df %>%
8282
geom_line() +
8383
scale_color_manual(
8484
name = "Parameter",
85-
labels = dnds.labels,
86-
values = dnds.colors
85+
labels = DNDS_LABELS,
86+
values = DNDS_COLORS
8787
) +
8888
scale_shape_manual(
8989
name = "Parameter",
90-
values = dnds.shapes,
91-
labels = dnds.labels
90+
values = DNDS_SHAPES,
91+
labels = DNDS_LABELS
9292
) +
9393
labs(
9494
y = "Substitution rate",

workflow/scripts/report/phylo_plots.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ p <- ggtree(tree_ml, layout = "circular") %<+% ml.tree.annot +
242242
geom_rootedge(0.05 * tree_ml.max.tip.length) +
243243
xlim(-tree_ml.max.tip.length / 3, NA) +
244244
scale_color_manual(
245-
values = setNames(tree_colors[names(legend.names)], legend.names),
245+
values = setNames(TREE_PALETTE[names(legend.names)], legend.names),
246246
na.translate = FALSE
247247
) +
248248
scale_size_manual(
249-
values = setNames(node.size[names(legend.names)], legend.names),
249+
values = setNames(TREE_NODE_SIZE[names(legend.names)], legend.names),
250250
na.translate = FALSE
251251
)
252252

0 commit comments

Comments
 (0)