Skip to content

Commit 2b72926

Browse files
committed
Adds qa_alpha=0.3 to transmission & delay tasks
1 parent 83506c7 commit 2b72926

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

src/nipah_delays/nipah_delays.R

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ lanonc_colours <- ggsci::pal_lancet("lanonc")(9)
227227
text_size <- 28
228228

229229
qa_thresh_vec <- c("all"=-1, "qa"=0.5)
230+
qa_alpha_vec <- c(0.3, 1)
231+
230232
labels <- c("SI_allqa", "")
231233
colour_columns <- c("parameter_type",
232234
"population_group",
@@ -244,6 +246,7 @@ p7_oo_reduced_plots <- list("all"=list())
244246
for (i in seq_along(qa_thresh_vec)){
245247
label <- labels[i]
246248
qa_threshold <- qa_thresh_vec[i]
249+
qa_alpha <- qa_alpha_vec[i]
247250
plot_type <- names(qa_thresh_vec)[i]
248251
dir.create(plot_type, showWarnings = FALSE)
249252
for (colour_col in colour_columns){
@@ -273,7 +276,7 @@ for (i in seq_along(qa_thresh_vec)){
273276
p1_incb_plots[[plot_type]][[colour_col]] <- forest_plot(
274277
d1 |> filter(qa_score>qa_threshold), "Incubation period (days)",
275278
colour_col, c(0,35), text_size=text_size, segment_show.legend = NA,
276-
sort=TRUE, custom_colours = custom_colours)
279+
sort=TRUE, custom_colours = custom_colours, qa_alpha=qa_alpha)
277280

278281
ggsave(file.path(plot_type,
279282
paste0("figure_5", label, "_incubation_",
@@ -285,7 +288,8 @@ for (i in seq_along(qa_thresh_vec)){
285288
p2_oa_plots[[plot_type]][[colour_col]] <- forest_plot(
286289
d2 |> filter(qa_score>qa_threshold),
287290
'Symptom onset-to-hospitalisation delay (days)', colour_col, c(0,20),
288-
text_size = text_size, sort=TRUE, custom_colours = custom_colours)
291+
text_size = text_size, sort=TRUE, custom_colours = custom_colours,
292+
qa_alpha=qa_alpha)
289293

290294
ggsave(file.path(plot_type,
291295
paste0("figure_5", label, "_onset_admis_",
@@ -309,7 +313,7 @@ for (i in seq_along(qa_thresh_vec)){
309313
p3_ao_plots[[plot_type]][[colour_col]] <- forest_plot(
310314
d3 |> filter(qa_score>qa_threshold), 'Hospitalisation-to-outcome (days)',
311315
colour_col, c(0,45), text_size = text_size, sort=TRUE,
312-
custom_colours = custom_colours)
316+
custom_colours = custom_colours, qa_alpha=qa_alpha)
313317
ggsave(file.path(plot_type,
314318
paste0("figure_5", label, "_admis_outcome_",
315319
colour_col_label, ".pdf")),
@@ -355,7 +359,8 @@ for (i in seq_along(qa_thresh_vec)){
355359
d4_x_axis_label, colour_col, xlim,
356360
text_size = text_size, sort=TRUE,
357361
segment_show.legend = c(shape=FALSE, colour=TRUE),
358-
custom_colours = custom_colours) +
362+
custom_colours = custom_colours,
363+
qa_alpha=qa_alpha) +
359364
# Showing Sim overlaid
360365
geom_point(data=sim_duplicated_row,
361366
aes(x = parameter_value, y = refs,
@@ -402,7 +407,7 @@ for (i in seq_along(qa_thresh_vec)){
402407
d6 |> filter(qa_score>qa_threshold),
403408
'Symptom onset/Hospitalisation-to-outcome (days)',
404409
colour_col, xlim, text_size = text_size, sort=TRUE,
405-
custom_colours = custom_colours)
410+
custom_colours = custom_colours, qa_alpha=qa_alpha)
406411
ggsave(file.path(plot_type,
407412
paste0("figure_5", label, "_onset_admis_outcome_",
408413
colour_col_label, ".pdf")),
@@ -434,7 +439,7 @@ for (i in seq_along(qa_thresh_vec)){
434439
d7 |> filter(qa_score>qa_threshold),
435440
'Symptom onset-to-outcome (days)',
436441
colour_col, c(0,85), text_size = text_size, sort=TRUE,
437-
custom_colours = custom_colours)
442+
custom_colours = custom_colours, qa_alpha=qa_alpha)
438443
ggsave(file.path(plot_type,
439444
paste0("figure_5", label, "_onset_outcome_reduced_",
440445
colour_col_label, ".pdf")),

src/nipah_transmission/nipah_transmission.R

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,20 @@ names(custom_colour_genome_groups) <- all_genomes
125125
# Repeat twice - with and without QA filter
126126
# -1 to include all articles
127127
qa_thresh_vec <- c(-1, 0.5)
128+
qa_alpha_vec <- c(0.3, 1)
128129
labels <- c("SI_allqa_", "")
129130

130131
for (i in seq_along(qa_thresh_vec)){
131132
label <- labels[i]
132133
qa_threshold <- qa_thresh_vec[i]
134+
qa_alpha <- qa_alpha_vec[i]
133135

134136
p1 <- forest_plot(d1 |> filter(qa_score>qa_threshold),
135137
expression(Evolutionary~Rate~(s/s/y ~10^{-4})),
136138
"genome_site",
137139
c(-0.01,15), custom_colours = custom_colour_genome_groups,
138140
segment_show.legend=c(color=TRUE, shape=FALSE),
139-
text_size=text_size) +
141+
text_size=text_size, qa_alpha=qa_alpha) +
140142
scale_color_manual(values=custom_colour_genome_groups,
141143
limits=names(custom_colour_genome_groups)) +
142144
scale_fill_manual(values=custom_colour_genome_groups,
@@ -151,7 +153,7 @@ for (i in seq_along(qa_thresh_vec)){
151153
expression(Substitution~Rate~(s/s/y ~10^{-4})),
152154
"genome_site",
153155
c(0,16), custom_colours = custom_colour_genome_groups,
154-
text_size=text_size) +
156+
text_size=text_size, qa_alpha=qa_alpha) +
155157
guides(shape = guide_legend(title = "Parameter type", order=1),
156158
fill = guide_none(),
157159
color = guide_none())
@@ -160,23 +162,23 @@ for (i in seq_along(qa_thresh_vec)){
160162
"Overdispersion (max nr. of cases related to a case)",
161163
"population_group", c(0,35),
162164
custom_colours = custom_colour_pop_groups,
163-
text_size=text_size) +
165+
text_size=text_size, qa_alpha=qa_alpha) +
164166
guides(color = guide_none(),
165167
shape = guide_none())
166168

167169
p4 <- forest_plot(d4 |> filter(qa_score>qa_threshold),
168170
"Primary Attack Rate (%)",
169171
"population_group",
170172
c(-0.01,3), custom_colours = custom_colour_pop_groups,
171-
text_size=text_size) +
173+
text_size=text_size, qa_alpha=qa_alpha) +
172174
guides(color = guide_none(),
173175
shape = guide_none())
174176

175177
p5 <- forest_plot(d5 |> filter(qa_score>qa_threshold),
176178
"Proportion of Symptomatic Cases (%)",
177179
"population_group",
178180
c(-5, 110), custom_colours = custom_colour_pop_groups,
179-
text_size=text_size) +
181+
text_size=text_size, qa_alpha=qa_alpha) +
180182
guides(color = guide_none(),
181183
shape = guide_none())
182184

@@ -185,7 +187,7 @@ for (i in seq_along(qa_thresh_vec)){
185187
"population_group",
186188
c(0, 1.5), custom_colours = custom_colour_pop_groups,
187189
segment_show.legend=c(color=TRUE, shape=FALSE),
188-
text_size=text_size) +
190+
text_size=text_size, qa_alpha=qa_alpha) +
189191
scale_color_manual(values=custom_colour_pop_groups,
190192
limits=names(custom_colour_pop_groups)) +
191193
scale_fill_manual(values=custom_colour_pop_groups,

0 commit comments

Comments
 (0)