Skip to content

Commit 8ec0642

Browse files
committed
Define diversity plot palette in design script
1 parent afbe502 commit 8ec0642

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

config/design_plots.R

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ theme_update(
2525
panel.grid = element_line(linewidth = 0.17, color = "lightgray")
2626
)
2727

28-
29-
# CONFIG
30-
gene_colors = c(
28+
# Gene palette
29+
gene_colors <- c(
3130
M = "#B4D4B4",
3231
N = "#B7B7B8",
3332
orf1ab = "#9CC4DC",
@@ -40,9 +39,16 @@ gene_colors = c(
4039
ORF10 = "#CACB5D"
4140
)
4241

42+
# Nucleotide diversity
43+
DIVERSITY_PALETTE <- c(
44+
density_fill = "#fcbf49",
45+
density_color = "#eae2b7",
46+
value_color = "#d62828",
47+
dnorm_color = "#f77f00"
48+
)
4349

4450
# M-L tree colors and labels
45-
tree_colors = c(
51+
tree_colors <- c(
4652
tip_label = "#D944AA99",
4753
boot_alrt_pass = "#64ACEEB2"
4854
)

workflow/scripts/report/diversity_plot.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ p <- data.frame(pi = divs) %>%
2525
ggplot() +
2626
geom_density(
2727
aes(x = pi),
28-
fill = "#fcbf49",
28+
fill = DIVERSITY_PALETTE["density_fill"],
2929
alpha = 0.7,
3030
bw = 0.000001,
31-
color = "#eae2b7"
31+
color = DIVERSITY_PALETTE["density_color"]
3232
) +
3333
geom_vline(
3434
xintercept = json$diversity,
35-
color = "#d62828"
35+
color = DIVERSITY_PALETTE["value_color"]
3636
) +
3737
stat_function(
3838
fun = dnorm,
3939
args = list(mean = mean(divs), sd = sd(divs)),
40-
color = "#f77f00"
40+
color = DIVERSITY_PALETTE["dnorm_color"]
4141
) +
4242
labs(
4343
x = "π",

0 commit comments

Comments
 (0)