From 888549339c286215b12d9385a98955dd75fe92d9 Mon Sep 17 00:00:00 2001 From: Kelly McCain Date: Tue, 23 Sep 2025 14:18:48 +0100 Subject: [PATCH 1/5] stash map changes --- R/zika_maps.R | 2 ++ src/zika_prep_data/data_curation.R | 4 ++-- src/zika_prep_data/zika_prep_data.R | 14 +++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/R/zika_maps.R b/R/zika_maps.R index 417dce8b..33677a0a 100644 --- a/R/zika_maps.R +++ b/R/zika_maps.R @@ -1,3 +1,5 @@ +# moved to an orderly task within priority pathogens project + library(ggplot2) library(sf) library(rnaturalearth) diff --git a/src/zika_prep_data/data_curation.R b/src/zika_prep_data/data_curation.R index dc69ece5..eb9434f9 100644 --- a/src/zika_prep_data/data_curation.R +++ b/src/zika_prep_data/data_curation.R @@ -3,7 +3,7 @@ # curated data should be used for plotting but not for the final epireview dataset (i.e. we have changed to inverse parameters, exponentiated, etc) -data_curation <- function(articles, outbreaks, models, parameters, plotting, switch_first_surname=FALSE) { +data_curation_zika <- function(articles, outbreaks, models, parameters, plotting, switch_first_surname=FALSE) { # this is due to legacy access database issue if(switch_first_surname){ @@ -118,7 +118,7 @@ data_curation <- function(articles, outbreaks, models, parameters, plotting, swi curation <- function(articles, outbreaks, models, parameters, plotting) { #call data_curation function (which at some stage will move to epireview) but keep curation to be backward compatible - df <- data_curation(articles,outbreaks,models,parameters,plotting) + df <- data_curation_zika(articles,outbreaks,models,parameters,plotting) return(list(articles = df$articles, outbreaks = df$outbreaks, models = df$models, parameters = df$parameters)) diff --git a/src/zika_prep_data/zika_prep_data.R b/src/zika_prep_data/zika_prep_data.R index 104e466e..2efdc574 100644 --- a/src/zika_prep_data/zika_prep_data.R +++ b/src/zika_prep_data/zika_prep_data.R @@ -1,12 +1,12 @@ -# This script is to be run after zika_compilation which provides basic cleaning -# In this script, we will do general preparation of data for tables and figures +# This script is to be run after zika_compilation which provides basic cleaning +# In this script, we will do general preparation of data for tables and figures # It will take the place of the data_curation() function currently housed in lassa_function.R # as well as the ad-hoc data cleaning in each of the analysis orderly tasks library(dplyr) library(stringr) -#orderly preparation +#orderly preparation orderly_strict_mode() orderly_parameters(pathogen = NULL, plotting = NULL) # can be TRUE or FALSE; TRUE outputs plotting-ready dfs @@ -68,16 +68,16 @@ parameters <- dfs$parameters %>% left_join(qa_scores) %>% mutate(article_label = make.unique(refs)) %>% mutate(article_label = factor(article_label,levels=rev(unique(article_label)))) -# once i add in the extra cleaning in each task, then can remove that from the analsysi tasks as well +# once i add in the extra cleaning in each task, then can remove that from the analsysi tasks as well # (Especially the latex tables one) -# Save genomic data +# Save genomic data genomic <- parameters %>% filter(parameter_class == 'Mutations') %>% left_join(articles %>% select(-c(name_data_entry, qa_score, article_label, refs, id)), by = c('covidence_id', 'pathogen')) %>% select( -c(starts_with('riskfactor'), r_pathway, seroprevalence_adjusted, third_sample_param_yn, - contains('delay'), method_2_from_supplement, #starts_with('cfr'), - starts_with('distribution'), case_definition, exponent_2, + contains('delay'), method_2_from_supplement, #starts_with('cfr'), + starts_with('distribution'), case_definition, exponent_2, inverse_param, inverse_param_2, name_data_entry, trimester_exposed, starts_with('parameter_2'))) saveRDS(genomic, "zika_genomic.rds") From 4fd21a8b771896903df1017368b25322809651fb Mon Sep 17 00:00:00 2001 From: Kelly McCain Date: Mon, 5 Jan 2026 09:26:33 +0000 Subject: [PATCH 2/5] save figures in .eps form --- orderly_config.yml | 2 +- shared/lassa_functions.R | 9 ++- src/zika_outbreaks/zika_outbreaks.R | 52 ++++++++++++------ .../zika_reproduction_numbers.R | 29 +++++++--- src/zika_serop/zika_serop.R | 55 +++++++++++++++++-- .../zika_zcs_microcephaly.R | 8 ++- zika_workflow.R | 2 +- 7 files changed, 122 insertions(+), 35 deletions(-) diff --git a/orderly_config.yml b/orderly_config.yml index a42e95dd..df36e653 100644 --- a/orderly_config.yml +++ b/orderly_config.yml @@ -1,4 +1,4 @@ -minimum_orderly_version: "1.99.0" +minimum_orderly_version: "2.0.2" plugins: orderly.sharedfile: lassasingledb: "Z:/Lassa/Databases/Single Extractions" diff --git a/shared/lassa_functions.R b/shared/lassa_functions.R index 62897c1e..32f82490 100644 --- a/shared/lassa_functions.R +++ b/shared/lassa_functions.R @@ -534,6 +534,8 @@ metaprop_wrap <- function(dataframe, subgroup, method.tau = "ML") png(file = "temp.png", width = width, height = height, res = resolution) + # postscript("CZS_metaanalysis_trimester.eps", width = 15, height = 37, horizontal = FALSE) + # pdf("CZS_metaanalysis_trimester.pdf", width = 10, height = 15) forest(mtan, layout = "RevMan5", overall = plot_pooled, pooled.events = TRUE, print.subgroup.name = FALSE, sort.subgroup = sort_by_subg, @@ -543,9 +545,12 @@ metaprop_wrap <- function(dataframe, subgroup, col.diamond.lines = "black",col.diamond.common = colour, col.diamond.random = colour, col.subgroup = "black", col.inside = "black", weight.study = "same", #col.square.lines = "green", col.square = "blue", #not working - at = at, xlim = xlim, xlab=xlabel, fontsize=11) + at = at, xlim = xlim, xlab=xlabel, fontsize = 11) + # fontsize=9, # Reduce font size + # spacing = 0.7, # Reduce spacing between studies + # squaresize = 0.5) dev.off() - } else { + } else { mtan <- metaprop(data = dataframe, studlab = dataframe[[studylabels]], event = cfr_ifr_numerator, diff --git a/src/zika_outbreaks/zika_outbreaks.R b/src/zika_outbreaks/zika_outbreaks.R index c87c6030..9865077d 100644 --- a/src/zika_outbreaks/zika_outbreaks.R +++ b/src/zika_outbreaks/zika_outbreaks.R @@ -1,4 +1,4 @@ -# Task to produce results for outbreaks +# Task to produce results for outbreaks library(tidyverse) library(ggplot2) @@ -10,7 +10,7 @@ library(ggrepel) library(countrycode) library(ggpattern) -#orderly preparation +#orderly preparation orderly_strict_mode() orderly_parameters(pathogen = NULL) orderly_dependency("zika_prep_data", "latest(parameter:pathogen == this:pathogen && @@ -24,7 +24,7 @@ outbreaks <- readRDS('outbreaks_curated.rds') articles <- readRDS('articles_curated.rds') world <- ne_countries(scale = 'medium', returnclass = 'sf') -outbreaks <- merge(outbreaks, articles, by = "covidence_id") +outbreaks <- merge(outbreaks, articles, by = "covidence_id") outbreaks <- filter(outbreaks, !qa_score < 0.5) outbreaks.WHO <- c( @@ -32,18 +32,18 @@ outbreaks.WHO <- c( "Côte d’Ivoire", "Ethiopia", "Gabon", "Guinea-Bissau", "Kenya", "Nigeria", "Senegal", "Uganda", "Anguilla", "Antigua and Barbuda" , "Argentina", "Aruba", "Bahamas", "Barbados", "Belize", "Bolivia", "Bonaire", "Sint Eustatius", "Saba", "Brazil", "British Virgin Islands", - "Cayman Islands", "Colombia", "Costa Rica", "Cuba", "Curaçao", "Dominica", "Dominican Republic", + "Cayman Islands", "Colombia", "Costa Rica", "Cuba", "Curaçao", "Dominica", "Dominican Republic", "Ecuador", "El Salvador", "French Guiana", "Grenada", "Guadeloupe", "Guatemala", "Guyana", "Haiti", "Honduras", "Easter Island– Chile", "Jamaica", "Martinique", "Mexico", "Montserrat", "Nicaragua", "Panama", "Paraguay", "Peru", "Puerto Rico", "Saint Barthélemy", "Saint Kitts", "Nevis", "Saint Lucia", "Saint Martin", "Saint Vincent", "Grenadines", - "Saint Maarten", "Suriname", "Trinidad", "Tobago", "Turks", "Caicos", - "United States of America", "United States Virgin Islands", "Venezuela", + "Saint Maarten", "Suriname", "Trinidad", "Tobago", "Turks", "Caicos", + "United States of America", "United States Virgin Islands", "Venezuela", "Bangladesh", "India", "Indonesia", "Maldives", "Myanmar", "Thailand", - "American Samoa", "Cambodia", "Cook Islands", "Fiji", "French Polynesia", + "American Samoa", "Cambodia", "Cook Islands", "Fiji", "French Polynesia", "Lao People’s Democratic Republic","Marshall Islands", "Malaysia", "Micronesia" , "New Caledonia", "Palau", "Papua New Guinea", "Philippines", "Samoa", "Singapore", - "Solomon Islands", "Tonga", "Vanuatu", "Vietnam", "France", "The Bahamas" + "Solomon Islands", "Tonga", "Vanuatu", "Vietnam", "France", "The Bahamas" ) outbreaks_agg <- outbreaks %>% @@ -70,7 +70,7 @@ out_sf <- out_sf %>% out_plt <- ggplot() + # Layer based on n outbreaks geom_sf(data = out_sf, aes(fill = as.factor(n)), color = "gray50", lwd = 0.3) + - + # Layer for outbreak.WHO geom_sf_pattern( data = filter(out_sf, is_outbreak_who), @@ -85,26 +85,46 @@ out_plt <- ggplot() + pattern_size = 0.01, color = NA ) + - + # Viridis scale - scale_fill_viridis_d(na.value = 'grey90', guide = guide_legend(na.translate = FALSE)) + + scale_fill_viridis_d(na.value = 'grey90', guide = guide_legend( + na.translate = FALSE, + keywidth = unit(0.3, "cm"), + keyheight = unit(0.3, "cm") + )) + theme_void() + theme(axis.text = element_blank(), text = element_text(size = 14)) + labs(fill = 'Number of papers\nreporting outbreaks', x = '', y = '') + - + # labels geom_label_repel(data = out_sf %>% filter(!is.na(n)), - aes(x = label_x, y = label_y, label = paste0(admin, ": ", n)), + aes(x = label_x, y = label_y, label = paste0(admin, ": ", n)), fontface = "bold", size = 3, max.overlaps = 50, label.padding = 0.2) + - + theme(legend.position = c(0.1,0.2), + legend.text = element_text(size = 6), + legend.title = element_text(size = 6))+ + coord_sf(xlim = c(-180, 180), ylim = c(-60, 90)) +ggsave( + "outbreaks_QA2.pdf", + device = cairo_pdf, + plot = out_plt, + width = 180, + height = 100, + scale = 1.2, + units = "mm", + bg = "white" + ) + ggsave("outbreaks_QA.png", out_plt, bg = 'white', height = 8, width = 14, dpi =300) +ggsave("outbreaks_QA.svg", out_plt, bg = 'white', height = 8, width = 14, dpi =300) +ggsave("outbreaks_QA.eps", out_plt, device = eps, bg = 'white', height = 8, width = 14, dpi =300) # ggsave("outbreaks.png", out_plt, bg = 'white', height = 8, width = 14, dpi =300) # ggsave("sero_all.png", sero_all, bg = 'white') # ggsave("sero_general.png", sero_gen, bg = 'white') @@ -114,13 +134,13 @@ ggsave("outbreaks_QA.png", out_plt, bg = 'white', height = 8, width = 14, dpi =3 # nrow(outbreaks) # length(unique(outbreaks$covidence_id)) # length(unique(outbreaks$outbreak_country)) -# +# # table(outbreaks$outbreak_country) # outsumm <- as.data.frame(table(outbreaks$outbreak_country, outbreaks$covidence_id)) %>% # filter(Freq > 0) %>% # group_by(Var1) %>% # count() -# +# # outbreaks <- outbreaks %>% # mutate(continent = countrycode(sourcevar = outbreak_country, # origin = "country.name", diff --git a/src/zika_reproduction_numbers/zika_reproduction_numbers.R b/src/zika_reproduction_numbers/zika_reproduction_numbers.R index e056d7e8..48c1030c 100644 --- a/src/zika_reproduction_numbers/zika_reproduction_numbers.R +++ b/src/zika_reproduction_numbers/zika_reproduction_numbers.R @@ -14,7 +14,7 @@ library(png) library(grid) library(patchwork) library(gridExtra) -library(orderly2) +library(orderly) library(countrycode) library(janitor) @@ -320,13 +320,21 @@ re_mosquito <- forest_plot_zika(parameters %>% filter(parameter_type == 'Reprodu HEIGHT = 25 WIDTH = 20 -ggsave("r0_pc.pdf", r0_pc, height = HEIGHT, width = WIDTH, bg = 'white') -ggsave("r0_sampletype.pdf", r0_sampletype, height = 24, width = WIDTH, bg = 'white') -ggsave("r0_human.pdf", r0_human, height = 10, width = WIDTH, bg = 'white') -ggsave("r0_mosquito.pdf", r0_mosquito, height = 8, width = WIDTH, bg = 'white') -ggsave("re.pdf", re, height = 14, width = WIDTH, bg = 'white') -ggsave("re_human.pdf", re_human, height = 12, width = 12, bg = 'white') -ggsave("re_mosquito.pdf", re_mosquito, height = 10, width = 12, bg = 'white') +ggsave("r0_pc.pdf", r0_pc, height = HEIGHT, width = WIDTH, bg = 'white', device = cairo_pdf) +ggsave("r0_sampletype.pdf", r0_sampletype, height = 24, width = WIDTH, bg = 'white', device = cairo_pdf) +ggsave("r0_human.pdf", r0_human, height = 10, width = WIDTH, bg = 'white', device = cairo_pdf) +ggsave("r0_mosquito.pdf", r0_mosquito, height = 8, width = WIDTH, bg = 'white', device = cairo_pdf) +ggsave("re.pdf", re, height = 14, width = WIDTH, bg = 'white', device = cairo_pdf) +ggsave("re_human.pdf", re_human, height = 12, width = 12, bg = 'white', device = cairo_pdf) +ggsave("re_mosquito.pdf", re_mosquito, height = 10, width = 12, bg = 'white', device = cairo_pdf) + +ggsave("r0_pc.eps", r0_pc, height = HEIGHT, width = WIDTH, bg = 'white', device = cairo_ps) +ggsave("r0_sampletype.eps", r0_sampletype, height = 24, width = WIDTH, bg = 'white', device = cairo_ps) +ggsave("r0_human.eps", r0_human, height = 10, width = WIDTH, bg = 'white', device = cairo_ps) +ggsave("r0_mosquito.eps", r0_mosquito, height = 8, width = WIDTH, bg = 'white', device = cairo_ps) +ggsave("re.eps", re, height = 14, width = WIDTH, bg = 'white', device = cairo_ps) +ggsave("re_human.eps", re_human, height = 12, width = 12, bg = 'white', device = cairo_ps) +ggsave("re_mosquito.eps", re_mosquito, height = 10, width = 12, bg = 'white', device = cairo_ps) ggsave("r0_pc.png", r0_pc, height = HEIGHT, width = WIDTH, bg = 'white') ggsave("r0_sampletype.png", r0_sampletype, height = 24, width = WIDTH, bg = 'white') @@ -375,6 +383,11 @@ ggsave("r0_plnoqa.pdf", r0__plnoqa, height = 25, width = 20, bg = 'white') ggsave("re_pl.pdf", re_pl, height = 12, width = 20, bg = 'white') ggsave("re_plnoqa.pdf", re_plnoqa, height = 12, width = 20, bg = 'white') +ggsave("r0_pl.eps", r0_pl, height = 25, width = 20, bg = 'white', device = cairo_ps) +ggsave("r0_plnoqa.eps", r0__plnoqa, height = 25, width = 20, bg = 'white', device = cairo_ps) +ggsave("re_pl.eps", re_pl, height = 12, width = 20, bg = 'white', device = cairo_ps) +ggsave("re_plnoqa.eps", re_plnoqa, height = 12, width = 20, bg = 'white', device = cairo_ps) + ggsave("r0_pl.png", r0_pl, height = 25, width = 20, bg = 'white', dpi = 400) ggsave("r0_plnoqa.png", r0__plnoqa, height = 25, width = 20, bg = 'white', dpi = 400) ggsave("re_pl.png", re_pl, height = 12, width = 20, bg = 'white', dpi = 400) diff --git a/src/zika_serop/zika_serop.R b/src/zika_serop/zika_serop.R index 5a6bebd4..48cab720 100644 --- a/src/zika_serop/zika_serop.R +++ b/src/zika_serop/zika_serop.R @@ -307,8 +307,8 @@ central_africa <- ggplot() + central_africa <- central_africa+ labs(fill = NULL, col = NULL) + theme(legend.position = c(0.2,0.3), - legend.text = element_text(size = 6), - legend.title = element_text(size = 6))+ + legend.text = element_text(size = 12), + legend.title = element_text(size = 12))+ # theme(legend.position = "none")+ # legend.background = element_rect(fill = "transparent"))+ #theme(legend.position = c(0.1,0.2))+ @@ -334,9 +334,22 @@ central_asia <- central_asia + axis.title = element_blank() # Remove axis titles ) +# coord <- coord_sf(expand = FALSE) + +# south_america <- south_america + coord +# central_africa <- central_africa + coord +# central_asia <- central_asia + coord + +final_plot <- ggarrange( + south_america, + central_africa, + central_asia, + ncol = 3, + align = "hv" +) # Final multipanel plot -final_plot <- wrap_plots(south_america, central_africa, central_asia, ncol = 3) +final_plot <- ggarrange(south_america, central_africa, central_asia, ncol = 3) # + # plot_layout(guides = "none") # final_plot @@ -348,8 +361,42 @@ ggsave( paste0("ZIKA_serop_map_QA.png"), plot = final_plot, device = png, + scale = 1, - height = 50, + height = 100, + width = 200, + units = "mm", + dpi = 300) + +ggsave( + paste0("ZIKA_serop_map_QA_AF.pdf"), + plot = central_africa, + # device = pdf, + device = cairo_pdf, + scale = 1, + height = 200, + width = 200, + units = "mm", + dpi = 300) + +ggsave( + paste0("ZIKA_serop_map_QA_SA.pdf"), + plot = south_america, + # device = pdf, + device = cairo_pdf, + scale = 1, + height = 200, + width = 200, + units = "mm", + dpi = 300) + +ggsave( + paste0("ZIKA_serop_map_QA_AS.pdf"), + plot = central_asia, + device = cairo_pdf, + # device = pdf, + scale = 1, + height = 200, width = 200, units = "mm", dpi = 300) diff --git a/src/zika_zcs_microcephaly/zika_zcs_microcephaly.R b/src/zika_zcs_microcephaly/zika_zcs_microcephaly.R index 3956018a..6b292f73 100644 --- a/src/zika_zcs_microcephaly/zika_zcs_microcephaly.R +++ b/src/zika_zcs_microcephaly/zika_zcs_microcephaly.R @@ -14,7 +14,7 @@ library(png) library(grid) library(patchwork) library(gridExtra) -library(orderly2) +library(orderly) library(countrycode) #orderly preparation @@ -181,7 +181,8 @@ CZSplot_noqa <- forest_plot_zika(CZS_rate %>% arrange(central) , custom_colours = cols) + theme(legend.position = 'inside', legend.position.inside = c(.66, 0.36)) # ggsave(filename = 'CZS_plot_loc_country.svg', CZSplot, height =26, width = 14, bg = 'white') -ggsave(filename = 'CZS_plot_loc_country.pdf', CZSplot, height =24, width = 15, bg = 'white') +ggsave(filename = 'CZS_plot_loc_country.pdf', CZSplot, height =24, width = 15, bg = 'white', device = cairo_pdf) +ggsave(filename = 'CZS_plot_loc_country.eps', CZSplot, height =24, width = 15, bg = 'white', device = cairo_ps) # ggsave(filename = 'CZS_plot_loc_country_noqa.svg', CZSplot_noqa, height =32, width = 16, bg = 'white') ggsave(filename = 'CZS_plot_loc_country_noqa.pdf', CZSplot_noqa, height =32, width = 16, bg = 'white') @@ -360,7 +361,8 @@ metaanalysis_CZS_trimester <- metaprop_wrap(dataframe = CZSqa , CZS_meta_trimester <- metaanalysis_CZS_trimester$plot ggsave(filename = "CZS_metaanalysis_trimester.svg", plot = CZS_meta_trimester, width = 5, height = 9) -ggsave(filename = "CZS_metaanalysis_trimester.pdf", plot = CZS_meta_trimester, width = 5, height = 9) +ggsave(filename = "CZS_metaanalysis_trimester.pdf", plot = CZS_meta_trimester, width = 5, height = 9, device = cairo_pdf) +ggsave(filename = "CZS_metaanalysis_trimester.eps", plot = CZS_meta_trimester, width = 9, height = 5, device = cairo_ps, dpi = 500) metaanalysis_CZS_trimester_noqa <- metaprop_wrap(dataframe = CZS_meta_noqa, plot_pooled = FALSE, subgroup = 'trimester_exposed', diff --git a/zika_workflow.R b/zika_workflow.R index ff02e1e7..6457a0bc 100644 --- a/zika_workflow.R +++ b/zika_workflow.R @@ -4,7 +4,7 @@ # install.packages("orderly2", repos = c("https://mrc-ide.r-universe.dev", "https://cloud.r-project.org")) # remotes::install_github("mrc-ide/orderly.sharedfile") #orderly2::orderly_init(".") -library(orderly2) +library(orderly) library(optparse) library(ids) library(zip) From ba2a662cbda7ffb160cde5f3815c87758ab0e08e Mon Sep 17 00:00:00 2001 From: Kelly McCain Date: Thu, 15 Jan 2026 17:44:44 +0000 Subject: [PATCH 3/5] fix dois in article df; change how to save delays plot --- src/zika_compilation/zika_cleaning.R | 11 +++++++++++ src/zika_compilation/zika_compilation.R | 2 +- src/zika_delays/zika_delays.R | 5 +++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/zika_compilation/zika_cleaning.R b/src/zika_compilation/zika_cleaning.R index 6179315d..3d92e8d4 100644 --- a/src/zika_compilation/zika_cleaning.R +++ b/src/zika_compilation/zika_cleaning.R @@ -164,6 +164,7 @@ zika_clean_articles <- function(df, pathogen){ df <- df %>% mutate(# Fix issues with dois doi = str_remove_all(doi, 'doi:'), + doi = str_remove_all(doi, 'DOI: '), doi = str_remove_all(doi, 'http://dx.doi.org/'), doi = str_remove_all(doi, 'https://doi.org/'), doi = str_remove(doi, "^/"), @@ -173,7 +174,17 @@ zika_clean_articles <- function(df, pathogen){ covidence_id %in% 1154 ~ "10.1136/bmjgh-2017-000309", covidence_id %in% 1993 ~ "10.1080/00034983.1983.11811687", covidence_id %in% 3042 ~ "10.1371/journal.pntd.0004726", + covidence_id %in% 5695 ~ '10.3390/ijerph18041831', + covidence_id %in% 8141 ~ '10.1016/j.ijid.2023.01.033', + covidence_id %in% 11565 ~ '10.3390/v13030523', + covidence_id %in% 31965 ~ '10.1001/jamanetworkopen.2019.8124', TRUE ~ doi + ), + journal = case_when( + covidence_id %in% 5695 ~ 'INTERNATIONAL JOURNAL OF ENVIRONMENTAL RESEARCH AND PUBLIC HEALTH', + covidence_id %in% 8141 ~ 'INTERNATIONAL JOURNAL OF INFECTIOUS DISEASES', + covidence_id %in% 11565 ~ 'Viruses', + TRUE ~ journal )) #%>% # # Update article label # # for different articles by the same author in the same year diff --git a/src/zika_compilation/zika_compilation.R b/src/zika_compilation/zika_compilation.R index 68983a87..e89f0c10 100644 --- a/src/zika_compilation/zika_compilation.R +++ b/src/zika_compilation/zika_compilation.R @@ -3,7 +3,7 @@ # install.packages('rio') library(dplyr) library(janitor) -library(orderly2) +library(orderly) library(readr) library(stringr) library(stringi) diff --git a/src/zika_delays/zika_delays.R b/src/zika_delays/zika_delays.R index f6adc147..f3699121 100644 --- a/src/zika_delays/zika_delays.R +++ b/src/zika_delays/zika_delays.R @@ -14,7 +14,7 @@ library(png) library(grid) library(patchwork) library(gridExtra) -library(orderly2) +library(orderly) library(countrycode) #orderly preparation @@ -391,7 +391,8 @@ CCDD EEEE" delays_plot <- incp2 + IP_forest + lat_onset_serialplt + outcome_forest + eip_forest+ plot_layout(design = layout) + plot_annotation(tag_levels = 'A') -ggsave("delays.png", plot = delays_plot, width = 24, height = 25, bg = 'white') +ggsave("delays.png", plot = delays_plot, width = 24, height = 25, bg = 'white', device = cairo_pdf) +ggsave("delays.eps", plot = delays_plot, width = 24, height = 25, bg = 'white', device = cairo_ps) ggsave("delays.pdf", plot = delays_plot, width = 24, height = 25, bg = 'white') delays_plotSI <- incp2_noqa + IP_forest_noqa + lat_onset_serialplt_noqa + outcome_forest_noqa + eip_forest_noqa + From 07f7e3bf8034b86d292ffd70214b1642f8f16071 Mon Sep 17 00:00:00 2001 From: Kelly McCain Date: Tue, 20 Jan 2026 12:36:48 +0000 Subject: [PATCH 4/5] remove extractor name and notes --- src/zika_prep_data/zika_prep_data.R | 11 +++++++---- zika_workflow.R | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/zika_prep_data/zika_prep_data.R b/src/zika_prep_data/zika_prep_data.R index 2efdc574..d8022170 100644 --- a/src/zika_prep_data/zika_prep_data.R +++ b/src/zika_prep_data/zika_prep_data.R @@ -5,6 +5,7 @@ # as well as the ad-hoc data cleaning in each of the analysis orderly tasks library(dplyr) library(stringr) +library(readr) #orderly preparation orderly_strict_mode() @@ -55,7 +56,8 @@ cols_to_convert <- c( articles[cols_to_convert] <- lapply(articles[cols_to_convert], convert_to_utf) dfs <- curation(articles,outbreaks,models,parameters, plotting = plotting) -articles <- dfs$articles +articles <- dfs$articles %>% + select(-name_data_entry, -notes) qa_scores <- articles %>% dplyr::select(covidence_id,qa_score) @@ -66,7 +68,8 @@ models <- dfs$models parameters <- dfs$parameters %>% left_join(qa_scores) %>% mutate(article_label = make.unique(refs)) %>% - mutate(article_label = factor(article_label,levels=rev(unique(article_label)))) + mutate(article_label = factor(article_label,levels=rev(unique(article_label)))) %>% + select(-name_data_entry) # once i add in the extra cleaning in each task, then can remove that from the analsysi tasks as well # (Especially the latex tables one) @@ -74,11 +77,11 @@ parameters <- dfs$parameters %>% left_join(qa_scores) %>% # Save genomic data genomic <- parameters %>% filter(parameter_class == 'Mutations') %>% - left_join(articles %>% select(-c(name_data_entry, qa_score, article_label, refs, id)), by = c('covidence_id', 'pathogen')) %>% + left_join(articles %>% select(-c(qa_score, article_label, refs, id)), by = c('covidence_id', 'pathogen')) %>% select( -c(starts_with('riskfactor'), r_pathway, seroprevalence_adjusted, third_sample_param_yn, contains('delay'), method_2_from_supplement, #starts_with('cfr'), starts_with('distribution'), case_definition, exponent_2, - inverse_param, inverse_param_2, name_data_entry, trimester_exposed, starts_with('parameter_2'))) + inverse_param, inverse_param_2, trimester_exposed, starts_with('parameter_2'))) saveRDS(genomic, "zika_genomic.rds") write_csv(genomic, "zika_genomic.csv") diff --git a/zika_workflow.R b/zika_workflow.R index 6457a0bc..2f863ded 100644 --- a/zika_workflow.R +++ b/zika_workflow.R @@ -90,9 +90,9 @@ orderly_run("zika_compilation", parameters = list(pathogen = "ZIKA")) ############## # Data curation for analysis -orderly2::orderly_run('zika_prep_data', parameters = list(pathogen = 'ZIKA', +orderly::orderly_run('zika_prep_data', parameters = list(pathogen = 'ZIKA', plotting = TRUE)) -orderly2::orderly_run('zika_prep_data', parameters = list(pathogen = 'ZIKA', +orderly::orderly_run('zika_prep_data', parameters = list(pathogen = 'ZIKA', plotting = FALSE)) # Delay figures From fc8fb4a08013935c1b131d3ab20e4dda16f4ffda Mon Sep 17 00:00:00 2001 From: Kelly McCain Date: Tue, 20 Jan 2026 12:49:45 +0000 Subject: [PATCH 5/5] remove name data entry and notes --- src/zika_compilation/zika_compilation.R | 4 ++-- src/zika_prep_data/zika_prep_data.R | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/zika_compilation/zika_compilation.R b/src/zika_compilation/zika_compilation.R index e89f0c10..ebe77839 100644 --- a/src/zika_compilation/zika_compilation.R +++ b/src/zika_compilation/zika_compilation.R @@ -237,12 +237,12 @@ saveRDS(params_clean, 'parameters.rds') params_clean_epireview <- params_clean %>% select(-pathogen, -starts_with('parameter_2'), -delay_start, -access_param_id, -other_delay_start, -other_delay_end, -method_2_from_supplement, - -starts_with('distribution_2'), -exponent_2, inverse_param_2, name_data_entry, + -starts_with('distribution_2'), -exponent_2, -inverse_param_2, -name_data_entry, -other_delay) %>% mutate(prnt_on_elisa = ifelse(prnt_on_elisa == 'V', TRUE, ifelse(prnt_on_elisa == 'F', FALSE, NA))) articles_qa_epireview <- articles_qa %>% - select(-name_data_entry, -covidence_id_text, -qa_denominator, -qa_numerator, -qa_score) + select(-name_data_entry, -notes, -covidence_id_text, -qa_denominator, -qa_numerator, -qa_score) write_csv(articles_qa_epireview, 'zika_articles.csv') write_csv(models_clean, 'zika_models.csv') diff --git a/src/zika_prep_data/zika_prep_data.R b/src/zika_prep_data/zika_prep_data.R index d8022170..c619f8bc 100644 --- a/src/zika_prep_data/zika_prep_data.R +++ b/src/zika_prep_data/zika_prep_data.R @@ -56,8 +56,7 @@ cols_to_convert <- c( articles[cols_to_convert] <- lapply(articles[cols_to_convert], convert_to_utf) dfs <- curation(articles,outbreaks,models,parameters, plotting = plotting) -articles <- dfs$articles %>% - select(-name_data_entry, -notes) +articles <- dfs$articles qa_scores <- articles %>% dplyr::select(covidence_id,qa_score) @@ -68,8 +67,7 @@ models <- dfs$models parameters <- dfs$parameters %>% left_join(qa_scores) %>% mutate(article_label = make.unique(refs)) %>% - mutate(article_label = factor(article_label,levels=rev(unique(article_label)))) %>% - select(-name_data_entry) + mutate(article_label = factor(article_label,levels=rev(unique(article_label)))) # once i add in the extra cleaning in each task, then can remove that from the analsysi tasks as well # (Especially the latex tables one) @@ -77,11 +75,11 @@ parameters <- dfs$parameters %>% left_join(qa_scores) %>% # Save genomic data genomic <- parameters %>% filter(parameter_class == 'Mutations') %>% - left_join(articles %>% select(-c(qa_score, article_label, refs, id)), by = c('covidence_id', 'pathogen')) %>% + left_join(articles %>% select(-c(name_data_entry, qa_score, article_label, refs, id)), by = c('covidence_id', 'pathogen')) %>% select( -c(starts_with('riskfactor'), r_pathway, seroprevalence_adjusted, third_sample_param_yn, contains('delay'), method_2_from_supplement, #starts_with('cfr'), starts_with('distribution'), case_definition, exponent_2, - inverse_param, inverse_param_2, trimester_exposed, starts_with('parameter_2'))) + inverse_param, inverse_param_2, name_data_entry, trimester_exposed, starts_with('parameter_2'))) saveRDS(genomic, "zika_genomic.rds") write_csv(genomic, "zika_genomic.csv")