Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
445 commits
Select commit Hold shift + click to select a range
6e170e0
Fixes mapping table bug
tristan-myles Apr 16, 2025
1d14dc8
Merge pull request #67 from mrc-ide/prepare-redcap-updates
sangeetabhatia03 Apr 17, 2025
672825e
update to plotting function and add tasks to workflow
May 6, 2025
675bba7
more cleaning - filter out papers that shouldn't have been included, …
May 6, 2025
3b127b8
fixes to delay and genomic and R plots, move legend inside; remove fi…
May 6, 2025
01f0433
fine tuning summary plots, rfs, outbreaks
May 6, 2025
9936ac2
fix dates for latex tables; small edits
May 6, 2025
ce6ab94
handle units for inverse params
May 6, 2025
a41da7c
updates to plotting and adding extra cleaning
May 12, 2025
b033fcb
Updates continuation cli output & adds to proc log
tristan-myles May 12, 2025
8f4f85b
Updates pk id generation & sorts data before UUID
tristan-myles May 12, 2025
116c273
Moves target clean list creation before comment
tristan-myles May 12, 2025
9b713f1
update plotting function
May 12, 2025
ce70afc
add missing package and remove extra code
May 12, 2025
3803b01
Removes extra sort cols - article id is unique
tristan-myles May 13, 2025
7b6b925
Sets seed before UUID creation
tristan-myles May 13, 2025
aaba5e7
Merge pull request #69 from mrc-ide/prepare-redcap-id-log-update
sangeetabhatia03 May 15, 2025
ef64543
Edits to make Zika run
sangeetabhatia03 May 16, 2025
62fae10
add serop and other pars tasks + other changes
May 16, 2025
19bdca0
update extraction task
May 16, 2025
83a6983
Merge branch 'zika' of https://github.com/mrc-ide/priority-pathogens …
May 16, 2025
b4831bf
allow changing labels in meta-analysis plot
May 22, 2025
90491f3
edits to serop tasks; add country and sample type stratification to m…
May 22, 2025
eb24eac
Adds Nipah to db_double outbreak if statements
tristan-myles Feb 26, 2025
b4820e0
Adds Nipah workflow script
tristan-myles Feb 26, 2025
f1ee574
Updates sorting to accept a vector of id names
tristan-myles Feb 26, 2025
fc5309e
Merges filter_qa & filter_extracted + notes check
tristan-myles Feb 26, 2025
7d91f45
Adds custom nipah compilation task
tristan-myles Apr 19, 2025
c431cea
Adds custom nipah cleaning task
tristan-myles Apr 19, 2025
631b2e9
Adds uuid checks and fixes
tristan-myles Apr 20, 2025
7a304e6
Creates a cleaning config script
tristan-myles Apr 22, 2025
e734847
Adds template config script for other pathogens
tristan-myles Apr 22, 2025
88cef31
Updates Nipah workflow file
tristan-myles Apr 22, 2025
1b5ea95
Fixes nipah model bug
tristan-myles Apr 24, 2025
099c7ff
Fixes bug - NA not matching should be set to TRUE
tristan-myles May 12, 2025
c8044dd
Updates access_id to be a character
tristan-myles May 12, 2025
bbe3bb4
Applies formatting and adds comment
tristan-myles May 12, 2025
f0b3c4c
Fixings bug - missing variable & assignment error
tristan-myles May 12, 2025
b95a98a
Updates punctation to use ';' as a seperator
tristan-myles May 12, 2025
df3f484
Fixes bug - incorrect col set to character
tristan-myles May 13, 2025
964d0df
Remvoes unncessary outbreak ID columns
tristan-myles May 23, 2025
f611466
Updates filename - new orderly naming convention
tristan-myles May 23, 2025
7fd88f9
Bug fix - incorrect variable name
tristan-myles May 23, 2025
af37a60
Sets seed before creating missing ids
tristan-myles May 23, 2025
6c3d7d1
Creates seperate pathogen case variable
tristan-myles May 23, 2025
d977bd8
Adds debug orderly param to nipah cleaning
tristan-myles May 23, 2025
7f22ec3
Adds nipah latex tables task
tristan-myles May 23, 2025
ddda1b7
Adds latex tables to the nipah workflow file
tristan-myles May 23, 2025
13f93cc
Adds comments, combines unc & var, & neatens code
tristan-myles May 23, 2025
07eb775
Bug fix - incorrect col used for unc replacement
tristan-myles May 23, 2025
fbc11ab
Edits to make accents work
sangeetabhatia03 May 30, 2025
332e917
Merge branch 'zika' of https://github.com/mrc-ide/priority-pathogens …
sangeetabhatia03 May 30, 2025
9f59049
Fixes bug - line break excluded overdispersion
tristan-myles May 30, 2025
0f90f87
fix cfr context; rf plot update
May 30, 2025
9c8b34f
remove duplicated aesthetic
May 30, 2025
8d4000c
updates to location and country labels and plotting function; fix R a…
Jun 2, 2025
523825b
update language to use probability isntead of risk or rate
Jun 3, 2025
ee83b68
fix genomic parameters; and do calculation for plotting, change latex…
Jun 3, 2025
c03e20b
update annotation of summary plot
Jun 4, 2025
df8c688
fix location of legend for czs plot and add funnel plots
Jun 4, 2025
4b51682
clean up latex tables
Jun 4, 2025
1e9b024
clean up genomic plots
Jun 4, 2025
672a514
change risk to probability, fix mistakes
Jun 4, 2025
744095b
add small space in x axis plotting function
Jun 4, 2025
e3e3c88
Remove calls to View()
sangeetabhatia03 Jun 5, 2025
eb67c88
Merge branch 'zika' of https://github.com/mrc-ide/priority-pathogens …
sangeetabhatia03 Jun 5, 2025
651667e
change to vector-borne and sexual, relabel to IIP
Jun 5, 2025
5381608
Merge branch 'zika' of https://github.com/mrc-ide/priority-pathogens …
Jun 5, 2025
ebd3a13
updates to serop, R, czs outputs
Jun 6, 2025
25ba457
change plot colors; remove filtering of parameters from figure; fix b…
Jun 6, 2025
1c543c7
update doubling time calc
Jun 10, 2025
3f722b6
move to shared functions
cm401 Jun 10, 2025
068aeb0
placeholders for cleaning
cm401 Jun 10, 2025
f5c7b39
initial revision -- copied from SARS, need to adjust to NIPAH
cm401 Jun 10, 2025
5e9bc0c
Moves nipah_cleaning to db_cleaning
tristan-myles Jun 10, 2025
ad4a6ba
Updates script to use shared nipah_functions.R
tristan-myles Jun 10, 2025
f8605b1
Neatens db_compilation by grouping access files
tristan-myles Jun 10, 2025
3201a4d
Unifies nipah compilation and db_compilation
tristan-myles Jun 10, 2025
92fcba5
Adds Nipah fixing files
tristan-myles Jun 10, 2025
cc1e0da
Updates db_cleaning to depend on db_compilation
tristan-myles Jun 10, 2025
6389369
Moves nipah_cleaning_config to nipah folder
tristan-myles Jun 10, 2025
cb9e87b
Adds empty nipah_cleaning script
tristan-myles Jun 10, 2025
8c203cb
Updates db_extraction prep to use strict_mode
tristan-myles Jun 10, 2025
8e68f8f
Fixes db_compilation bug - cleaning.R -> access/
tristan-myles Jun 10, 2025
ee5ffd7
Adds new parameter value type
tristan-myles Jun 11, 2025
9f7ad6f
Removes unncessary parameter_from_figure mapping
tristan-myles Jun 11, 2025
c6de8c6
Slightly improves data_curation readability
tristan-myles Jun 11, 2025
1ea2e50
Updates relocate to use all_of
tristan-myles Jun 11, 2025
ea820db
Moves code from nipah_latex to nipah_cleaning
tristan-myles Jun 11, 2025
364e459
Adds initial nipah transmission task
tristan-myles Jun 11, 2025
7c6eae4
Removes nipah functions from nipah_latex_tables
tristan-myles Jun 11, 2025
cdda915
Adds article cleaning
tristan-myles Jun 11, 2025
99a09db
Adds missing tidyr library
tristan-myles Jun 11, 2025
becd372
Updates Rproj formatting
tristan-myles Jun 11, 2025
16b7d61
Adds newline to end of db_cleaning/cleaning.R
tristan-myles Jun 11, 2025
205fa8d
Updates nipah_delays dependency to db_cleaning
tristan-myles Jun 11, 2025
d10f8b1
Removes unnecessary cleaning
tristan-myles Jun 11, 2025
61c9602
Replaces epireview function with custom version
tristan-myles Jun 11, 2025
175b337
add in the czs cleaning code and associated file; update plots in czs…
Jun 12, 2025
fd684be
update cleaned data and add to compilation task
Jun 12, 2025
5ded8c5
outbreak location and country cleaning
Jun 18, 2025
46f9b62
Adds more param cleaning
tristan-myles Jun 19, 2025
ecc010e
Adds nipah severity task
tristan-myles Jun 20, 2025
6961e9d
Fixes nipah workflow filename typo & adds severity
tristan-myles Jun 20, 2025
4c96153
Fixes bug - mapping sample paired ranges mixed
tristan-myles Jun 20, 2025
7c4720e
Merge pull request #70 from mrc-ide/nipah_workflow
sangeetabhatia03 Jun 25, 2025
d78a1e3
Merge branch 'main' into zika
tristan-myles Jun 29, 2025
d0ed51c
Removes zika_cleaning from db_compilation
tristan-myles Jun 29, 2025
764e7ff
updates to czs meta-analysis
Jun 30, 2025
b722cbe
Merge branch 'zika' of github.com:mrc-ide/priority-pathogens into zika
tristan-myles Jun 30, 2025
4691f19
commit Rproj id
Jun 30, 2025
f3f416f
Merge branch 'zika' of https://github.com/mrc-ide/priority-pathogens …
Jun 30, 2025
5142d81
add missing czs probabilities; change to pregnancy loss; updates to t…
Jul 4, 2025
ef1f626
Clean up user env by removing added location
sangeetabhatia03 Jul 8, 2025
e36cc2d
add oxtraction prep
Jul 8, 2025
060f496
Merge branch 'zika' of https://github.com/mrc-ide/priority-pathogens …
Jul 8, 2025
7478fa7
add facet_by_trimester
Jul 8, 2025
c4f93ce
add proportion of symptomatic meta-analysis
Jul 9, 2025
ea088d5
Comment out serop task which needs shape files
sangeetabhatia03 Jul 9, 2025
442de6a
Add libraries
sangeetabhatia03 Jul 9, 2025
f650ac9
Close open device and call necessary libraries
sangeetabhatia03 Jul 9, 2025
e64da41
Merge pull request #62 from mrc-ide/zika
sangeetabhatia03 Jul 9, 2025
b776807
remove incorrectly extracted parameter; update xlim for R plots
Jul 9, 2025
1b49014
remove unneeded variables for final datasets
Jul 14, 2025
73a6034
update to fixing files (from a long time ago)
Jul 14, 2025
95bcb74
Change "probability" to "proportion" and remove duplicated cleaning (…
Sep 11, 2025
0aa9684
update to data_curation task to reflect removal of _2 variables
Sep 12, 2025
03b992f
add zika vignette
Sep 12, 2025
1fb45a0
remove zika-specific statements as no longer needed
Sep 22, 2025
f9e4c64
vignette updates
Sep 22, 2025
debbe4d
remove unneeded function
Sep 22, 2025
1b8a2b3
clean up workflow script
Sep 22, 2025
e139424
update gitignore
Sep 22, 2025
6774a04
Add shapefiles and update serop task to work with shapefiles.
Sep 22, 2025
be556d0
make zika-specific forest plot function and update code with new func…
Sep 22, 2025
961ed02
remove the sars task
Sep 23, 2025
a7c2844
remove printing of sero plot
Sep 23, 2025
0e386e5
add webshot2 package to sars vignette
Sep 23, 2025
af44546
Update error message for existing output folder
sangeetabhatia03 Sep 23, 2025
e5d533b
Merge pull request #71 from mrc-ide/zika
sangeetabhatia03 Sep 23, 2025
fb5f358
update data_curation to be data_curation_zika
Sep 23, 2025
01fa1c6
Merge pull request #72 from mrc-ide/zika_vignette_fix
sangeetabhatia03 Sep 24, 2025
75b2af0
Add dependencies to DESCRIPTION
sangeetabhatia03 Sep 24, 2025
2361e4f
Update DESCRIPTION
AVicco Sep 25, 2025
f094737
Update pathogen_zika.Rmd
AVicco Sep 25, 2025
d7fc047
Update DESCRIPTION
AVicco Sep 25, 2025
84477f9
Merge pull request #73 from mrc-ide/fix-zika-workflow
cm401 Sep 25, 2025
88ac53f
add some nipah cleaning
cm401 Oct 10, 2025
476d85f
add modification for params from figure
cm401 Oct 13, 2025
6f61df2
Add shared files for Nipah analysis
cm401 Oct 13, 2025
56af6fb
initial revision, will require lots of cleanup
cm401 Oct 13, 2025
9673942
Adds more Nipah cleaning
tristan-myles Oct 13, 2025
9c792f0
Adds additional Chua (2023) incubation row
tristan-myles Oct 13, 2025
e67e841
Removes from yes/no from_figure mapping
tristan-myles Oct 13, 2025
fce1538
Updates transmission task
tristan-myles Oct 13, 2025
04714c3
Moves update_id_rows_to_keep to helper functions
tristan-myles Oct 20, 2025
14a10ad
Assigns "repeat_id" to a variable
tristan-myles Oct 20, 2025
704a9ea
Updates repeat ids for multi-form extractions
tristan-myles Oct 20, 2025
478aaed
Merge pull request #75 from mrc-ide/redcap-repeat-id-update
cm401 Oct 20, 2025
afbc25f
Merge branch 'main' into nipah_workflow
tristan-myles Oct 20, 2025
649025f
Changes cleaning order (custom cleaning first)
tristan-myles Oct 20, 2025
18ae300
Updates column types
tristan-myles Oct 20, 2025
1039c71
Adds custom Nipah cleaning (mostly uncert -> varb)
tristan-myles Oct 20, 2025
4f2ea73
Cleans Nipah delays task
tristan-myles Oct 20, 2025
aaae73d
Adds action descriptions to *_cleaning_config
tristan-myles Oct 20, 2025
e5189af
Updates data_curation to include variability
tristan-myles Oct 21, 2025
8d5481f
Updates forest plot to include variability
tristan-myles Oct 21, 2025
9845f8c
Updates issue with Nipah comb_par2_uncertainty
tristan-myles Oct 21, 2025
4d8a0a9
Updates nipah delays to exclude chua incubation
tristan-myles Oct 21, 2025
c86bea9
revert changes which accidently got introduced by Zika
cm401 Oct 21, 2025
5deb684
Removes .Rproj file - should not be tracked
cm401 Oct 21, 2025
53e1117
Add cleaning for models and param dates
cm401 Oct 23, 2025
12c1d73
new shared functions for bayesian synthetic likelihoods for data synt…
cm401 Oct 23, 2025
ff7eb59
fix up issues
cm401 Oct 27, 2025
c788c18
Add parameter summary
cm401 Oct 27, 2025
cc9afc7
add parameter summary code + something to check if session is interac…
cm401 Oct 27, 2025
9da611a
Initial revision
cm401 Oct 27, 2025
68df521
remove code to plot maps (which is in its own task now)
cm401 Oct 27, 2025
7034155
Updates pipes in Nipah_functions & some formatting
tristan-myles Oct 21, 2025
3c46041
Adds sort option to forest plot
tristan-myles Dec 1, 2025
3d84a0c
Updates forest plot: dodges varb if uncert present
tristan-myles Dec 2, 2025
97631bf
Applies formatting changes & fixes deprec params
tristan-myles Dec 2, 2025
1f3662f
Updates the param order in the mapping table
tristan-myles Dec 2, 2025
061dc02
Adds code to add a new data ID
tristan-myles Dec 2, 2025
e1f1989
Removes exponent_2 from cleaning config
tristan-myles Dec 2, 2025
d6bc079
Adds more cleaning
tristan-myles Dec 2, 2025
2061fb1
Updates nipah delays - creates many figure combos
tristan-myles Dec 2, 2025
b582c1f
Adds more cleaning to Nipah latex tables
tristan-myles Dec 2, 2025
809c5a1
Updates Nipah summary & adds supp tables
tristan-myles Dec 2, 2025
4b8b52d
Adds Nipah summary and supp tables to workflow
tristan-myles Dec 2, 2025
dfa2092
Updates plot order and legend generation
tristan-myles Dec 2, 2025
8313597
Fixes bug - missing id:: call for random_id
tristan-myles Dec 2, 2025
d3f3630
Updates 2760 evolutionary rate cleaning
tristan-myles Dec 2, 2025
3c1231a
Removes 2752 from the genomic bound filtering
tristan-myles Dec 2, 2025
5bd76a9
Fixes bug - incorrect forest plot param used
tristan-myles Dec 2, 2025
6b9ffdd
Removes repetition when cleaning 2760 evol rate
tristan-myles Dec 2, 2025
87ae784
Updates to include human readale ids in output
tristan-myles Dec 2, 2025
c334ca3
Merge pull request #76 from mrc-ide/db_cleaning_id_update
thomrawson Dec 2, 2025
e2ddb32
Merge branch 'main' into nipah_workflow
tristan-myles Dec 2, 2025
5ca4754
Updates cleaning to use access_[table]_id
tristan-myles Dec 3, 2025
c969d75
Adds artefacts and updates to use access_param_id
tristan-myles Dec 3, 2025
577a826
Updates Nipah latex tabs to use access_[table]_ids
tristan-myles Dec 3, 2025
56fbe15
Adds initial attempt at Nipah risk factors task
tristan-myles Dec 3, 2025
78eb79f
Applies bug fix to Lassa functions
tristan-myles Dec 3, 2025
0a3bc92
Resets Lassa functions to previous version
tristan-myles Dec 3, 2025
2871fc9
Add meta-analysis and two additional data points to bsl hierarchical …
cm401 Jan 6, 2026
019e470
add two data points (post cleaning) and comparitive meta-analysis for…
cm401 Jan 6, 2026
751be0a
Updates delay CovID 3057 variability to range
tristan-myles Jan 6, 2026
b452adc
initial revision
cm401 Jan 7, 2026
7fb43b5
add code so that pre-canned results for fitting are called so that it…
cm401 Jan 7, 2026
8092bdf
fix a couple of function calls and add bsl_summarise_parameter function
cm401 Jan 7, 2026
9fc6223
Merge branch 'nipah_workflow' of https://github.com/mrc-ide/priority-…
cm401 Jan 7, 2026
59fbad2
Add files via upload
cm401 Jan 7, 2026
2b73a87
Merge pull request #78 from mrc-ide/cm401-patch-1
sangeetabhatia03 Jan 7, 2026
08f0b22
need to call dplyr::select rather than just select
cm401 Jan 7, 2026
e7acdfe
Splits observed and estimated incubation
tristan-myles Jan 7, 2026
83506c7
Adds forest plot alpha param for qa<0.5
tristan-myles Jan 7, 2026
2b72926
Adds qa_alpha=0.3 to transmission & delay tasks
tristan-myles Jan 7, 2026
d5aa3b4
Comment out lines that open graphic devices
sangeetabhatia03 Jan 14, 2026
6da2708
Merge pull request #77 from mrc-ide/nipah_workflow
sangeetabhatia03 Jan 14, 2026
18734bb
Combines evol and sub plot & sets sort to true
tristan-myles Jan 20, 2026
aafb353
Updates Nipah to use dplyr::select
tristan-myles Jan 20, 2026
a637bf0
Sets population group to be a factor
tristan-myles Jan 20, 2026
a518cd5
Adds a ^* to Lo Presti to flag for caption
tristan-myles Jan 20, 2026
2a80c47
Adds bsl plot and linetype to legend
tristan-myles Jan 26, 2026
692bcd5
Updates shared bsl_synthesis & nipah bsl task
tristan-myles Feb 2, 2026
9eb56f5
Adds bsl model RDS to shared
tristan-myles Feb 2, 2026
289fb1e
Adds missing function header to shared bsl script
tristan-myles Feb 2, 2026
397b21b
Adds linetype as a guide
tristan-myles Feb 3, 2026
f6e2c62
Updates fontsizes and formatting for meta helpers
tristan-myles Feb 3, 2026
888604b
Adds more nipah delay and serology cleaning
tristan-myles Feb 3, 2026
3ab4af5
Removes bsl_data_synthesis from nipah bsl task
tristan-myles Feb 3, 2026
510389e
Updates nipah delay task; main figure changes
tristan-myles Feb 3, 2026
4c496de
Adds missing code to create final plot
tristan-myles Feb 3, 2026
826b518
Updates transmission task - removes prop symp
tristan-myles Feb 3, 2026
78da24c
Updates nipah_severity - adds meta analysis
tristan-myles Feb 3, 2026
a1ce63a
Rewrites Nipah serology & updates nipah functions
tristan-myles Feb 3, 2026
ac1b308
Adds code to save cleaned outbreaks as an RDS
tristan-myles Feb 3, 2026
08a637c
Updates metaprop study colour
tristan-myles Feb 5, 2026
552a2f3
Adds ^+ to CSF params in latex sero table
tristan-myles Feb 5, 2026
c03e4a6
Updates severity - adds individual study plots
tristan-myles Feb 5, 2026
47d25fa
Updates the point size in Nipah maps
tristan-myles Feb 5, 2026
08e15b1
Adds map, serology, and bsl task to nipah workflow
tristan-myles Feb 6, 2026
f735cf2
Applies orderly_resource naming fix
tristan-myles Feb 6, 2026
9b491e2
Removes nipah map task from workflow
tristan-myles Feb 6, 2026
545b368
Fixes bug - d6 -> d5 after removing prop symp
tristan-myles Feb 6, 2026
3ac5a37
Applies bug fixes to Nipah severity
tristan-myles Feb 6, 2026
f298356
Updates Nipah delays to use orderly2
tristan-myles Feb 6, 2026
0146f71
Adds cleaned outbreak data
tristan-myles Feb 6, 2026
1cbdb4e
Merge pull request #80 from mrc-ide/nipah_workflow_updates
thomrawson Feb 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
.Ruserdata
priority-pathogens.Rproj
src/*.csv
src/*/*.csv
src/*/*/*.csv
src/*/*.png
src/*/*.rds
src/*/lassa_functions.R
pathway
src/db_extraction/utils.R
.Renviron
Renviron
src/*/*/.shp
src/*/*/.shx
src/*/*/.cpg
src/*/*/.dbf
src/*/*/.prj
src/zika_serop/shapefile/*

# ---VVV--- added by orderly ---VVV----------------
# Don't manually edit content between these markers
Expand Down
6 changes: 6 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Authors@R: c(
person("Gina", "Cuomo-Dannenburg", role = "aut", comment = c(ORCID = "0000-0001-6821-0352")),
person("Ruth", "McCabe", role = "aut", comment = c(ORCID = "0000-0002-6368-9103")),
person("Kelly", "McCain", role = "aut", comment = c(ORCID = "0000-0003-2393-2217")),
person("Anna", "Vicco", role = "aut", comment = c(ORCID = "0000-0002-6555-3090")),
person("Patrick", "Doohan", role = "aut", comment = c(ORCID = "0000-0001-8076-1106")),
person("Tristan", "Naidoo", role = "aut", comment = c(ORCID = 0000-0001-9970-2421)))
Description: A live view of a the systematic literature reviews conducted by the Pathogen Epidemiology Review Group (PERG). The data in these plots come from PERG's epireview package, which contains the latest available open access pathogen data from the group.
Expand All @@ -22,14 +23,17 @@ Imports:
estmeansd,
flextable,
ggforce,
ggpattern,
ggplot2,
ggrepel,
ggsci,
ggspatial,
gpkg,
gt,
grid,
gridExtra,
harrypotter,
maps,
meta,
metafor,
mixdist,
Expand All @@ -42,9 +46,11 @@ Imports:
rmarkdown,
rnaturalearth,
rnaturalearthdata,
RSQLite,
scales,
sf,
stringr,
tidygeocoder,
tidyverse,
tm,
webshot2
Expand Down
114 changes: 114 additions & 0 deletions R/zika_maps.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
library(ggplot2)
library(sf)
library(rnaturalearth)
library(gpkg)
library(RSQLite)
library(ggrepel)

parameters <- readRDS("P:/Zika/priority-pathogens/archive/db_compilation/20250205-144757-57dcf554/parameters.rds")
outbreaks <- readRDS("P:/Zika/priority-pathogens/archive/db_compilation/20250205-144757-57dcf554/outbreaks.rds")

world <- ne_countries(scale = 'medium', returnclass = 'sf')
#
# world <- geopackage('data/gadm_410-levels.gpkg')
#
outbreaks_agg <- outbreaks %>%
mutate(outbreak_country = case_when(
outbreak_country == 'France (Martinique)' ~ "France",
TRUE ~ outbreak_country
)) %>%
group_by(covidence_id, outbreak_country) %>%
count() %>%
group_by(outbreak_country) %>%
count()

out_sf <- world %>%
left_join(outbreaks_agg, by = c('admin' = 'outbreak_country')) %>%# by.y ="outbreak_country", by.x = 'sovereignt')
mutate(admin = case_when(
admin == 'Federated States of Micronesia' ~ "Micronesia",
TRUE ~ admin
))

out_plt <- ggplot() +
geom_sf(data = out_sf, lwd = 0.3, col = "grey30", aes(fill = n)) +
scale_fill_viridis_c(option = 'plasma', direction = -1, na.value = 'grey80') +
theme_light() +
theme(axis.text = element_blank()) +
labs(fill = 'Number of papers\nreporting outbreaks',
x = '',
y = '') +
geom_label_repel(data = out_sf %>% filter(!is.na(n)),
aes(x=label_x,y=label_y,label=paste0(admin,": ",n),
fontface = "bold"), size = 2,
max.overlaps = 50,
label.padding = 0.2) +
coord_sf(xlim=c(-180,180), ylim=c(-60,90)) # cut out antarctica



# Sero plot
sero_all <- parameters %>%
filter(parameter_type =='Seroprevalence - IgG' | grepl("PRNT", parameter_type))%>%
group_by(covidence_id, population_country) %>%
count() %>%
group_by(population_country) %>%
count() %>%
mutate(population_country = case_when(
population_country == 'DRC' ~ "Democratic Republic of the Congo",
TRUE ~ population_country
))

sero_all_sf <- world %>%
left_join(sero_all, by = c('admin' = 'population_country')) %>%# by.y ="outbreak_country", by.x = 'sovereignt')
mutate(admin = case_when(
admin == 'Federated States of Micronesia' ~ "Micronesia",
admin == 'Democratic Republic of the Congo' ~ "DRC",
TRUE ~ admin
))

sero_all <- ggplot() +
geom_sf(data = sero_all_sf, lwd = 0.3, col = "grey30", aes(fill = n)) +
scale_fill_viridis_c(option = 'plasma', direction = -1, na.value = 'grey80') +
theme_light() +
labs(fill = 'Number of papers\nreporting IgG or PRNT',
x = '',
y = '') +
theme(axis.text = element_blank()) +
coord_sf(xlim=c(-180,180), ylim=c(-60,90))


# general pop only
sero_gen <- parameters %>%
filter(parameter_type =='Seroprevalence - IgG' | grepl("PRNT", parameter_type))%>%
filter(population_group == 'General population' & population_sample_type == "Population based") %>%
group_by(covidence_id, population_country) %>%
count() %>%
group_by(population_country) %>%
count() %>%
mutate(population_country = case_when(
population_country == 'DRC' ~ "Democratic Republic of the Congo",
TRUE ~ population_country
))

sero_gen_sf <- world %>%
left_join(sero_gen, by = c('admin' = 'population_country')) %>%# by.y ="outbreak_country", by.x = 'sovereignt')
mutate(admin = case_when(
admin == 'Federated States of Micronesia' ~ "Micronesia",
admin == 'Democratic Republic of the Congo' ~ "DRC",
TRUE ~ admin
))

sero_gen <- ggplot() +
geom_sf(data = sero_gen_sf, lwd = 0.3, col = "grey30", aes(fill = n)) +
scale_fill_viridis_c(option = 'plasma', direction = -1, na.value = 'grey80') +
theme_light() +
labs(fill = 'Number of papers\nreporting IgG or PRNT',
x = '',
y = '') +
theme(axis.text = element_blank()) +
coord_sf(xlim=c(-180,180), ylim=c(-60,90))


ggsave("data/zika_plots/outbreaks.png", out_plt)
ggsave("data/zika_plots/sero_all.png", sero_all)
ggsave("data/zika_plots/sero_general.png", sero_gen)
Loading