diff --git a/docs/articles/Bengaluru_animated.gif b/docs/articles/Bengaluru_animated.gif index 5fc2bb7f..730ffd9d 100644 Binary files a/docs/articles/Bengaluru_animated.gif and b/docs/articles/Bengaluru_animated.gif differ diff --git a/docs/articles/Bengaluru_animated_2021.gif b/docs/articles/Bengaluru_animated_2021.gif index 7b2b0ed1..65dd9614 100644 Binary files a/docs/articles/Bengaluru_animated_2021.gif and b/docs/articles/Bengaluru_animated_2021.gif differ diff --git a/docs/articles/Bengaluru_animated_2022.gif b/docs/articles/Bengaluru_animated_2022.gif index e2ea7e2a..dded93d8 100644 Binary files a/docs/articles/Bengaluru_animated_2022.gif and b/docs/articles/Bengaluru_animated_2022.gif differ diff --git a/docs/articles/Chennai_animated.gif b/docs/articles/Chennai_animated.gif index bb0f4c7b..07fde6d8 100644 Binary files a/docs/articles/Chennai_animated.gif and b/docs/articles/Chennai_animated.gif differ diff --git a/docs/articles/Chennai_animated_2021.gif b/docs/articles/Chennai_animated_2021.gif index 5ded0fe6..e86deba3 100644 Binary files a/docs/articles/Chennai_animated_2021.gif and b/docs/articles/Chennai_animated_2021.gif differ diff --git a/docs/articles/Chennai_animated_2022.gif b/docs/articles/Chennai_animated_2022.gif index eafb5648..0d6c8adf 100644 Binary files a/docs/articles/Chennai_animated_2022.gif and b/docs/articles/Chennai_animated_2022.gif differ diff --git a/docs/articles/Germany_animated.gif b/docs/articles/Germany_animated.gif index e31b07b7..9c951b8e 100644 Binary files a/docs/articles/Germany_animated.gif and b/docs/articles/Germany_animated.gif differ diff --git a/docs/articles/Germany_animated_2021.gif b/docs/articles/Germany_animated_2021.gif index f0220028..0373b49d 100644 Binary files a/docs/articles/Germany_animated_2021.gif and b/docs/articles/Germany_animated_2021.gif differ diff --git a/docs/articles/Gujarat_animated.gif b/docs/articles/Gujarat_animated.gif index f9b34451..2efbeb0e 100644 Binary files a/docs/articles/Gujarat_animated.gif and b/docs/articles/Gujarat_animated.gif differ diff --git a/docs/articles/Gujarat_animated_2021.gif b/docs/articles/Gujarat_animated_2021.gif index c1459a11..b8b8956c 100644 Binary files a/docs/articles/Gujarat_animated_2021.gif and b/docs/articles/Gujarat_animated_2021.gif differ diff --git a/docs/articles/Gujarat_animated_2022.gif b/docs/articles/Gujarat_animated_2022.gif index b662d4f8..af93a264 100644 Binary files a/docs/articles/Gujarat_animated_2022.gif and b/docs/articles/Gujarat_animated_2022.gif differ diff --git a/docs/articles/IN_animated.gif b/docs/articles/IN_animated.gif index 898f2973..6afb3682 100644 Binary files a/docs/articles/IN_animated.gif and b/docs/articles/IN_animated.gif differ diff --git a/docs/articles/IN_animated_2021.gif b/docs/articles/IN_animated_2021.gif index c90eadb8..b65a19f2 100644 Binary files a/docs/articles/IN_animated_2021.gif and b/docs/articles/IN_animated_2021.gif differ diff --git a/docs/articles/IN_animated_2022.gif b/docs/articles/IN_animated_2022.gif index ceff6970..d07311cf 100644 Binary files a/docs/articles/IN_animated_2022.gif and b/docs/articles/IN_animated_2022.gif differ diff --git a/docs/articles/IN_animated_2023.gif b/docs/articles/IN_animated_2023.gif index 2e2617f2..ae219dfc 100644 Binary files a/docs/articles/IN_animated_2023.gif and b/docs/articles/IN_animated_2023.gif differ diff --git a/docs/articles/IN_animated_latest.gif b/docs/articles/IN_animated_latest.gif index 67d232c1..d5a5a461 100644 Binary files a/docs/articles/IN_animated_latest.gif and b/docs/articles/IN_animated_latest.gif differ diff --git a/docs/articles/Introduction.html b/docs/articles/Introduction.html index 53f8d3e0..08c4cb1e 100644 --- a/docs/articles/Introduction.html +++ b/docs/articles/Introduction.html @@ -174,7 +174,7 @@
-current_date <- "2024_01_08"
+current_date <- "2024_01_11"
fpath.tar <- paste0("~/data/epicov/metadata_tsv_", current_date, ".tar.xz")
fpath.qs <- paste0("~/data/epicov/metadata_tsv_", current_date, ".qs")
@@ -184,16 +184,6 @@ Read variant data from GISAIDgisaid_metadata <- ReadGISAIDMetada(path = fpath.tar)
qs::qsave(gisaid_metadata, fpath.qs)
}
-## Warning in untar(path, files = fname, exdir = td): '/bin/tar -xf
-## '/home/saket/data/epicov/metadata_tsv_2024_01_08.tar.xz' -C '/tmp/RtmpxJPxAN'
-## 'metadata.tsv'' returned error code 2
-## Avoidable 2.776 seconds. This file is very unusual: it ends abruptly without a final newline, and also its size is a multiple of 4096 bytes. Please properly end the last row with a newline using for example 'echo >> file' to avoid this time to copy.
-## Warning in fread(input = path, showProgress = showProgress, ...): Discarded
-## single-line footer: <<hCoV-19/Japan/PG-91819/2021 Original betacoronavirus
-## EPI_ISL_4654985 2021-08-12 Asia / Japan / Shimane 29762 Human unknown unknown
-## GRY B.1.1.7 consensus call Former VOC Alpha GRY (B.1.1.7+Q.*) first detected in
-## the UK
-## (Spike_H69del,NS8_Q27stop,NSP3_T183I,Spike_T716I,NSP6_S106del,N_R203K,Spike_A570D,Spike_V1268A,Spike_N501Y,NSP2_A31V,NSP3_I1412>>
+- - + +gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india, rename_country_as_state = TRUE) p2 <- BarPlot(country_seq_stats, ylabel = "Sequenced per month", color = "slateblue1", label_si = TRUE, title = "Total sequences deposited to GISAID from India", caption = "**Source: gisaid.org **<br>") @@ -215,7 +205,7 @@
Overall, how much has the proportion of cases (cases sequenced over total cases) that are getting sequenced. Here we look at the proportion of cases that have been sequenced in India over the course of the pandemic: -
- - + ++#india_cases_long <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == "India") GetIndiaCases <- function(){ data <- read.csv("https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/cases_deaths/new_cases.csv") @@ -240,7 +230,7 @@
Overall, how much has p3
For more context, we can combine all the three plots at once:
-@@ -249,7 +239,7 @@+p1 / p2 / p3
Plot propo
We can further break down the proportion of sequenced cases at the state level:
--+state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_india, drop_country = TRUE) seq_stats <- rbind(country_seq_stats, state_seq_stats) state_cases_long <- GetIndiaConfirmedCasesMonthlyLong() @@ -274,7 +264,7 @@
Plot Prevalence
Finally, we look at the prevalence of variants and variants of concern (VOCs):
-@@ -123,152 +102,135 @@ -+india_month_counts <- SummarizeVariantsMonthwise(gisaid_india) india_month_counts$State <- "India" india_month_prevalence <- CountsToPrevalence(india_month_counts) diff --git a/docs/articles/Introduction_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/Introduction_files/figure-html/unnamed-chunk-10-1.png index 40d84fb2..7b094430 100644 Binary files a/docs/articles/Introduction_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/Introduction_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/docs/articles/Introduction_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/Introduction_files/figure-html/unnamed-chunk-3-1.png index cc6c25b0..94eeb5e1 100644 Binary files a/docs/articles/Introduction_files/figure-html/unnamed-chunk-3-1.png and b/docs/articles/Introduction_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/articles/Introduction_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/Introduction_files/figure-html/unnamed-chunk-5-1.png index 1e1a06f2..4fcdcc0a 100644 Binary files a/docs/articles/Introduction_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/Introduction_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/Introduction_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/Introduction_files/figure-html/unnamed-chunk-6-1.png index f142d3df..720edb0f 100644 Binary files a/docs/articles/Introduction_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/Introduction_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/articles/Introduction_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/Introduction_files/figure-html/unnamed-chunk-7-1.png index fdefc749..c5c237f2 100644 Binary files a/docs/articles/Introduction_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/Introduction_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/docs/articles/Jaipur_animated.gif b/docs/articles/Jaipur_animated.gif index 9b46d4a1..cfca166b 100644 Binary files a/docs/articles/Jaipur_animated.gif and b/docs/articles/Jaipur_animated.gif differ diff --git a/docs/articles/Jaipur_animated_2021.gif b/docs/articles/Jaipur_animated_2021.gif index 369cc22b..186aab1f 100644 Binary files a/docs/articles/Jaipur_animated_2021.gif and b/docs/articles/Jaipur_animated_2021.gif differ diff --git a/docs/articles/Jaipur_animated_2022.gif b/docs/articles/Jaipur_animated_2022.gif index f2af8a71..515a0374 100644 Binary files a/docs/articles/Jaipur_animated_2022.gif and b/docs/articles/Jaipur_animated_2022.gif differ diff --git a/docs/articles/Kolkata_animated.gif b/docs/articles/Kolkata_animated.gif index 83050494..64f51970 100644 Binary files a/docs/articles/Kolkata_animated.gif and b/docs/articles/Kolkata_animated.gif differ diff --git a/docs/articles/Kolkata_animated_2021.gif b/docs/articles/Kolkata_animated_2021.gif index 5ac1a16c..a5090e74 100644 Binary files a/docs/articles/Kolkata_animated_2021.gif and b/docs/articles/Kolkata_animated_2021.gif differ diff --git a/docs/articles/Kolkata_animated_2022.gif b/docs/articles/Kolkata_animated_2022.gif index cd321194..272654cb 100644 Binary files a/docs/articles/Kolkata_animated_2022.gif and b/docs/articles/Kolkata_animated_2022.gif differ diff --git a/docs/articles/Maharashtra_animated.gif b/docs/articles/Maharashtra_animated.gif index 1fc6fee0..6c7404bf 100644 Binary files a/docs/articles/Maharashtra_animated.gif and b/docs/articles/Maharashtra_animated.gif differ diff --git a/docs/articles/Maharashtra_animated_2021.gif b/docs/articles/Maharashtra_animated_2021.gif index fc24714f..64a3d1df 100644 Binary files a/docs/articles/Maharashtra_animated_2021.gif and b/docs/articles/Maharashtra_animated_2021.gif differ diff --git a/docs/articles/Maharashtra_animated_2022.gif b/docs/articles/Maharashtra_animated_2022.gif index 9f6d662b..b2e8a9a6 100644 Binary files a/docs/articles/Maharashtra_animated_2022.gif and b/docs/articles/Maharashtra_animated_2022.gif differ diff --git a/docs/articles/MultinomialModeling_India.html b/docs/articles/MultinomialModeling_India.html index 711e9445..f229ef93 100644 --- a/docs/articles/MultinomialModeling_India.html +++ b/docs/articles/MultinomialModeling_India.html @@ -1,19 +1,5 @@ - - - - - - - -
Multinomial modeling - India • covmuller - - - - - - -Multinomial modeling - India • covmuller - - + Skip to contents @@ -40,8 +24,7 @@ +--suppressPackageStartupMessages({ - library(covmuller) - library(tidyverse) -}) -theme_set(CovmullerTheme())
--gisaid_metadata <- qs::qread(file = "~/data/epicov/metadata_tsv_2024_01_08.qs") -gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
-- - + diff --git a/docs/articles/MultinomialModeling_India_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/MultinomialModeling_India_files/figure-html/unnamed-chunk-8-1.png index e358363f..2bd215aa 100644 Binary files a/docs/articles/MultinomialModeling_India_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/MultinomialModeling_India_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/docs/articles/Mumbai_animated.gif b/docs/articles/Mumbai_animated.gif index f4425451..f066c122 100644 Binary files a/docs/articles/Mumbai_animated.gif and b/docs/articles/Mumbai_animated.gif differ diff --git a/docs/articles/Mumbai_animated_2021.gif b/docs/articles/Mumbai_animated_2021.gif index e13704da..328260a9 100644 Binary files a/docs/articles/Mumbai_animated_2021.gif and b/docs/articles/Mumbai_animated_2021.gif differ diff --git a/docs/articles/Mumbai_animated_2022.gif b/docs/articles/Mumbai_animated_2022.gif index 40e2a0fb..6272da7f 100644 Binary files a/docs/articles/Mumbai_animated_2022.gif and b/docs/articles/Mumbai_animated_2022.gif differ diff --git a/docs/articles/NYC_animated.gif b/docs/articles/NYC_animated.gif index 1d50bdd5..e1721649 100644 Binary files a/docs/articles/NYC_animated.gif and b/docs/articles/NYC_animated.gif differ diff --git a/docs/articles/NYC_animated_2023.gif b/docs/articles/NYC_animated_2023.gif index a3df395f..c224f74c 100644 Binary files a/docs/articles/NYC_animated_2023.gif and b/docs/articles/NYC_animated_2023.gif differ diff --git a/docs/articles/NY_animated.gif b/docs/articles/NY_animated.gif index cb821604..c29326e8 100644 Binary files a/docs/articles/NY_animated.gif and b/docs/articles/NY_animated.gif differ diff --git a/docs/articles/NY_animated_2023.gif b/docs/articles/NY_animated_2023.gif index 0ee17727..cddc0f63 100644 Binary files a/docs/articles/NY_animated_2023.gif and b/docs/articles/NY_animated_2023.gif differ diff --git a/docs/articles/NewDelhi_animated.gif b/docs/articles/NewDelhi_animated.gif index b91dd59a..bcc045e2 100644 Binary files a/docs/articles/NewDelhi_animated.gif and b/docs/articles/NewDelhi_animated.gif differ diff --git a/docs/articles/NewDelhi_animated_2021.gif b/docs/articles/NewDelhi_animated_2021.gif index a631be94..5a7f9051 100644 Binary files a/docs/articles/NewDelhi_animated_2021.gif and b/docs/articles/NewDelhi_animated_2021.gif differ diff --git a/docs/articles/NewDelhi_animated_2022.gif b/docs/articles/NewDelhi_animated_2022.gif index a631be94..5a7f9051 100644 Binary files a/docs/articles/NewDelhi_animated_2022.gif and b/docs/articles/NewDelhi_animated_2022.gif differ diff --git a/docs/articles/Pune_animated.gif b/docs/articles/Pune_animated.gif index 87b5d988..edd62e5a 100644 Binary files a/docs/articles/Pune_animated.gif and b/docs/articles/Pune_animated.gif differ diff --git a/docs/articles/Pune_animated_2021.gif b/docs/articles/Pune_animated_2021.gif index eebb1b36..8a99a9a4 100644 Binary files a/docs/articles/Pune_animated_2021.gif and b/docs/articles/Pune_animated_2021.gif differ diff --git a/docs/articles/Pune_animated_2022.gif b/docs/articles/Pune_animated_2022.gif index 534e2d58..4bb87603 100644 Binary files a/docs/articles/Pune_animated_2022.gif and b/docs/articles/Pune_animated_2022.gif differ diff --git a/docs/articles/SA_animated.gif b/docs/articles/SA_animated.gif index 76003620..b739593e 100644 Binary files a/docs/articles/SA_animated.gif and b/docs/articles/SA_animated.gif differ diff --git a/docs/articles/SA_animated_2022.gif b/docs/articles/SA_animated_2022.gif index 2279029e..4f96a037 100644 Binary files a/docs/articles/SA_animated_2022.gif and b/docs/articles/SA_animated_2022.gif differ diff --git a/docs/articles/Singapore_animated.gif b/docs/articles/Singapore_animated.gif index 43963b07..87254e9d 100644 Binary files a/docs/articles/Singapore_animated.gif and b/docs/articles/Singapore_animated.gif differ diff --git a/docs/articles/Singapore_animated_2022.gif b/docs/articles/Singapore_animated_2022.gif index 20e4475d..e37260bf 100644 Binary files a/docs/articles/Singapore_animated_2022.gif and b/docs/articles/Singapore_animated_2022.gif differ diff --git a/docs/articles/Tamilnadu_animated.gif b/docs/articles/Tamilnadu_animated.gif index 25beb96c..a9eb6074 100644 Binary files a/docs/articles/Tamilnadu_animated.gif and b/docs/articles/Tamilnadu_animated.gif differ diff --git a/docs/articles/Tamilnadu_animated_2021.gif b/docs/articles/Tamilnadu_animated_2021.gif index 89af82cd..fb16a484 100644 Binary files a/docs/articles/Tamilnadu_animated_2021.gif and b/docs/articles/Tamilnadu_animated_2021.gif differ diff --git a/docs/articles/Tamilnadu_animated_2022.gif b/docs/articles/Tamilnadu_animated_2022.gif index 7f92b35d..0cc6fbef 100644 Binary files a/docs/articles/Tamilnadu_animated_2022.gif and b/docs/articles/Tamilnadu_animated_2022.gif differ diff --git a/docs/articles/Telangana_animated.gif b/docs/articles/Telangana_animated.gif index 979bd004..122d6037 100644 Binary files a/docs/articles/Telangana_animated.gif and b/docs/articles/Telangana_animated.gif differ diff --git a/docs/articles/Telangana_animated_2021.gif b/docs/articles/Telangana_animated_2021.gif index 479762dd..9f8a9ba8 100644 Binary files a/docs/articles/Telangana_animated_2021.gif and b/docs/articles/Telangana_animated_2021.gif differ diff --git a/docs/articles/Telangana_animated_2022.gif b/docs/articles/Telangana_animated_2022.gif index c12720cf..958c2774 100644 Binary files a/docs/articles/Telangana_animated_2022.gif and b/docs/articles/Telangana_animated_2022.gif differ diff --git a/docs/articles/UK_animated.gif b/docs/articles/UK_animated.gif index 2ce09767..64f1ef8a 100644 Binary files a/docs/articles/UK_animated.gif and b/docs/articles/UK_animated.gif differ diff --git a/docs/articles/UK_animated_2023.gif b/docs/articles/UK_animated_2023.gif index 1d2a9401..b68e2e37 100644 Binary files a/docs/articles/UK_animated_2023.gif and b/docs/articles/UK_animated_2023.gif differ diff --git a/docs/articles/USA_animated.gif b/docs/articles/USA_animated.gif index c00120ed..a536af28 100644 Binary files a/docs/articles/USA_animated.gif and b/docs/articles/USA_animated.gif differ diff --git a/docs/articles/USA_animated_2021.gif b/docs/articles/USA_animated_2021.gif index f366c008..c532a2b3 100644 Binary files a/docs/articles/USA_animated_2021.gif and b/docs/articles/USA_animated_2021.gif differ diff --git a/docs/articles/USA_animated_2023.gif b/docs/articles/USA_animated_2023.gif index fc43ed91..71689139 100644 Binary files a/docs/articles/USA_animated_2023.gif and b/docs/articles/USA_animated_2023.gif differ diff --git a/docs/articles/VariantAnimation-Bengaluru.html b/docs/articles/VariantAnimation-Bengaluru.html index 93d80d1c..1bc90208 100644 --- a/docs/articles/VariantAnimation-Bengaluru.html +++ b/docs/articles/VariantAnimation-Bengaluru.html @@ -136,7 +136,7 @@Plot total sequenced cases -
-- +-country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india, rename_country_as_state = TRUE) -p0 <- BarPlot(country_seq_stats, ylabel = "Sequenced per month", color = "slateblue1", label_si = TRUE, xangle = 90, title = "India") -p0
+suppressPackageStartupMessages({ + library(covmuller) + library(tidyverse) +}) +theme_set(CovmullerTheme())
+gisaid_metadata <- qs::qread(file = "~/data/epicov/metadata_tsv_2024_01_11.qs") +gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
+-Plot total sequenced cases
+ +-+Plot stateswise sequenced cases -
-- --state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_india) -state_seq_stats_summary <- state_seq_stats %>% - group_by(State) %>% - summarise(value = sum(value)) -state_seq_stats_summary$State[state_seq_stats_summary$State == "Dadra and Nagar Haveli and Daman and Diu"] <- "Dadra/N Haveli/Daman/Diu" -p1 <- BarPlot(state_seq_stats_summary, xaxis = "State", ylabel = "Total sequences deposited", color = "slateblue1", label_si = TRUE, xangle = 90, title = "India") -p1
--Get VOCs -
---vocs <- GetVOCs() -omicron <- vocs[["omicron"]] -vocs[["omicron"]] <- NULL -custom_voc_mapping <- list( - `BA.1.1` = "BA.1", - `BA.1` = "BA.1", - `BA.2` = "BA.2", - `BA.2.10` = "BA.2.X", - `BA.2.10.1` = "BA.2.X", - `BA.2.12` = "BA.2.X", - `BA.2.12.1` = "BA.2.X", - `BA.3` = "BA.3", - `BA.4` = "BA.4", - `BA.5` = "BA.5", - `BA.2.74` = "BA.2.X", - `BA.2.75` = "BA.2.75", - `BA.2.76` = "BA.2.X", - `XBB.*` = "XBB", - `BQ.1` = "BQ.1+", - `BQ.1.*` = "BQ.1+" -)
--gisaid_india_collapsed <- CollapseLineageToVOCs( - variant_df = gisaid_india, - vocs = vocs, - custom_voc_mapping = custom_voc_mapping, - summarize = FALSE -) - -gisaid_india_collapsed_sel <- gisaid_india_collapsed %>% - filter(MonthYearCollected >= "Oct 2022") %>% - filter(lineage_collapsed != "Unassigned") -vocs_to_keep <- table(gisaid_india_collapsed_sel$lineage_collapsed) -vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100] - -gisaid_india_collapsed_sel <- gisaid_india_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) - -gisaid_india_shared_dateweek <- SummarizeVariantsDatewise(gisaid_india_collapsed_sel, by_state = TRUE) -head(gisaid_india_shared_dateweek)
-## # A tibble: 6 × 4 -## State DateCollectedNumeric lineage_collapsed n -## <chr> <dbl> <chr> <int> -## 1 Andhra Pradesh 19448 XBB 1 -## 2 Andhra Pradesh 19506 XBB 1 -## 3 Arunachal Pradesh 19361 XBB 1 -## 4 Arunachal Pradesh 19459 XBB 1 -## 5 Arunachal Pradesh 19556 XBB 1 -## 6 Arunachal Pradesh 19611 Others 1
--fit_india_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_india_shared_dateweek)
-## # weights: 198 (160 variable) -## initial value 26340.655957 -## iter 10 value 7641.516301 -## iter 20 value 7284.387483 -## iter 30 value 7116.916285 -## iter 40 value 7079.898273 -## iter 50 value 7033.898212 -## iter 60 value 7018.370193 -## iter 70 value 7013.256620 -## iter 80 value 7011.737212 -## iter 90 value 7011.685431 -## iter 100 value 7011.622831 -## final value 7011.619902 -## converged
--head(fit_india_multi_predsbystate)
+## lineage_collapsed DateCollectedNumeric State prob -## 1 BA.2 19266 Andhra Pradesh 2.551402e-07 -## 2 BA.2.75 19266 Andhra Pradesh 7.077352e-08 -## 3 BA.2.X 19266 Andhra Pradesh 7.491817e-10 -## 4 BQ.1+ 19266 Andhra Pradesh 2.638376e-09 -## 5 Others 19266 Andhra Pradesh 1.629735e-06 -## 6 XBB 19266 Andhra Pradesh 9.999980e-01 -## SE df asymp.LCL asymp.UCL DateCollected -## 1 1.057238e-07 NA 4.792538e-08 4.623551e-07 2022-10-01 -## 2 1.681864e-08 NA 3.780959e-08 1.037374e-07 2022-10-01 -## 3 3.215486e-10 NA 1.189581e-10 1.379405e-09 2022-10-01 -## 4 2.641967e-08 NA -4.914322e-08 5.441998e-08 2022-10-01 -## 5 2.019993e-07 NA 1.233824e-06 2.025647e-06 2022-10-01 -## 6 2.373022e-07 NA 9.999976e-01 9.999985e-01 2022-10-01
+- +Plot stateswise sequenced cases
++ +state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_india) +state_seq_stats_summary <- state_seq_stats %>% + group_by(State) %>% + summarise(value = sum(value)) +state_seq_stats_summary$State[state_seq_stats_summary$State == "Dadra and Nagar Haveli and Daman and Diu"] <- "Dadra/N Haveli/Daman/Diu" +p1 <- BarPlot(state_seq_stats_summary, xaxis = "State", ylabel = "Total sequences deposited", color = "slateblue1", label_si = TRUE, xangle = 90, title = "India") +p1
+Get VOCs
++vocs <- GetVOCs() +omicron <- vocs[["omicron"]] +vocs[["omicron"]] <- NULL +custom_voc_mapping <- list( + `BA.1.1` = "BA.1", + `BA.1` = "BA.1", + `BA.2` = "BA.2", + `BA.2.10` = "BA.2.X", + `BA.2.10.1` = "BA.2.X", + `BA.2.12` = "BA.2.X", + `BA.2.12.1` = "BA.2.X", + `BA.3` = "BA.3", + `BA.4` = "BA.4", + `BA.5` = "BA.5", + `BA.2.74` = "BA.2.X", + `BA.2.75` = "BA.2.75", + `BA.2.76` = "BA.2.X", + `XBB.*` = "XBB", + `BQ.1` = "BQ.1+", + `BQ.1.*` = "BQ.1+" +)
+gisaid_india_collapsed <- CollapseLineageToVOCs( + variant_df = gisaid_india, + vocs = vocs, + custom_voc_mapping = custom_voc_mapping, + summarize = FALSE +) + +gisaid_india_collapsed_sel <- gisaid_india_collapsed %>% + filter(MonthYearCollected >= "Oct 2022") %>% + filter(lineage_collapsed != "Unassigned") +vocs_to_keep <- table(gisaid_india_collapsed_sel$lineage_collapsed) +vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100] + +gisaid_india_collapsed_sel <- gisaid_india_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) + +gisaid_india_shared_dateweek <- SummarizeVariantsDatewise(gisaid_india_collapsed_sel, by_state = TRUE) +head(gisaid_india_shared_dateweek)
+ +## [38;5;246m# A tibble: 6 × 4[39m +## State DateCollectedNumeric lineage_collapsed n +## [3m[38;5;246m<chr>[39m[23m [3m[38;5;246m<dbl>[39m[23m [3m[38;5;246m<chr>[39m[23m [3m[38;5;246m<int>[39m[23m +## [38;5;250m1[39m Andhra Pradesh [4m1[24m[4m9[24m448 XBB 1 +## [38;5;250m2[39m Andhra Pradesh [4m1[24m[4m9[24m506 XBB 1 +## [38;5;250m3[39m Arunachal Pradesh [4m1[24m[4m9[24m361 XBB 1 +## [38;5;250m4[39m Arunachal Pradesh [4m1[24m[4m9[24m459 XBB 1 +## [38;5;250m5[39m Arunachal Pradesh [4m1[24m[4m9[24m556 XBB 1 +## [38;5;250m6[39m Arunachal Pradesh [4m1[24m[4m9[24m611 Others 1
+ +## # weights: 204 (165 variable) +## initial value 32936.122563 +## iter 10 value 11412.728941 +## iter 20 value 10497.898156 +## iter 30 value 10060.762985 +## iter 40 value 9915.848503 +## iter 50 value 9795.429255 +## iter 60 value 9722.564462 +## iter 70 value 9691.424610 +## iter 80 value 9677.049745 +## iter 90 value 9675.962483 +## iter 100 value 9675.837818 +## iter 110 value 9675.761679 +## final value 9675.760375 +## converged
## lineage_collapsed DateCollectedNumeric State prob +## 1 BA.2 19266 Andhra Pradesh 7.813500e-05 +## 2 BA.2.75 19266 Andhra Pradesh 4.233569e-05 +## 3 BA.2.X 19266 Andhra Pradesh 4.508509e-08 +## 4 BQ.1+ 19266 Andhra Pradesh 1.724266e-08 +## 5 Others 19266 Andhra Pradesh 1.775514e-03 +## 6 XBB 19266 Andhra Pradesh 9.981040e-01 +## SE df asymp.LCL asymp.UCL DateCollected +## 1 7.635012e-05 NA -7.150849e-05 2.277785e-04 2022-10-01 +## 2 1.180819e-04 NA -1.891006e-04 2.737720e-04 2022-10-01 +## 3 2.883637e-08 NA -1.143316e-08 1.016033e-07 2022-10-01 +## 4 1.160411e-08 NA -5.500971e-09 3.998630e-08 2022-10-01 +## 5 1.676378e-03 NA -1.510127e-03 5.061154e-03 2022-10-01 +## 6 1.737326e-03 NA 9.946989e-01 1.001509e+00 2022-10-01
Get variants data for India
- - + +-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs") +
gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() @@ -186,8 +186,8 @@
Top 10 cities with
city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))
-Get monthly cases for Bengaluru @@ -289,99 +289,39 @@
Project wee gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist)
## # weights: 32 (21 variable) -## initial value 3312.550376 -## iter 10 value 773.526257 -## iter 20 value 627.851276 -## iter 30 value 617.623075 -## iter 40 value 609.591180 -## iter 50 value 609.169344 -## iter 60 value 608.472630 -## iter 70 value 602.212579 -## iter 80 value 600.276723 -## iter 90 value 598.014887 -## iter 100 value 597.423158 -## iter 110 value 595.638437 -## iter 120 value 594.100586 -## iter 130 value 593.056069 -## iter 140 value 592.812040 -## iter 150 value 592.259715 -## iter 160 value 592.032754 -## iter 170 value 591.577392 -## iter 180 value 590.747093 -## iter 190 value 590.560249 -## iter 200 value 590.223478 -## iter 210 value 589.985700 -## iter 220 value 589.533072 -## iter 230 value 589.496482 -## iter 240 value 589.334164 -## iter 250 value 589.161166 -## iter 260 value 588.992847 -## iter 270 value 588.975716 -## iter 280 value 588.954196 -## iter 290 value 588.717361 -## iter 300 value 587.293388 -## iter 310 value 587.264117 -## iter 320 value 586.819917 -## iter 330 value 586.741879 -## iter 340 value 586.677068 -## iter 350 value 586.600040 -## iter 360 value 586.596292 -## iter 370 value 586.586127 -## iter 380 value 586.568356 -## iter 390 value 586.384346 -## iter 400 value 586.351792 -## iter 410 value 586.261639 -## iter 420 value 586.242483 -## iter 430 value 586.216603 -## iter 440 value 586.210381 -## iter 450 value 586.205314 -## iter 460 value 586.200564 -## iter 470 value 586.169054 -## iter 480 value 586.165167 -## iter 490 value 586.161566 -## iter 500 value 586.143238 -## iter 510 value 586.133024 -## iter 520 value 586.120649 -## iter 530 value 586.118065 -## iter 540 value 586.110238 -## iter 550 value 586.107076 -## iter 560 value 586.073191 -## iter 570 value 586.071515 -## iter 580 value 586.054136 -## iter 590 value 586.049598 -## iter 600 value 586.043825 -## iter 610 value 586.029238 -## iter 620 value 586.023768 -## iter 630 value 586.015749 -## iter 640 value 586.003773 -## iter 650 value 586.000547 -## iter 660 value 585.999038 -## iter 670 value 585.986995 -## iter 680 value 585.984374 -## iter 690 value 585.975055 -## iter 700 value 585.973831 -## iter 710 value 585.969559 -## iter 720 value 585.965204 -## iter 730 value 585.951227 -## iter 740 value 585.949015 -## iter 750 value 585.945802 -## iter 760 value 585.937485 -## iter 770 value 585.929229 -## iter 780 value 585.917009 -## iter 790 value 585.914528 -## iter 800 value 585.911814 -## iter 810 value 585.884459 -## iter 820 value 585.708546 -## iter 830 value 585.568783 -## iter 840 value 585.557953 -## iter 850 value 585.546461 -## iter 860 value 585.537657 -## iter 870 value 585.517154 -## iter 880 value 585.509741 -## iter 890 value 585.498883 -## iter 900 value 585.492619 -## final value 585.488230 +
## # weights: 44 (30 variable) +## initial value 27280.854519 +## iter 10 value 12654.212777 +## iter 20 value 6673.400386 +## iter 30 value 5900.795573 +## iter 40 value 5579.611334 +## iter 50 value 5437.754669 +## iter 60 value 5289.623501 +## iter 70 value 5089.205002 +## iter 80 value 4828.414224 +## iter 90 value 4722.853944 +## iter 100 value 4716.025496 +## iter 110 value 4708.762722 +## iter 120 value 4703.187810 +## iter 130 value 4702.317236 +## iter 140 value 4700.036796 +## iter 150 value 4698.415786 +## iter 160 value 4691.593834 +## iter 170 value 4666.532005 +## iter 180 value 4647.199789 +## iter 190 value 4645.953016 +## iter 200 value 4644.413888 +## iter 210 value 4640.909007 +## iter 220 value 4639.913660 +## iter 230 value 4639.756334 +## iter 240 value 4639.163422 +## iter 250 value 4637.084115 +## iter 260 value 4636.784964 +## iter 270 value 4635.808570 +## iter 280 value 4634.779618 +## iter 290 value 4634.438043 +## iter 300 value 4634.244641 +## final value 4632.480217 ## converged
-the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Bengaluru (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days") @@ -424,52 +364,31 @@
Project wee gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 32 (21 variable) -## initial value 921.192603 -## iter 10 value 637.332915 -## iter 20 value 606.587631 -## iter 30 value 599.596613 -## iter 40 value 593.194865 -## iter 50 value 590.495369 -## iter 60 value 588.943258 -## iter 70 value 588.195117 -## iter 80 value 587.986667 -## iter 90 value 587.707232 -## iter 100 value 587.568833 -## iter 110 value 587.451504 -## iter 120 value 586.892208 -## iter 130 value 586.088265 -## iter 140 value 585.821760 -## iter 150 value 585.700048 -## iter 160 value 585.671991 -## iter 170 value 585.612740 -## iter 180 value 585.584925 -## iter 190 value 585.535420 -## iter 200 value 585.523463 -## iter 210 value 585.490528 -## iter 220 value 585.397931 -## iter 230 value 585.333381 -## iter 240 value 585.317947 -## iter 250 value 585.307050 -## iter 260 value 585.244933 -## iter 270 value 585.226067 -## iter 280 value 585.202597 -## iter 290 value 585.195030 -## iter 300 value 585.180452 -## iter 310 value 585.142082 -## iter 320 value 585.129631 -## iter 330 value 585.121452 -## iter 340 value 585.105555 -## iter 350 value 585.066093 -## iter 360 value 585.040772 -## iter 370 value 585.027635 -## iter 380 value 585.011006 -## iter 390 value 584.959059 -## iter 400 value 584.933911 -## iter 410 value 584.907723 -## iter 420 value 584.902269 -## iter 430 value 584.891214 -## final value 584.885007 +
## # weights: 40 (27 variable) +## initial value 13260.587551 +## iter 10 value 4244.312127 +## iter 20 value 3571.482803 +## iter 30 value 3494.250103 +## iter 40 value 3457.604725 +## iter 50 value 3444.861697 +## iter 60 value 3440.569061 +## iter 70 value 3439.411840 +## iter 80 value 3438.525153 +## iter 90 value 3438.196092 +## iter 100 value 3437.826340 +## iter 110 value 3437.265419 +## iter 120 value 3437.234425 +## iter 130 value 3437.191321 +## iter 140 value 3437.012394 +## iter 150 value 3436.953845 +## iter 160 value 3436.881184 +## iter 170 value 3436.695579 +## iter 180 value 3436.659370 +## iter 190 value 3436.612976 +## iter 200 value 3436.592489 +## iter 210 value 3436.564673 +## iter 220 value 3436.539005 +## final value 3436.537103 ## converged
@@ -517,52 +436,31 @@the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Bengaluru (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
Project wee gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 32 (21 variable) -## initial value 921.192603 -## iter 10 value 637.332915 -## iter 20 value 606.587631 -## iter 30 value 599.596613 -## iter 40 value 593.194865 -## iter 50 value 590.495369 -## iter 60 value 588.943258 -## iter 70 value 588.195117 -## iter 80 value 587.986667 -## iter 90 value 587.707232 -## iter 100 value 587.568833 -## iter 110 value 587.451504 -## iter 120 value 586.892208 -## iter 130 value 586.088265 -## iter 140 value 585.821760 -## iter 150 value 585.700048 -## iter 160 value 585.671991 -## iter 170 value 585.612740 -## iter 180 value 585.584925 -## iter 190 value 585.535420 -## iter 200 value 585.523463 -## iter 210 value 585.490528 -## iter 220 value 585.397931 -## iter 230 value 585.333381 -## iter 240 value 585.317947 -## iter 250 value 585.307050 -## iter 260 value 585.244933 -## iter 270 value 585.226067 -## iter 280 value 585.202597 -## iter 290 value 585.195030 -## iter 300 value 585.180452 -## iter 310 value 585.142082 -## iter 320 value 585.129631 -## iter 330 value 585.121452 -## iter 340 value 585.105555 -## iter 350 value 585.066093 -## iter 360 value 585.040772 -## iter 370 value 585.027635 -## iter 380 value 585.011006 -## iter 390 value 584.959059 -## iter 400 value 584.933911 -## iter 410 value 584.907723 -## iter 420 value 584.902269 -## iter 430 value 584.891214 -## final value 584.885007 +
## # weights: 40 (27 variable) +## initial value 13260.587551 +## iter 10 value 4244.312127 +## iter 20 value 3571.482803 +## iter 30 value 3494.250103 +## iter 40 value 3457.604725 +## iter 50 value 3444.861697 +## iter 60 value 3440.569061 +## iter 70 value 3439.411840 +## iter 80 value 3438.525153 +## iter 90 value 3438.196092 +## iter 100 value 3437.826340 +## iter 110 value 3437.265419 +## iter 120 value 3437.234425 +## iter 130 value 3437.191321 +## iter 140 value 3437.012394 +## iter 150 value 3436.953845 +## iter 160 value 3436.881184 +## iter 170 value 3436.695579 +## iter 180 value 3436.659370 +## iter 190 value 3436.612976 +## iter 200 value 3436.592489 +## iter 210 value 3436.564673 +## iter 220 value 3436.539005 +## final value 3436.537103 ## converged
diff --git a/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-5-1.png index acbb3f86..c40a0c3b 100644 Binary files a/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-6-1.png index 224e67e0..5da7cb57 100644 Binary files a/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-7-1.png index bde4353b..4ef5bbc5 100644 Binary files a/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-8-1.png index 79028e47..74d33f2b 100644 Binary files a/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VariantAnimation-Bengaluru_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/docs/articles/VariantAnimation-Chennai.html b/docs/articles/VariantAnimation-Chennai.html index a6052a1f..9fd6086f 100644 --- a/docs/articles/VariantAnimation-Chennai.html +++ b/docs/articles/VariantAnimation-Chennai.html @@ -136,7 +136,7 @@the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Bengaluru (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
Get variants data for India
- - + +-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs") +
gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() @@ -188,8 +188,8 @@
Top 10 cities with
city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))
## # weights: 36 (24 variable)
-## initial value 1779.751908
-## iter 10 value 991.793574
-## iter 20 value 889.885834
-## iter 30 value 874.354598
-## iter 40 value 866.610645
-## iter 50 value 860.066748
-## iter 60 value 859.458049
-## iter 70 value 858.588454
-## iter 80 value 852.529458
-## iter 90 value 851.552362
-## iter 100 value 850.538021
-## iter 110 value 850.204650
-## iter 120 value 850.150788
-## iter 130 value 850.019667
-## iter 140 value 849.821623
-## iter 150 value 849.068066
-## iter 160 value 849.025243
-## iter 170 value 848.920775
-## iter 180 value 848.886340
-## iter 190 value 848.760664
-## iter 200 value 848.599107
-## iter 210 value 848.554962
-## iter 220 value 848.520087
-## iter 230 value 848.498250
-## iter 240 value 848.420038
-## iter 250 value 848.304831
-## iter 260 value 848.293434
-## iter 270 value 848.233222
-## iter 280 value 848.201880
-## iter 290 value 848.180200
-## iter 300 value 848.041948
-## iter 310 value 847.984698
-## iter 320 value 847.946892
-## iter 330 value 847.890911
-## iter 340 value 847.866641
-## iter 350 value 847.798708
-## iter 360 value 847.771467
-## iter 370 value 847.742980
-## iter 380 value 847.719187
-## iter 390 value 847.659856
-## iter 400 value 847.508463
-## iter 410 value 847.481159
-## iter 420 value 847.323116
-## iter 430 value 847.301290
-## iter 440 value 847.279707
-## final value 847.278351
+## # weights: 48 (33 variable)
+## initial value 15605.213761
+## iter 10 value 9346.725587
+## iter 20 value 6735.265161
+## iter 30 value 6252.767740
+## iter 40 value 5962.591363
+## iter 50 value 5839.616667
+## iter 60 value 5688.700478
+## iter 70 value 5646.847872
+## iter 80 value 5644.264029
+## iter 90 value 5635.112092
+## iter 100 value 5632.626406
+## iter 110 value 5611.731368
+## iter 120 value 5608.160319
+## iter 130 value 5602.430986
+## iter 140 value 5602.085418
+## iter 150 value 5601.992062
+## iter 160 value 5601.547330
+## iter 170 value 5599.095961
+## iter 180 value 5597.310934
+## iter 190 value 5596.025887
+## iter 200 value 5586.144855
+## iter 210 value 5582.730045
+## iter 220 value 5582.206277
+## iter 230 value 5581.641031
+## iter 240 value 5580.844556
+## iter 250 value 5578.550303
+## iter 260 value 5577.858001
+## iter 270 value 5577.656828
+## iter 280 value 5577.632627
+## iter 290 value 5577.545751
+## iter 300 value 5577.491586
+## iter 310 value 5577.422956
+## iter 320 value 5576.188103
+## iter 330 value 5571.337207
+## final value 5569.995071
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Chennai (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days")
@@ -426,56 +415,39 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 32 (21 variable)
-## initial value 1268.459340
-## iter 10 value 795.062679
-## iter 20 value 749.508485
-## iter 30 value 739.179730
-## iter 40 value 736.835110
-## iter 50 value 736.442544
-## iter 60 value 735.864333
-## iter 70 value 734.406026
-## iter 80 value 734.100075
-## iter 90 value 733.327338
-## iter 100 value 732.905875
-## iter 110 value 732.809431
-## iter 120 value 732.471697
-## iter 130 value 732.249288
-## iter 140 value 732.205271
-## iter 150 value 731.930271
-## iter 160 value 731.696672
-## iter 170 value 731.639763
-## iter 180 value 731.559236
-## iter 190 value 731.500805
-## iter 200 value 731.474572
-## iter 210 value 731.329832
-## iter 220 value 731.249310
-## iter 230 value 731.188857
-## iter 240 value 731.066760
-## iter 250 value 731.034609
-## iter 260 value 731.004835
-## iter 270 value 730.990132
-## iter 280 value 730.974169
-## iter 290 value 730.854711
-## iter 300 value 730.621687
-## iter 310 value 730.578534
-## iter 320 value 730.431668
-## iter 330 value 730.355839
-## iter 340 value 730.348660
-## iter 350 value 730.345089
-## iter 360 value 730.341325
-## iter 370 value 730.331525
-## iter 380 value 730.259238
-## iter 390 value 730.153046
-## iter 400 value 730.123614
-## iter 410 value 730.055951
-## iter 420 value 730.040177
-## iter 430 value 730.037826
-## iter 440 value 730.036758
-## iter 450 value 730.035420
-## iter 460 value 730.027286
-## iter 470 value 729.983742
-## final value 729.960267
+## # weights: 44 (30 variable)
+## initial value 9646.732682
+## iter 10 value 4436.449277
+## iter 20 value 3750.586782
+## iter 30 value 3524.118672
+## iter 40 value 3477.534654
+## iter 50 value 3461.347353
+## iter 60 value 3457.749224
+## iter 70 value 3455.803570
+## iter 80 value 3455.186713
+## iter 90 value 3453.396263
+## iter 100 value 3451.684841
+## iter 110 value 3448.796346
+## iter 120 value 3448.681536
+## iter 130 value 3448.621780
+## iter 140 value 3448.598491
+## iter 150 value 3448.517228
+## iter 160 value 3448.295038
+## iter 170 value 3448.240697
+## iter 180 value 3448.196202
+## iter 190 value 3448.104299
+## iter 200 value 3448.042618
+## iter 210 value 3448.020950
+## iter 220 value 3447.924799
+## iter 230 value 3447.797141
+## iter 240 value 3447.738687
+## iter 250 value 3447.697683
+## iter 260 value 3447.677071
+## iter 270 value 3447.658190
+## iter 280 value 3447.631436
+## iter 290 value 3447.563336
+## iter 300 value 3447.544602
+## final value 3447.504293
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Chennai (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
@@ -523,56 +495,39 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 32 (21 variable)
-## initial value 1268.459340
-## iter 10 value 795.062679
-## iter 20 value 749.508485
-## iter 30 value 739.179730
-## iter 40 value 736.835110
-## iter 50 value 736.442544
-## iter 60 value 735.864333
-## iter 70 value 734.406026
-## iter 80 value 734.100075
-## iter 90 value 733.327338
-## iter 100 value 732.905875
-## iter 110 value 732.809431
-## iter 120 value 732.471697
-## iter 130 value 732.249288
-## iter 140 value 732.205271
-## iter 150 value 731.930271
-## iter 160 value 731.696672
-## iter 170 value 731.639763
-## iter 180 value 731.559236
-## iter 190 value 731.500805
-## iter 200 value 731.474572
-## iter 210 value 731.329832
-## iter 220 value 731.249310
-## iter 230 value 731.188857
-## iter 240 value 731.066760
-## iter 250 value 731.034609
-## iter 260 value 731.004835
-## iter 270 value 730.990132
-## iter 280 value 730.974169
-## iter 290 value 730.854711
-## iter 300 value 730.621687
-## iter 310 value 730.578534
-## iter 320 value 730.431668
-## iter 330 value 730.355839
-## iter 340 value 730.348660
-## iter 350 value 730.345089
-## iter 360 value 730.341325
-## iter 370 value 730.331525
-## iter 380 value 730.259238
-## iter 390 value 730.153046
-## iter 400 value 730.123614
-## iter 410 value 730.055951
-## iter 420 value 730.040177
-## iter 430 value 730.037826
-## iter 440 value 730.036758
-## iter 450 value 730.035420
-## iter 460 value 730.027286
-## iter 470 value 729.983742
-## final value 729.960267
+## # weights: 44 (30 variable)
+## initial value 9646.732682
+## iter 10 value 4436.449277
+## iter 20 value 3750.586782
+## iter 30 value 3524.118672
+## iter 40 value 3477.534654
+## iter 50 value 3461.347353
+## iter 60 value 3457.749224
+## iter 70 value 3455.803570
+## iter 80 value 3455.186713
+## iter 90 value 3453.396263
+## iter 100 value 3451.684841
+## iter 110 value 3448.796346
+## iter 120 value 3448.681536
+## iter 130 value 3448.621780
+## iter 140 value 3448.598491
+## iter 150 value 3448.517228
+## iter 160 value 3448.295038
+## iter 170 value 3448.240697
+## iter 180 value 3448.196202
+## iter 190 value 3448.104299
+## iter 200 value 3448.042618
+## iter 210 value 3448.020950
+## iter 220 value 3447.924799
+## iter 230 value 3447.797141
+## iter 240 value 3447.738687
+## iter 250 value 3447.697683
+## iter 260 value 3447.677071
+## iter 270 value 3447.658190
+## iter 280 value 3447.631436
+## iter 290 value 3447.563336
+## iter 300 value 3447.544602
+## final value 3447.504293
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Chennai (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
diff --git a/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-10-1.png
index 8b12bc02..6fc5ebdc 100644
Binary files a/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-10-1.png differ
diff --git a/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-11-1.png b/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-11-1.png
index 4a8ffe2f..af5622ea 100644
Binary files a/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-11-1.png and b/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-11-1.png differ
diff --git a/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-7-1.png
index 4567ff44..79eb0c69 100644
Binary files a/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-8-1.png
index 52aa368d..66bac285 100644
Binary files a/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-9-1.png
index fff8bc9b..7af1fd3f 100644
Binary files a/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/VariantAnimation-Chennai_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/docs/articles/VariantAnimation-Delhi.html b/docs/articles/VariantAnimation-Delhi.html
index ba33049d..cd3ef049 100644
--- a/docs/articles/VariantAnimation-Delhi.html
+++ b/docs/articles/VariantAnimation-Delhi.html
@@ -136,7 +136,7 @@
Get variants data for India
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
@@ -186,8 +186,8 @@ Top 10 cities with
city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq)
DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))
-
-
+
+
Get monthly cases for Delhi
@@ -307,61 +307,52 @@ Project wee
gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist)
-## # weights: 24 (15 variable)
-## initial value 842.126951
-## iter 10 value 216.238972
-## iter 20 value 189.791312
-## iter 30 value 161.502995
-## iter 40 value 158.001709
-## iter 50 value 157.620952
-## iter 60 value 157.307382
-## iter 70 value 156.889664
-## iter 80 value 156.544836
-## iter 90 value 156.412922
-## iter 100 value 155.048818
-## iter 110 value 154.848817
-## iter 120 value 154.827926
-## iter 130 value 154.731501
-## iter 140 value 154.658254
-## iter 150 value 154.613782
-## iter 160 value 153.885377
-## iter 170 value 153.604019
-## iter 180 value 153.459823
-## iter 190 value 153.430215
-## iter 200 value 153.412026
-## iter 210 value 153.347006
-## iter 220 value 153.306556
-## iter 230 value 153.280920
-## iter 240 value 153.226716
-## iter 250 value 153.207759
-## iter 260 value 153.200943
-## iter 270 value 153.155258
-## iter 280 value 153.135377
-## iter 290 value 153.119085
-## iter 300 value 153.092022
-## iter 310 value 153.064245
-## iter 320 value 153.053716
-## iter 330 value 152.995881
-## iter 340 value 152.951868
-## iter 350 value 152.851132
-## iter 360 value 152.656721
-## iter 370 value 152.622231
-## iter 380 value 152.586770
-## iter 390 value 152.563590
-## iter 400 value 152.552759
-## iter 410 value 152.459565
-## iter 420 value 152.455760
-## iter 430 value 152.424036
-## iter 440 value 151.570482
-## iter 450 value 151.363254
-## iter 460 value 150.998569
-## iter 470 value 150.984107
-## iter 480 value 150.926106
-## iter 490 value 150.915520
-## iter 500 value 150.628730
-## iter 510 value 150.187642
-## iter 520 value 150.171820
-## final value 150.124810
+## # weights: 32 (21 variable)
+## initial value 4302.364550
+## iter 10 value 1572.411772
+## iter 20 value 1123.483648
+## iter 30 value 1016.583002
+## iter 40 value 997.937340
+## iter 50 value 984.531287
+## iter 60 value 942.126087
+## iter 70 value 936.966776
+## iter 80 value 921.123735
+## iter 90 value 918.589362
+## iter 100 value 917.222805
+## iter 110 value 909.578605
+## iter 120 value 904.884701
+## iter 130 value 884.008789
+## iter 140 value 881.890180
+## iter 150 value 881.523712
+## iter 160 value 881.336429
+## iter 170 value 877.763992
+## iter 180 value 877.432142
+## iter 190 value 877.150836
+## iter 200 value 876.799542
+## iter 210 value 876.346739
+## iter 220 value 876.299027
+## iter 230 value 876.256709
+## iter 240 value 876.049911
+## iter 250 value 875.612340
+## iter 260 value 874.869984
+## iter 270 value 874.552435
+## iter 280 value 874.227920
+## iter 290 value 873.978667
+## iter 300 value 873.901212
+## iter 310 value 873.879910
+## iter 320 value 873.859179
+## iter 330 value 873.711357
+## iter 340 value 873.060577
+## iter 350 value 872.863673
+## iter 360 value 872.577441
+## iter 370 value 872.384707
+## iter 380 value 872.127411
+## iter 390 value 871.977778
+## iter 400 value 871.876208
+## iter 410 value 871.847102
+## iter 420 value 871.508436
+## iter 430 value 871.060681
+## final value 871.057527
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in New Delhi (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days")
@@ -393,110 +384,38 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 16 (9 variable)
-## initial value 88.722839
-## iter 10 value 18.566645
-## iter 20 value 15.275942
-## iter 30 value 14.637524
-## iter 40 value 14.619395
-## iter 50 value 14.608012
-## iter 60 value 14.594810
-## iter 70 value 14.579141
-## iter 80 value 14.557447
-## iter 90 value 14.527072
-## iter 100 value 14.524759
-## iter 110 value 14.518887
-## iter 120 value 14.474850
-## iter 130 value 14.471176
-## iter 140 value 14.462106
-## iter 150 value 14.456082
-## iter 160 value 14.414876
-## iter 170 value 14.393493
-## iter 180 value 14.391128
-## iter 190 value 14.362229
-## iter 200 value 14.336908
-## iter 210 value 14.334876
-## iter 220 value 14.321236
-## iter 230 value 14.315444
-## iter 240 value 14.306113
-## iter 250 value 14.296477
-## iter 260 value 14.290316
-## iter 270 value 14.212284
-## iter 280 value 14.164693
-## iter 290 value 14.147070
-## iter 300 value 14.133277
-## iter 310 value 14.127263
-## iter 320 value 14.119815
-## iter 330 value 14.119150
-## iter 340 value 14.114425
-## iter 350 value 14.111003
-## iter 360 value 14.105709
-## iter 370 value 14.093937
-## iter 380 value 14.088865
-## iter 390 value 14.084908
-## iter 400 value 14.083747
-## iter 410 value 14.081511
-## iter 420 value 14.078802
-## iter 430 value 14.074838
-## iter 440 value 14.073306
-## iter 450 value 14.060703
-## iter 460 value 13.895915
-## iter 470 value 13.888568
-## iter 480 value 13.878325
-## iter 490 value 13.874439
-## iter 500 value 13.867358
-## iter 510 value 13.861740
-## iter 520 value 13.861637
-## iter 530 value 13.854962
-## iter 540 value 13.843729
-## iter 550 value 13.835448
-## iter 560 value 13.833888
-## iter 570 value 13.832535
-## iter 580 value 13.831420
-## iter 590 value 13.830374
-## iter 600 value 13.828765
-## iter 610 value 13.827862
-## iter 620 value 13.826744
-## iter 630 value 13.825367
-## iter 640 value 13.823906
-## iter 650 value 13.822345
-## iter 660 value 13.820044
-## iter 670 value 13.819611
-## iter 680 value 13.817792
-## iter 690 value 13.814517
-## iter 700 value 13.811589
-## iter 710 value 13.811447
-## iter 720 value 13.808551
-## iter 730 value 13.803871
-## iter 740 value 13.799947
-## iter 750 value 13.798061
-## iter 760 value 13.794305
-## iter 770 value 13.790901
-## iter 780 value 13.789124
-## iter 790 value 13.785390
-## iter 800 value 13.775121
-## iter 810 value 13.771331
-## iter 820 value 13.770409
-## iter 830 value 13.769883
-## iter 840 value 13.769200
-## iter 850 value 13.768360
-## iter 860 value 13.768059
-## iter 870 value 13.767148
-## iter 880 value 13.766697
-## iter 890 value 13.765881
-## iter 900 value 13.765745
-## iter 910 value 13.764903
-## iter 920 value 13.764044
-## iter 930 value 13.763257
-## iter 940 value 13.762609
-## iter 950 value 13.761595
-## iter 960 value 13.759836
-## iter 970 value 13.757579
-## iter 980 value 13.756053
-## iter 990 value 13.754867
-## iter1000 value 13.753617
-## final value 13.753617
-## stopped after 1000 iterations
+## # weights: 24 (15 variable)
+## initial value 987.259468
+## iter 10 value 209.938281
+## iter 20 value 191.017827
+## iter 30 value 189.292215
+## iter 40 value 188.434340
+## iter 50 value 187.750904
+## iter 60 value 187.394283
+## iter 70 value 187.164293
+## iter 80 value 187.015105
+## iter 90 value 186.962660
+## iter 100 value 186.868844
+## iter 110 value 186.823994
+## iter 120 value 186.791548
+## iter 130 value 186.759796
+## iter 140 value 186.719025
+## iter 150 value 186.694064
+## iter 160 value 186.685413
+## iter 170 value 186.677086
+## iter 180 value 186.655211
+## iter 190 value 186.632648
+## iter 200 value 186.619366
+## iter 210 value 186.607642
+## iter 220 value 186.588133
+## iter 230 value 186.576262
+## iter 240 value 186.566091
+## iter 250 value 186.539792
+## iter 260 value 186.514579
+## iter 270 value 186.512583
+## iter 280 value 186.498376
+## final value 186.498347
+## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in New Delhi (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
## `geom_line()`: Each group consists of only one observation.
@@ -524,110 +443,38 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 16 (9 variable)
-## initial value 88.722839
-## iter 10 value 18.566645
-## iter 20 value 15.275942
-## iter 30 value 14.637524
-## iter 40 value 14.619395
-## iter 50 value 14.608012
-## iter 60 value 14.594810
-## iter 70 value 14.579141
-## iter 80 value 14.557447
-## iter 90 value 14.527072
-## iter 100 value 14.524759
-## iter 110 value 14.518887
-## iter 120 value 14.474850
-## iter 130 value 14.471176
-## iter 140 value 14.462106
-## iter 150 value 14.456082
-## iter 160 value 14.414876
-## iter 170 value 14.393493
-## iter 180 value 14.391128
-## iter 190 value 14.362229
-## iter 200 value 14.336908
-## iter 210 value 14.334876
-## iter 220 value 14.321236
-## iter 230 value 14.315444
-## iter 240 value 14.306113
-## iter 250 value 14.296477
-## iter 260 value 14.290316
-## iter 270 value 14.212284
-## iter 280 value 14.164693
-## iter 290 value 14.147070
-## iter 300 value 14.133277
-## iter 310 value 14.127263
-## iter 320 value 14.119815
-## iter 330 value 14.119150
-## iter 340 value 14.114425
-## iter 350 value 14.111003
-## iter 360 value 14.105709
-## iter 370 value 14.093937
-## iter 380 value 14.088865
-## iter 390 value 14.084908
-## iter 400 value 14.083747
-## iter 410 value 14.081511
-## iter 420 value 14.078802
-## iter 430 value 14.074838
-## iter 440 value 14.073306
-## iter 450 value 14.060703
-## iter 460 value 13.895915
-## iter 470 value 13.888568
-## iter 480 value 13.878325
-## iter 490 value 13.874439
-## iter 500 value 13.867358
-## iter 510 value 13.861740
-## iter 520 value 13.861637
-## iter 530 value 13.854962
-## iter 540 value 13.843729
-## iter 550 value 13.835448
-## iter 560 value 13.833888
-## iter 570 value 13.832535
-## iter 580 value 13.831420
-## iter 590 value 13.830374
-## iter 600 value 13.828765
-## iter 610 value 13.827862
-## iter 620 value 13.826744
-## iter 630 value 13.825367
-## iter 640 value 13.823906
-## iter 650 value 13.822345
-## iter 660 value 13.820044
-## iter 670 value 13.819611
-## iter 680 value 13.817792
-## iter 690 value 13.814517
-## iter 700 value 13.811589
-## iter 710 value 13.811447
-## iter 720 value 13.808551
-## iter 730 value 13.803871
-## iter 740 value 13.799947
-## iter 750 value 13.798061
-## iter 760 value 13.794305
-## iter 770 value 13.790901
-## iter 780 value 13.789124
-## iter 790 value 13.785390
-## iter 800 value 13.775121
-## iter 810 value 13.771331
-## iter 820 value 13.770409
-## iter 830 value 13.769883
-## iter 840 value 13.769200
-## iter 850 value 13.768360
-## iter 860 value 13.768059
-## iter 870 value 13.767148
-## iter 880 value 13.766697
-## iter 890 value 13.765881
-## iter 900 value 13.765745
-## iter 910 value 13.764903
-## iter 920 value 13.764044
-## iter 930 value 13.763257
-## iter 940 value 13.762609
-## iter 950 value 13.761595
-## iter 960 value 13.759836
-## iter 970 value 13.757579
-## iter 980 value 13.756053
-## iter 990 value 13.754867
-## iter1000 value 13.753617
-## final value 13.753617
-## stopped after 1000 iterations
+## # weights: 24 (15 variable)
+## initial value 987.259468
+## iter 10 value 209.938281
+## iter 20 value 191.017827
+## iter 30 value 189.292215
+## iter 40 value 188.434340
+## iter 50 value 187.750904
+## iter 60 value 187.394283
+## iter 70 value 187.164293
+## iter 80 value 187.015105
+## iter 90 value 186.962660
+## iter 100 value 186.868844
+## iter 110 value 186.823994
+## iter 120 value 186.791548
+## iter 130 value 186.759796
+## iter 140 value 186.719025
+## iter 150 value 186.694064
+## iter 160 value 186.685413
+## iter 170 value 186.677086
+## iter 180 value 186.655211
+## iter 190 value 186.632648
+## iter 200 value 186.619366
+## iter 210 value 186.607642
+## iter 220 value 186.588133
+## iter 230 value 186.576262
+## iter 240 value 186.566091
+## iter 250 value 186.539792
+## iter 260 value 186.514579
+## iter 270 value 186.512583
+## iter 280 value 186.498376
+## final value 186.498347
+## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in New Delhi (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
## `geom_line()`: Each group consists of only one observation.
diff --git a/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-5-1.png
index 79bb33eb..fbb13295 100644
Binary files a/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-6-1.png
index b0ed63d2..42e839b8 100644
Binary files a/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-7-1.png
index de796f96..354cf099 100644
Binary files a/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-8-1.png
index 26f8fa15..36f71d75 100644
Binary files a/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-9-1.png
index 2382265c..d73c17a0 100644
Binary files a/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/VariantAnimation-Delhi_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/docs/articles/VariantAnimation-Germany.html b/docs/articles/VariantAnimation-Germany.html
index be554904..049be50a 100644
--- a/docs/articles/VariantAnimation-Germany.html
+++ b/docs/articles/VariantAnimation-Germany.html
@@ -134,7 +134,7 @@
Get variants data for Germany
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_germany <- gisaid_metadata %>%
filter(Country == "Germany") %>%
filter(Host == "Human")
@@ -240,23 +240,27 @@ Project wee
gisaid_germany_weekwise <- gisaid_germany_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_germany_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 52 (36 variable)
-## initial value 365428.334958
-## iter 10 value 217795.790523
-## iter 20 value 182222.924780
-## iter 30 value 162640.399065
-## iter 40 value 133150.540193
-## iter 50 value 123339.803407
-## iter 60 value 120379.141352
-## iter 70 value 119282.449737
-## iter 80 value 119032.405637
-## iter 90 value 118788.427205
-## iter 100 value 117472.705713
-## iter 110 value 116743.881223
-## iter 120 value 116330.532158
-## iter 130 value 116267.934702
-## iter 140 value 116246.039563
-## final value 116235.817226
+## # weights: 64 (45 variable)
+## initial value 2541013.794392
+## iter 10 value 1436014.351377
+## iter 20 value 1200649.359247
+## iter 30 value 1077138.014753
+## iter 40 value 895460.149087
+## iter 50 value 690003.838247
+## iter 60 value 612618.319791
+## iter 70 value 601203.308286
+## iter 80 value 598226.217654
+## iter 90 value 596582.929614
+## iter 100 value 596255.136217
+## iter 110 value 595722.103952
+## iter 120 value 590570.174104
+## iter 130 value 586915.107977
+## iter 140 value 586633.801923
+## iter 150 value 586531.832978
+## iter 160 value 586527.821082
+## iter 170 value 586527.267376
+## iter 180 value 586526.888955
+## final value 586526.661932
## converged
the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Germany by variant", caption = "**Source: gisaid.org and covid19datahub.io**<br>", date_breaks = "28 days")
@@ -285,18 +289,19 @@ Project wee
gisaid_germany_weekwise <- gisaid_germany_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_germany_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 40 (27 variable)
-## initial value 202544.595120
-## iter 10 value 134616.636291
-## iter 20 value 113480.373066
-## iter 30 value 101938.361479
-## iter 40 value 98575.249357
-## iter 50 value 97337.481139
-## iter 60 value 97217.785587
-## iter 70 value 97168.865780
-## iter 80 value 97037.390914
-## iter 90 value 97029.979879
-## final value 97029.903283
+## # weights: 44 (30 variable)
+## initial value 1367452.533009
+## iter 10 value 751017.747720
+## iter 20 value 658423.038647
+## iter 30 value 559986.050260
+## iter 40 value 461925.415351
+## iter 50 value 439359.230923
+## iter 60 value 433166.405710
+## iter 70 value 432394.696474
+## iter 80 value 430788.951975
+## iter 90 value 429166.390439
+## iter 100 value 429161.187543
+## final value 429161.084513
## converged
the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Germany by variant", caption = "**Source: gisaid.org and covid19datahub.io**<br>")
diff --git a/docs/articles/VariantAnimation-Germany_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/VariantAnimation-Germany_files/figure-html/unnamed-chunk-3-1.png
index 15eb75d7..3e2ff3e3 100644
Binary files a/docs/articles/VariantAnimation-Germany_files/figure-html/unnamed-chunk-3-1.png and b/docs/articles/VariantAnimation-Germany_files/figure-html/unnamed-chunk-3-1.png differ
diff --git a/docs/articles/VariantAnimation-Gujarat.html b/docs/articles/VariantAnimation-Gujarat.html
index fd353f9d..14cc1dc9 100644
--- a/docs/articles/VariantAnimation-Gujarat.html
+++ b/docs/articles/VariantAnimation-Gujarat.html
@@ -136,7 +136,7 @@
Get variants data for India
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
@@ -178,8 +178,8 @@ Top 10 cities with
state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq)
DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))
-
-
+
+
Get monthly cases for Gujarat
@@ -295,65 +295,60 @@ Project wee
gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist)
-## # weights: 44 (30 variable)
-## initial value 11852.796333
-## iter 10 value 5204.938442
-## iter 20 value 4230.005743
-## iter 30 value 3874.885439
-## iter 40 value 3822.985505
-## iter 50 value 3780.950617
-## iter 60 value 3741.386027
-## iter 70 value 3699.654759
-## iter 80 value 3679.619314
-## iter 90 value 3651.111198
-## iter 100 value 3636.847864
-## iter 110 value 3622.823067
-## iter 120 value 3599.758896
-## iter 130 value 3594.464443
-## iter 140 value 3587.385269
-## iter 150 value 3582.623837
-## iter 160 value 3579.096872
-## iter 170 value 3568.869613
-## iter 180 value 3561.514165
-## iter 190 value 3545.173652
-## iter 200 value 3544.467758
-## iter 210 value 3540.668895
-## iter 220 value 3535.527065
-## iter 230 value 3534.266164
-## iter 240 value 3532.022898
-## iter 250 value 3530.532125
-## iter 260 value 3529.998220
-## iter 270 value 3528.827971
-## iter 280 value 3526.850176
-## iter 290 value 3525.801652
-## iter 300 value 3522.965255
-## iter 310 value 3522.583829
-## iter 320 value 3522.543243
-## iter 330 value 3521.515799
-## iter 340 value 3520.749972
-## iter 350 value 3520.232052
-## iter 360 value 3519.200442
-## iter 370 value 3518.315020
-## iter 380 value 3517.629251
-## iter 390 value 3517.375281
-## iter 400 value 3516.633577
-## iter 410 value 3516.368706
-## iter 420 value 3515.875001
-## iter 430 value 3515.548838
-## iter 440 value 3515.535986
-## iter 450 value 3515.350050
-## iter 460 value 3515.044937
-## iter 470 value 3514.831077
-## iter 480 value 3514.302837
-## iter 490 value 3513.851037
-## iter 500 value 3513.818529
-## iter 510 value 3513.579557
-## iter 520 value 3513.503817
-## iter 530 value 3513.388354
-## iter 540 value 3513.020285
-## iter 550 value 3512.749580
-## iter 550 value 3512.749571
-## final value 3512.749571
+## # weights: 52 (36 variable)
+## initial value 38764.079639
+## iter 10 value 17744.693245
+## iter 20 value 15353.290900
+## iter 30 value 11804.024603
+## iter 40 value 11003.283524
+## iter 50 value 9855.261192
+## iter 60 value 9537.385392
+## iter 70 value 9478.499569
+## iter 80 value 9461.186853
+## iter 90 value 9456.051637
+## iter 100 value 9431.217254
+## iter 110 value 9407.310468
+## iter 120 value 9377.377643
+## iter 130 value 9344.599124
+## iter 140 value 9330.446441
+## iter 150 value 9322.375629
+## iter 160 value 9321.930201
+## iter 170 value 9317.108359
+## iter 180 value 9312.966862
+## iter 190 value 9309.077117
+## iter 200 value 9301.992421
+## iter 210 value 9286.413430
+## iter 220 value 9269.038826
+## iter 230 value 9268.396739
+## iter 240 value 9265.527420
+## iter 250 value 9262.656451
+## iter 260 value 9261.791977
+## iter 270 value 9260.319589
+## iter 280 value 9259.472335
+## iter 290 value 9258.206341
+## iter 300 value 9257.205463
+## iter 310 value 9257.153682
+## iter 320 value 9256.630873
+## iter 330 value 9255.452898
+## iter 340 value 9254.743776
+## iter 350 value 9253.155977
+## iter 360 value 9251.176747
+## iter 370 value 9250.928093
+## iter 380 value 9250.915270
+## iter 390 value 9250.734815
+## iter 400 value 9250.429761
+## iter 410 value 9250.151556
+## iter 420 value 9249.753608
+## iter 430 value 9249.158697
+## iter 440 value 9248.140073
+## iter 450 value 9248.120433
+## iter 460 value 9247.903035
+## iter 470 value 9247.734087
+## iter 480 value 9247.487534
+## iter 490 value 9247.092301
+## iter 500 value 9246.875676
+## iter 510 value 9246.698038
+## final value 9246.641456
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Gujarat (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days")
@@ -397,24 +392,19 @@ Project wee
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 40 (27 variable)
-## initial value 8970.871522
-## iter 10 value 4077.098919
-## iter 20 value 3511.549306
-## iter 30 value 3371.088320
-## iter 40 value 3317.078177
-## iter 50 value 3315.408474
-## iter 60 value 3314.292756
-## iter 70 value 3313.984443
-## iter 80 value 3313.178808
-## iter 90 value 3312.773496
-## iter 100 value 3312.542516
-## iter 110 value 3311.938413
-## iter 120 value 3311.752572
-## iter 130 value 3311.722829
-## iter 140 value 3311.647620
-## iter 150 value 3311.516536
-## iter 160 value 3311.356727
-## final value 3311.265338
+## initial value 21402.528439
+## iter 10 value 10912.220209
+## iter 20 value 8286.883657
+## iter 30 value 6854.495448
+## iter 40 value 6689.035906
+## iter 50 value 6650.708185
+## iter 60 value 6608.192890
+## iter 70 value 6586.968376
+## iter 80 value 6547.505054
+## iter 90 value 6528.787140
+## iter 100 value 6527.524930
+## iter 110 value 6527.321975
+## final value 6527.321571
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Gujarat (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
@@ -463,24 +453,19 @@ Project wee
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 40 (27 variable)
-## initial value 8970.871522
-## iter 10 value 4077.098919
-## iter 20 value 3511.549306
-## iter 30 value 3371.088320
-## iter 40 value 3317.078177
-## iter 50 value 3315.408474
-## iter 60 value 3314.292756
-## iter 70 value 3313.984443
-## iter 80 value 3313.178808
-## iter 90 value 3312.773496
-## iter 100 value 3312.542516
-## iter 110 value 3311.938413
-## iter 120 value 3311.752572
-## iter 130 value 3311.722829
-## iter 140 value 3311.647620
-## iter 150 value 3311.516536
-## iter 160 value 3311.356727
-## final value 3311.265338
+## initial value 21402.528439
+## iter 10 value 10912.220209
+## iter 20 value 8286.883657
+## iter 30 value 6854.495448
+## iter 40 value 6689.035906
+## iter 50 value 6650.708185
+## iter 60 value 6608.192890
+## iter 70 value 6586.968376
+## iter 80 value 6547.505054
+## iter 90 value 6528.787140
+## iter 100 value 6527.524930
+## iter 110 value 6527.321975
+## final value 6527.321571
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Gujarat (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
diff --git a/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-5-1.png
index cde156a9..872e238c 100644
Binary files a/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-6-1.png
index dd932341..f077626b 100644
Binary files a/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-7-1.png
index f330edb4..4d5a4f1e 100644
Binary files a/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-8-1.png
index 08c3fa6d..9117b20a 100644
Binary files a/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-9-1.png
index 8c774df5..5d5f131a 100644
Binary files a/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/VariantAnimation-Gujarat_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/docs/articles/VariantAnimation-India.html b/docs/articles/VariantAnimation-India.html
index 19c77cf6..b8d79cb9 100644
--- a/docs/articles/VariantAnimation-India.html
+++ b/docs/articles/VariantAnimation-India.html
@@ -133,7 +133,7 @@
Get variants data for India
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
@@ -237,20 +237,22 @@ Project wee
gisaid_india_weekwise <- gisaid_india_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_india_weekwise, confirmed_subset_dateweekwise_long_india)
-## # weights: 28 (18 variable)
-## initial value 81510.284324
-## iter 10 value 38054.048312
-## iter 20 value 24115.682859
-## iter 30 value 20845.261008
-## iter 40 value 19011.530294
-## iter 50 value 18968.977884
-## iter 60 value 18894.945566
-## iter 70 value 18699.400046
-## iter 80 value 18620.948082
-## iter 90 value 18619.893285
-## iter 100 value 18589.912291
-## iter 110 value 18588.809774
-## final value 18588.805908
+## # weights: 48 (33 variable)
+## initial value 604518.150134
+## iter 10 value 239290.717101
+## iter 20 value 211919.842428
+## iter 30 value 150571.240170
+## iter 40 value 115302.479481
+## iter 50 value 111877.511346
+## iter 60 value 108533.841765
+## iter 70 value 106057.824153
+## iter 80 value 106002.127446
+## iter 90 value 105868.155159
+## iter 100 value 105675.198731
+## iter 110 value 105171.392178
+## iter 120 value 105124.977172
+## iter 130 value 105123.283786
+## final value 105122.768012
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in India by variant", caption = "**Source: gisaid.org and ourworldindata.org/coronavirus**", date_breaks = "28 days") # , trans_y="log10")
@@ -281,17 +283,23 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india)
-## # weights: 24 (15 variable)
-## initial value 38784.425471
-## iter 10 value 12730.648310
-## iter 20 value 10325.808044
-## iter 30 value 10201.403230
-## iter 40 value 10170.007525
-## iter 50 value 10154.979021
-## iter 60 value 10138.545159
-## iter 60 value 10138.545063
-## iter 60 value 10138.545063
-## final value 10138.545063
+## # weights: 36 (24 variable)
+## initial value 239025.075646
+## iter 10 value 54670.508003
+## iter 20 value 47864.975637
+## iter 30 value 43612.533101
+## iter 40 value 41166.541898
+## iter 50 value 40459.092105
+## iter 60 value 40351.681054
+## iter 70 value 40152.813651
+## iter 80 value 40092.206218
+## iter 90 value 40087.562871
+## iter 100 value 40078.965829
+## iter 110 value 40076.541732
+## iter 120 value 40075.378575
+## iter 130 value 40075.230960
+## iter 140 value 40074.684228
+## final value 40074.591451
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in India by variant", caption = "**Source: gisaid.org and ourworldindata.org/coronavirus**<br>") # , trans_y="log10")
@@ -327,18 +335,25 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india)
-## # weights: 36 (24 variable)
-## initial value 42340.517605
-## iter 10 value 12243.823368
-## iter 20 value 9987.299574
-## iter 30 value 9749.502975
-## iter 40 value 9703.612388
-## iter 50 value 9697.475009
-## iter 60 value 9697.365270
-## iter 70 value 9695.337980
-## iter 80 value 9689.392183
-## iter 90 value 9682.998997
-## final value 9679.821524
+## # weights: 40 (27 variable)
+## initial value 137906.426390
+## iter 10 value 61113.746615
+## iter 20 value 44415.411795
+## iter 30 value 31015.016648
+## iter 40 value 29132.763443
+## iter 50 value 28862.886583
+## iter 60 value 28851.868322
+## iter 70 value 28844.129892
+## iter 80 value 28829.456669
+## iter 90 value 28818.262278
+## iter 100 value 28815.156792
+## iter 110 value 28813.225064
+## iter 120 value 28812.776639
+## iter 130 value 28812.709463
+## iter 140 value 28812.536162
+## iter 150 value 28812.411470
+## iter 160 value 28812.378914
+## final value 28812.316517
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in India by variant", caption = "**Source: gisaid.org and ourworldindata.org/coronavirus**<br>")
@@ -374,18 +389,25 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india)
-## # weights: 36 (24 variable)
-## initial value 42340.517605
-## iter 10 value 12243.823368
-## iter 20 value 9987.299574
-## iter 30 value 9749.502975
-## iter 40 value 9703.612388
-## iter 50 value 9697.475009
-## iter 60 value 9697.365270
-## iter 70 value 9695.337980
-## iter 80 value 9689.392183
-## iter 90 value 9682.998997
-## final value 9679.821524
+## # weights: 40 (27 variable)
+## initial value 137906.426390
+## iter 10 value 61113.746615
+## iter 20 value 44415.411795
+## iter 30 value 31015.016648
+## iter 40 value 29132.763443
+## iter 50 value 28862.886583
+## iter 60 value 28851.868322
+## iter 70 value 28844.129892
+## iter 80 value 28829.456669
+## iter 90 value 28818.262278
+## iter 100 value 28815.156792
+## iter 110 value 28813.225064
+## iter 120 value 28812.776639
+## iter 130 value 28812.709463
+## iter 140 value 28812.536162
+## iter 150 value 28812.411470
+## iter 160 value 28812.378914
+## final value 28812.316517
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in India by variant", caption = "**Source: gisaid.org and ourworldindata.org/coronavirus**<br>")
@@ -420,10 +442,17 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india)
-## # weights: 12 (6 variable)
-## initial value 295.526706
-## iter 10 value 175.310430
-## final value 175.308861
+## # weights: 24 (15 variable)
+## initial value 1413.698221
+## iter 10 value 599.432562
+## iter 20 value 565.165427
+## iter 30 value 564.967411
+## iter 40 value 564.917097
+## iter 50 value 564.814682
+## iter 60 value 564.168373
+## iter 70 value 563.978967
+## iter 80 value 563.974712
+## final value 563.974621
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in India by variant", caption = "**Source: gisaid.org and ourworldindata.org/coronavirus**<br>")
diff --git a/docs/articles/VariantAnimation-India_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/VariantAnimation-India_files/figure-html/unnamed-chunk-3-1.png
index be7dbe5a..1b66dfef 100644
Binary files a/docs/articles/VariantAnimation-India_files/figure-html/unnamed-chunk-3-1.png and b/docs/articles/VariantAnimation-India_files/figure-html/unnamed-chunk-3-1.png differ
diff --git a/docs/articles/VariantAnimation-Jaipur.html b/docs/articles/VariantAnimation-Jaipur.html
index edac02cc..91f762f8 100644
--- a/docs/articles/VariantAnimation-Jaipur.html
+++ b/docs/articles/VariantAnimation-Jaipur.html
@@ -136,7 +136,7 @@
Get variants data for India
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
@@ -186,8 +186,8 @@ Top 10 cities with
city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq)
DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))
-
-
+
+
Get monthly cases for Jaipur
@@ -285,39 +285,31 @@ Project wee
gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist)
-## # weights: 32 (21 variable)
-## initial value 1617.805519
-## iter 10 value 480.680046
-## iter 20 value 388.097274
-## iter 30 value 380.954800
-## iter 40 value 373.712096
-## iter 50 value 371.282928
-## iter 60 value 370.757331
-## iter 70 value 369.415321
-## iter 80 value 367.823526
-## iter 90 value 367.239289
-## iter 100 value 367.069536
-## iter 110 value 366.938797
-## iter 120 value 366.678526
-## iter 130 value 366.519574
-## iter 140 value 366.487989
-## iter 150 value 366.457991
-## iter 160 value 366.396086
-## iter 170 value 366.245772
-## iter 180 value 366.213012
-## iter 190 value 366.172681
-## iter 200 value 366.158749
-## iter 210 value 366.100283
-## iter 220 value 366.049895
-## iter 230 value 366.039758
-## iter 240 value 365.985949
-## iter 250 value 365.957557
-## iter 260 value 365.899334
-## iter 270 value 365.879119
-## iter 280 value 365.843718
-## iter 290 value 365.828751
-## iter 300 value 365.793715
-## final value 365.792832
+## # weights: 40 (27 variable)
+## initial value 11706.342613
+## iter 10 value 4681.457858
+## iter 20 value 3325.044410
+## iter 30 value 2938.538953
+## iter 40 value 2903.499413
+## iter 50 value 2893.454462
+## iter 60 value 2886.934015
+## iter 70 value 2881.288738
+## iter 80 value 2878.495549
+## iter 90 value 2872.100772
+## iter 100 value 2865.587078
+## iter 110 value 2864.104513
+## iter 120 value 2864.001574
+## iter 130 value 2863.350780
+## iter 140 value 2862.395382
+## iter 150 value 2861.821554
+## iter 160 value 2861.059578
+## iter 170 value 2860.837644
+## iter 180 value 2860.742589
+## iter 190 value 2860.225128
+## iter 200 value 2859.887634
+## iter 210 value 2859.745341
+## iter 220 value 2859.447069
+## final value 2859.442954
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Jaipur (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days")
@@ -360,43 +352,28 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 24 (15 variable)
-## initial value 1290.066818
-## iter 10 value 362.768644
-## iter 20 value 344.153636
-## iter 30 value 343.014915
-## iter 40 value 342.825706
-## iter 50 value 342.152276
-## iter 60 value 340.584532
-## iter 70 value 339.719525
-## iter 80 value 339.377251
-## iter 90 value 339.301194
-## iter 100 value 339.269558
-## iter 110 value 339.250575
-## iter 120 value 339.186443
-## iter 130 value 339.162322
-## iter 140 value 339.131915
-## iter 150 value 339.123937
-## iter 160 value 339.109363
-## iter 170 value 339.106562
-## iter 180 value 339.101308
-## iter 190 value 339.094793
-## iter 200 value 339.092416
-## iter 210 value 339.089950
-## iter 220 value 339.088825
-## iter 230 value 339.088030
-## iter 240 value 339.086764
-## iter 250 value 339.084645
-## iter 260 value 339.083477
-## iter 270 value 339.082670
-## iter 280 value 339.081755
-## iter 290 value 339.081098
-## iter 300 value 339.080655
-## iter 310 value 339.080352
-## iter 320 value 339.080143
-## iter 330 value 339.079784
-## iter 340 value 339.079333
-## final value 339.078769
+## # weights: 36 (24 variable)
+## initial value 8342.861720
+## iter 10 value 2201.853970
+## iter 20 value 1760.387081
+## iter 30 value 1741.001963
+## iter 40 value 1738.075480
+## iter 50 value 1737.470349
+## iter 60 value 1737.383133
+## iter 70 value 1737.021345
+## iter 80 value 1736.696090
+## iter 90 value 1735.985709
+## iter 100 value 1735.223423
+## iter 110 value 1735.215896
+## iter 120 value 1735.153141
+## iter 130 value 1735.093217
+## iter 140 value 1735.066843
+## iter 150 value 1735.054569
+## iter 160 value 1735.047039
+## iter 170 value 1735.045111
+## iter 180 value 1735.038829
+## iter 190 value 1734.946306
+## final value 1734.930932
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Jaipur (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
@@ -444,43 +421,28 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 24 (15 variable)
-## initial value 1290.066818
-## iter 10 value 362.768644
-## iter 20 value 344.153636
-## iter 30 value 343.014915
-## iter 40 value 342.825706
-## iter 50 value 342.152276
-## iter 60 value 340.584532
-## iter 70 value 339.719525
-## iter 80 value 339.377251
-## iter 90 value 339.301194
-## iter 100 value 339.269558
-## iter 110 value 339.250575
-## iter 120 value 339.186443
-## iter 130 value 339.162322
-## iter 140 value 339.131915
-## iter 150 value 339.123937
-## iter 160 value 339.109363
-## iter 170 value 339.106562
-## iter 180 value 339.101308
-## iter 190 value 339.094793
-## iter 200 value 339.092416
-## iter 210 value 339.089950
-## iter 220 value 339.088825
-## iter 230 value 339.088030
-## iter 240 value 339.086764
-## iter 250 value 339.084645
-## iter 260 value 339.083477
-## iter 270 value 339.082670
-## iter 280 value 339.081755
-## iter 290 value 339.081098
-## iter 300 value 339.080655
-## iter 310 value 339.080352
-## iter 320 value 339.080143
-## iter 330 value 339.079784
-## iter 340 value 339.079333
-## final value 339.078769
+## # weights: 36 (24 variable)
+## initial value 8342.861720
+## iter 10 value 2201.853970
+## iter 20 value 1760.387081
+## iter 30 value 1741.001963
+## iter 40 value 1738.075480
+## iter 50 value 1737.470349
+## iter 60 value 1737.383133
+## iter 70 value 1737.021345
+## iter 80 value 1736.696090
+## iter 90 value 1735.985709
+## iter 100 value 1735.223423
+## iter 110 value 1735.215896
+## iter 120 value 1735.153141
+## iter 130 value 1735.093217
+## iter 140 value 1735.066843
+## iter 150 value 1735.054569
+## iter 160 value 1735.047039
+## iter 170 value 1735.045111
+## iter 180 value 1735.038829
+## iter 190 value 1734.946306
+## final value 1734.930932
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Jaipur (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
diff --git a/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-5-1.png
index e4b4d94a..f6a599ad 100644
Binary files a/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-6-1.png
index 2d021195..a50eaf87 100644
Binary files a/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-7-1.png
index 538763c0..992a7abd 100644
Binary files a/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-8-1.png
index d294674b..411bbc09 100644
Binary files a/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VariantAnimation-Jaipur_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/VariantAnimation-Maharashtra.html b/docs/articles/VariantAnimation-Maharashtra.html
index 691a846e..5655ac86 100644
--- a/docs/articles/VariantAnimation-Maharashtra.html
+++ b/docs/articles/VariantAnimation-Maharashtra.html
@@ -136,7 +136,7 @@
Get variants data for India
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
@@ -178,8 +178,8 @@ Top 10 cities with
state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq)
DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))
-
-
+
+
Get monthly cases for Maharashtra
@@ -296,47 +296,39 @@ Project wee
india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist)
## # weights: 56 (39 variable)
-## initial value 19565.971042
-## iter 10 value 7608.774723
-## iter 20 value 6055.611321
-## iter 30 value 5119.389656
-## iter 40 value 5056.861099
-## iter 50 value 4991.059919
-## iter 60 value 4923.933525
-## iter 70 value 4863.216177
-## iter 80 value 4848.767372
-## iter 90 value 4848.150763
-## iter 100 value 4835.654061
-## iter 110 value 4825.777794
-## iter 120 value 4816.939959
-## iter 130 value 4810.664821
-## iter 140 value 4806.240961
-## iter 150 value 4800.638563
-## iter 160 value 4798.941664
-## iter 170 value 4798.913782
-## iter 180 value 4798.238247
-## iter 190 value 4797.227265
-## iter 200 value 4795.932551
-## iter 210 value 4792.381545
-## iter 220 value 4787.800654
-## iter 230 value 4783.473182
-## iter 240 value 4780.290634
-## iter 250 value 4780.170911
-## iter 260 value 4778.979885
-## iter 270 value 4778.573121
-## iter 280 value 4777.527081
-## iter 290 value 4776.920460
-## iter 300 value 4776.532227
-## iter 310 value 4775.729615
-## iter 320 value 4775.138151
-## iter 330 value 4775.113585
-## iter 340 value 4774.893283
-## iter 350 value 4774.786108
-## iter 360 value 4774.640727
-## iter 370 value 4774.537736
-## iter 380 value 4773.708292
-## iter 390 value 4772.942854
-## final value 4772.109029
+## initial value 92290.473874
+## iter 10 value 43786.967640
+## iter 20 value 38091.652452
+## iter 30 value 29729.814614
+## iter 40 value 23751.363919
+## iter 50 value 22918.378841
+## iter 60 value 22241.960092
+## iter 70 value 21845.092602
+## iter 80 value 21640.028155
+## iter 90 value 21631.796291
+## iter 100 value 21489.927178
+## iter 110 value 21354.827950
+## iter 120 value 21295.057141
+## iter 130 value 21178.168747
+## iter 140 value 21137.030647
+## iter 150 value 21086.081089
+## iter 160 value 21079.634831
+## iter 170 value 21079.576266
+## iter 180 value 21078.868718
+## iter 190 value 21077.226378
+## iter 200 value 21072.273570
+## iter 210 value 21065.960936
+## iter 220 value 21062.511129
+## iter 230 value 21056.534789
+## iter 240 value 21046.623545
+## iter 250 value 21046.531874
+## iter 260 value 21043.480253
+## iter 270 value 21041.654565
+## iter 280 value 21038.878821
+## iter 290 value 21037.633188
+## iter 300 value 21035.886300
+## iter 310 value 21035.108472
+## final value 21034.906542
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Maharashtra (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days")
@@ -380,20 +372,20 @@ Project wee
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 44 (30 variable)
-## initial value 9956.061173
-## iter 10 value 5053.817767
-## iter 20 value 4244.480483
-## iter 30 value 4049.143155
-## iter 40 value 4024.907759
-## iter 50 value 4012.618320
-## iter 60 value 4008.272616
-## iter 70 value 4008.103002
-## iter 80 value 4007.361366
-## iter 90 value 4006.740372
-## iter 100 value 4006.622176
-## iter 110 value 4005.275103
-## iter 120 value 4005.040214
-## final value 4005.037615
+## initial value 37958.682168
+## iter 10 value 17440.035895
+## iter 20 value 14321.931849
+## iter 30 value 12536.769841
+## iter 40 value 12219.945997
+## iter 50 value 12169.134388
+## iter 60 value 12132.151435
+## iter 70 value 12120.294917
+## iter 80 value 12108.850280
+## iter 90 value 12089.693685
+## iter 100 value 12083.727592
+## iter 110 value 12080.349532
+## iter 120 value 12079.978119
+## final value 12079.589240
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Maharashtra (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
@@ -442,20 +434,20 @@ Project wee
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 44 (30 variable)
-## initial value 9956.061173
-## iter 10 value 5053.817767
-## iter 20 value 4244.480483
-## iter 30 value 4049.143155
-## iter 40 value 4024.907759
-## iter 50 value 4012.618320
-## iter 60 value 4008.272616
-## iter 70 value 4008.103002
-## iter 80 value 4007.361366
-## iter 90 value 4006.740372
-## iter 100 value 4006.622176
-## iter 110 value 4005.275103
-## iter 120 value 4005.040214
-## final value 4005.037615
+## initial value 37958.682168
+## iter 10 value 17440.035895
+## iter 20 value 14321.931849
+## iter 30 value 12536.769841
+## iter 40 value 12219.945997
+## iter 50 value 12169.134388
+## iter 60 value 12132.151435
+## iter 70 value 12120.294917
+## iter 80 value 12108.850280
+## iter 90 value 12089.693685
+## iter 100 value 12083.727592
+## iter 110 value 12080.349532
+## iter 120 value 12079.978119
+## final value 12079.589240
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Maharashtra (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
diff --git a/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-5-1.png
index 7a280af3..a05dc448 100644
Binary files a/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-6-1.png
index bd398cce..3e205788 100644
Binary files a/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-7-1.png
index 37bf9c61..ae3da04a 100644
Binary files a/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-8-1.png
index b0367b32..591bd6bb 100644
Binary files a/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-9-1.png
index b0bdcb01..d02a418b 100644
Binary files a/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/VariantAnimation-Maharashtra_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/docs/articles/VariantAnimation-Mumbai.html b/docs/articles/VariantAnimation-Mumbai.html
index 5dbb71d6..9d2866f3 100644
--- a/docs/articles/VariantAnimation-Mumbai.html
+++ b/docs/articles/VariantAnimation-Mumbai.html
@@ -136,7 +136,7 @@
Get variants data for India
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
@@ -186,8 +186,8 @@ Top 10 cities with
city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq)
DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))
-
-
+
+
Get monthly cases for Mumbai
@@ -307,50 +307,38 @@ Project wee
india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist)
## # weights: 44 (30 variable)
-## initial value 3527.303946
-## iter 10 value 1725.338659
-## iter 20 value 1240.428645
-## iter 30 value 1181.810283
-## iter 40 value 1136.265458
-## iter 50 value 1111.457175
-## iter 60 value 1099.683360
-## iter 70 value 1098.235525
-## iter 80 value 1094.513037
-## iter 90 value 1089.626876
-## iter 100 value 1087.950479
-## iter 110 value 1084.237840
-## iter 120 value 1080.377940
-## iter 130 value 1078.802869
-## iter 140 value 1078.395087
-## iter 150 value 1076.663773
-## iter 160 value 1074.924808
-## iter 170 value 1073.793667
-## iter 180 value 1072.510879
-## iter 190 value 1071.133760
-## iter 200 value 1069.901259
-## iter 210 value 1069.743032
-## iter 220 value 1069.245087
-## iter 230 value 1068.522121
-## iter 240 value 1066.815777
-## iter 250 value 1066.610830
-## iter 260 value 1065.904848
-## iter 270 value 1065.089457
-## iter 280 value 1064.895344
-## iter 290 value 1064.513308
-## iter 300 value 1064.273613
-## iter 310 value 1064.131692
-## iter 320 value 1064.096957
-## iter 330 value 1063.885446
-## iter 340 value 1063.775116
-## iter 350 value 1063.658981
-## iter 360 value 1063.387082
-## iter 370 value 1060.470320
-## iter 380 value 1060.101363
-## iter 390 value 1059.576990
-## iter 400 value 1059.463714
-## iter 410 value 1059.259133
-## iter 420 value 1059.126508
-## final value 1059.092892
+## initial value 15574.329797
+## iter 10 value 7180.065979
+## iter 20 value 4687.044311
+## iter 30 value 4136.486563
+## iter 40 value 3969.175266
+## iter 50 value 3825.992578
+## iter 60 value 3799.447246
+## iter 70 value 3780.892669
+## iter 80 value 3777.022187
+## iter 90 value 3766.742649
+## iter 100 value 3759.681911
+## iter 110 value 3750.156800
+## iter 120 value 3732.670839
+## iter 130 value 3732.047471
+## iter 140 value 3729.770426
+## iter 150 value 3727.391408
+## iter 160 value 3725.303330
+## iter 170 value 3721.171763
+## iter 180 value 3718.983600
+## iter 190 value 3718.679393
+## iter 200 value 3718.266131
+## iter 210 value 3717.388299
+## iter 220 value 3716.550086
+## iter 230 value 3714.654290
+## iter 240 value 3711.627573
+## iter 250 value 3709.147146
+## iter 260 value 3707.628286
+## iter 270 value 3706.024933
+## iter 280 value 3705.084712
+## iter 290 value 3704.698938
+## iter 300 value 3704.246987
+## final value 3703.258517
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Mumbai (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days")
@@ -394,24 +382,30 @@ Project wee
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 40 (27 variable)
-## initial value 2291.072168
-## iter 10 value 1159.102986
-## iter 20 value 1006.900113
-## iter 30 value 971.531617
-## iter 40 value 963.134212
-## iter 50 value 961.954272
-## iter 60 value 960.856391
-## iter 70 value 960.402612
-## iter 80 value 959.916524
-## iter 90 value 959.423666
-## iter 100 value 958.709979
-## iter 110 value 957.809712
-## iter 120 value 957.793121
-## iter 130 value 957.674562
-## iter 140 value 957.551925
-## iter 150 value 957.408887
-## iter 160 value 957.355590
-## final value 957.344474
+## initial value 8236.346878
+## iter 10 value 3535.607096
+## iter 20 value 2813.442453
+## iter 30 value 2610.377376
+## iter 40 value 2578.461798
+## iter 50 value 2569.905312
+## iter 60 value 2553.883708
+## iter 70 value 2552.515452
+## iter 80 value 2550.730665
+## iter 90 value 2548.764127
+## iter 100 value 2546.005380
+## iter 110 value 2544.766794
+## iter 120 value 2544.734442
+## iter 130 value 2544.663193
+## iter 140 value 2544.585915
+## iter 150 value 2544.447931
+## iter 160 value 2544.395797
+## iter 170 value 2544.295029
+## iter 180 value 2544.210785
+## iter 190 value 2544.163845
+## iter 200 value 2544.089318
+## iter 210 value 2543.958257
+## iter 220 value 2543.905407
+## final value 2543.903712
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Mumbai (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
@@ -460,24 +454,30 @@ Project wee
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 40 (27 variable)
-## initial value 2291.072168
-## iter 10 value 1159.102986
-## iter 20 value 1006.900113
-## iter 30 value 971.531617
-## iter 40 value 963.134212
-## iter 50 value 961.954272
-## iter 60 value 960.856391
-## iter 70 value 960.402612
-## iter 80 value 959.916524
-## iter 90 value 959.423666
-## iter 100 value 958.709979
-## iter 110 value 957.809712
-## iter 120 value 957.793121
-## iter 130 value 957.674562
-## iter 140 value 957.551925
-## iter 150 value 957.408887
-## iter 160 value 957.355590
-## final value 957.344474
+## initial value 8236.346878
+## iter 10 value 3535.607096
+## iter 20 value 2813.442453
+## iter 30 value 2610.377376
+## iter 40 value 2578.461798
+## iter 50 value 2569.905312
+## iter 60 value 2553.883708
+## iter 70 value 2552.515452
+## iter 80 value 2550.730665
+## iter 90 value 2548.764127
+## iter 100 value 2546.005380
+## iter 110 value 2544.766794
+## iter 120 value 2544.734442
+## iter 130 value 2544.663193
+## iter 140 value 2544.585915
+## iter 150 value 2544.447931
+## iter 160 value 2544.395797
+## iter 170 value 2544.295029
+## iter 180 value 2544.210785
+## iter 190 value 2544.163845
+## iter 200 value 2544.089318
+## iter 210 value 2543.958257
+## iter 220 value 2543.905407
+## final value 2543.903712
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Mumbai (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
diff --git a/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-5-1.png
index 59b05fd2..5f9729c8 100644
Binary files a/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-6-1.png
index 0b1ffb88..1d458481 100644
Binary files a/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-7-1.png
index 1ab89739..b7787881 100644
Binary files a/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-8-1.png
index f49edee5..a0d758ec 100644
Binary files a/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-9-1.png
index 5615b9bb..f5969842 100644
Binary files a/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/VariantAnimation-Mumbai_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/docs/articles/VariantAnimation-NYC.html b/docs/articles/VariantAnimation-NYC.html
index 1e96558c..8c067715 100644
--- a/docs/articles/VariantAnimation-NYC.html
+++ b/docs/articles/VariantAnimation-NYC.html
@@ -136,7 +136,7 @@ Get variants data for NY state
counties <- c("New York", "New York City", "New York County", "Queens County", "Bronx County", "Bronx", "Brooklyn", "Manhattan", "Queens", "Richmond County")
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_usa <- gisaid_metadata %>%
filter(Country == "USA") %>%
filter(Host == "Human")
@@ -238,22 +238,38 @@ Project wee
gisaid_NYC_weekwise <- gisaid_NYC_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
newyork_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_NYC_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 48 (33 variable)
-## initial value 55214.625758
-## iter 10 value 29139.581037
-## iter 20 value 23305.357080
-## iter 30 value 19393.092597
-## iter 40 value 18429.876753
-## iter 50 value 18002.466926
-## iter 60 value 17769.623406
-## iter 70 value 17601.869697
-## iter 80 value 17520.209522
-## iter 90 value 17064.551526
-## iter 100 value 16553.712437
-## iter 110 value 16460.880818
-## iter 120 value 16440.607424
-## iter 130 value 16384.801717
-## final value 16372.683465
+## # weights: 68 (48 variable)
+## initial value 434742.421579
+## iter 10 value 172908.943693
+## iter 20 value 158096.275203
+## iter 30 value 137963.178756
+## iter 40 value 112185.093400
+## iter 50 value 96349.077242
+## iter 60 value 91375.768307
+## iter 70 value 89558.579783
+## iter 80 value 85230.672765
+## iter 90 value 82059.202655
+## iter 100 value 81330.375423
+## iter 110 value 81288.687707
+## iter 120 value 81082.417118
+## iter 130 value 80500.271895
+## iter 140 value 80215.197664
+## iter 150 value 80056.480328
+## iter 160 value 79994.371220
+## iter 170 value 79963.675813
+## iter 180 value 79926.006538
+## iter 190 value 79856.930388
+## iter 200 value 79851.554087
+## iter 210 value 79851.415523
+## iter 220 value 79848.446744
+## iter 230 value 79834.630875
+## iter 240 value 79829.614291
+## iter 250 value 79824.795167
+## iter 260 value 79817.678629
+## iter 270 value 79813.915561
+## iter 280 value 79810.872483
+## iter 290 value 79809.499585
+## final value 79809.414813
## converged
the_anim <- PlotVariantPrevalenceAnimated(newyork_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in New York City by variant", caption = "**Source: gisaid.org and NYC Health**<br>", date_breaks = "14 days")
@@ -280,16 +296,21 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 32 (21 variable)
-## initial value 5327.529230
-## iter 10 value 4039.737561
-## iter 20 value 3758.946653
-## iter 30 value 3745.574275
-## iter 40 value 3742.924257
-## iter 50 value 3742.879272
-## iter 60 value 3742.872099
-## iter 70 value 3742.859234
-## final value 3742.858440
+## # weights: 40 (27 variable)
+## initial value 8950.148256
+## iter 10 value 5960.417017
+## iter 20 value 5423.066784
+## iter 30 value 5353.275285
+## iter 40 value 5349.990803
+## iter 50 value 5348.273452
+## iter 60 value 5346.501931
+## iter 60 value 5346.501879
+## iter 70 value 5346.477768
+## iter 80 value 5346.300888
+## iter 90 value 5346.221968
+## iter 100 value 5346.156319
+## iter 110 value 5345.587597
+## final value 5345.582571
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in New York City by variant", caption = "**Source: gisaid.org and NYC Health**<br>")
diff --git a/docs/articles/VariantAnimation-NYC_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/VariantAnimation-NYC_files/figure-html/unnamed-chunk-4-1.png
index 9809adb5..d19960ba 100644
Binary files a/docs/articles/VariantAnimation-NYC_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/VariantAnimation-NYC_files/figure-html/unnamed-chunk-4-1.png differ
diff --git a/docs/articles/VariantAnimation-NewYork.html b/docs/articles/VariantAnimation-NewYork.html
index 4cb0be8d..cfc118e6 100644
--- a/docs/articles/VariantAnimation-NewYork.html
+++ b/docs/articles/VariantAnimation-NewYork.html
@@ -134,7 +134,7 @@
Get variants data for NY state
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_usa <- gisaid_metadata %>%
filter(Country == "USA") %>%
filter(Host == "Human")
@@ -249,34 +249,41 @@ Project wee
gisaid_NY_weekwise <- gisaid_NY_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
newyork_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_NY_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 60 (42 variable)
-## initial value 178463.216303
-## iter 10 value 110808.389214
-## iter 20 value 88792.766438
-## iter 30 value 78241.917607
-## iter 40 value 67543.456232
-## iter 50 value 61216.263926
-## iter 60 value 58689.673063
-## iter 70 value 57757.529140
-## iter 80 value 56176.312847
-## iter 90 value 55591.040458
-## iter 100 value 55504.811975
-## iter 110 value 54280.555653
-## iter 120 value 53849.227614
-## iter 130 value 53668.215286
-## iter 140 value 53481.762178
-## iter 150 value 53463.499277
-## iter 160 value 53361.257589
-## iter 170 value 53324.474898
-## iter 180 value 53298.299091
-## iter 190 value 53294.083035
-## iter 200 value 53290.886651
-## iter 210 value 53288.427050
-## iter 220 value 53279.979997
-## iter 230 value 53273.400947
-## iter 240 value 53253.162964
-## iter 250 value 53249.011605
-## final value 53231.262951
+## # weights: 76 (54 variable)
+## initial value 1017648.166663
+## iter 10 value 635967.740786
+## iter 20 value 561253.118952
+## iter 30 value 506758.650450
+## iter 40 value 415396.456372
+## iter 50 value 301316.426486
+## iter 60 value 234166.334608
+## iter 70 value 211152.164742
+## iter 80 value 204120.020928
+## iter 90 value 201692.347518
+## iter 100 value 199658.516348
+## iter 110 value 195917.115777
+## iter 120 value 195611.515708
+## iter 130 value 194517.524249
+## iter 140 value 190809.512018
+## iter 150 value 189596.048810
+## iter 160 value 189290.073377
+## iter 170 value 189164.804994
+## iter 180 value 189067.017700
+## iter 190 value 188977.611539
+## iter 200 value 188875.645604
+## iter 210 value 188838.343778
+## iter 220 value 188829.583671
+## iter 230 value 188828.429929
+## iter 240 value 188826.842527
+## iter 250 value 188825.845445
+## iter 260 value 188813.193107
+## iter 270 value 188804.354187
+## iter 280 value 188795.991184
+## iter 290 value 188785.979340
+## iter 300 value 188784.091699
+## iter 310 value 188779.709328
+## iter 320 value 188774.638386
+## final value 188768.378730
## converged
the_anim <- PlotVariantPrevalenceAnimated(newyork_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in New York state by variant", caption = "**Source: gisaid.org and covid19nytimes**<br>", date_breaks = "28 days")
@@ -305,19 +312,18 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 32 (21 variable)
-## initial value 57280.296707
-## iter 10 value 35939.840454
-## iter 20 value 28224.458492
-## iter 30 value 27764.149841
-## iter 40 value 27751.341971
-## iter 50 value 27746.918766
-## iter 60 value 27745.334762
-## iter 70 value 27737.987179
-## iter 80 value 27735.997653
-## iter 80 value 27735.997450
-## iter 80 value 27735.997450
-## final value 27735.997450
+## # weights: 36 (24 variable)
+## initial value 80895.217264
+## iter 10 value 55509.333467
+## iter 20 value 44058.411224
+## iter 30 value 40374.163074
+## iter 40 value 40178.920030
+## iter 50 value 40154.494550
+## iter 60 value 40153.247039
+## iter 70 value 40144.235800
+## iter 80 value 40138.867078
+## iter 90 value 40126.790788
+## final value 40126.694135
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in New York state by variant", caption = "**Source: gisaid.org and covid19nytimes**<br>")
diff --git a/docs/articles/VariantAnimation-NewYork_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/VariantAnimation-NewYork_files/figure-html/unnamed-chunk-4-1.png
index a7930f99..e7a82076 100644
Binary files a/docs/articles/VariantAnimation-NewYork_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/VariantAnimation-NewYork_files/figure-html/unnamed-chunk-4-1.png differ
diff --git a/docs/articles/VariantAnimation-Pune.html b/docs/articles/VariantAnimation-Pune.html
index b66c75c2..0cf889e2 100644
--- a/docs/articles/VariantAnimation-Pune.html
+++ b/docs/articles/VariantAnimation-Pune.html
@@ -136,7 +136,7 @@
Get variants data for India
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
@@ -186,8 +186,8 @@ Top 10 cities with
city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq)
DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))
-
-
+
+
Get monthly cases for Pune
@@ -285,94 +285,32 @@ Project wee
gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist)
-## # weights: 44 (30 variable)
-## initial value 4793.392650
-## iter 10 value 1607.388605
-## iter 20 value 1284.313749
-## iter 30 value 1239.533601
-## iter 40 value 1219.265985
-## iter 50 value 1205.580407
-## iter 60 value 1195.219552
-## iter 70 value 1194.753611
-## iter 80 value 1192.697987
-## iter 90 value 1191.004598
-## iter 100 value 1185.671136
-## iter 110 value 1176.753804
-## iter 120 value 1171.365227
-## iter 130 value 1161.907692
-## iter 140 value 1161.055949
-## iter 150 value 1160.160012
-## iter 160 value 1159.670495
-## iter 170 value 1159.392813
-## iter 180 value 1159.108705
-## iter 190 value 1158.536508
-## iter 200 value 1158.439808
-## iter 210 value 1158.300930
-## iter 220 value 1158.158490
-## iter 230 value 1158.030425
-## iter 240 value 1156.742681
-## iter 250 value 1155.471827
-## iter 260 value 1155.256422
-## iter 270 value 1154.883456
-## iter 280 value 1154.749265
-## iter 290 value 1154.682121
-## iter 300 value 1154.632839
-## iter 310 value 1154.599805
-## iter 320 value 1154.585209
-## iter 330 value 1154.566819
-## iter 340 value 1154.529109
-## iter 350 value 1154.437031
-## iter 360 value 1154.040740
-## iter 370 value 1153.826571
-## iter 380 value 1153.768968
-## iter 390 value 1153.579584
-## iter 400 value 1153.481629
-## iter 410 value 1153.437427
-## iter 420 value 1153.399009
-## iter 430 value 1153.353200
-## iter 440 value 1153.347983
-## iter 450 value 1153.340026
-## iter 460 value 1153.311195
-## iter 470 value 1153.238427
-## iter 480 value 1152.988156
-## iter 490 value 1152.660676
-## iter 500 value 1152.652236
-## iter 510 value 1152.405604
-## iter 520 value 1152.371884
-## iter 530 value 1152.338089
-## iter 540 value 1152.256812
-## iter 550 value 1152.138942
-## iter 560 value 1152.137819
-## iter 570 value 1152.124007
-## iter 580 value 1152.113174
-## iter 590 value 1152.089450
-## iter 600 value 1152.064434
-## iter 610 value 1152.017189
-## iter 620 value 1151.995781
-## iter 630 value 1151.984486
-## iter 640 value 1151.978196
-## iter 650 value 1151.955216
-## iter 660 value 1151.918562
-## iter 670 value 1151.825829
-## iter 680 value 1151.819673
-## iter 690 value 1151.762465
-## iter 700 value 1151.745721
-## iter 710 value 1151.716560
-## iter 720 value 1151.692259
-## iter 730 value 1151.681678
-## iter 740 value 1151.643660
-## iter 750 value 1151.618987
-## iter 760 value 1151.615008
-## iter 770 value 1151.584114
-## iter 780 value 1151.562771
-## iter 790 value 1151.447412
-## iter 800 value 1151.426108
-## iter 810 value 1151.336436
-## iter 820 value 1151.318859
-## iter 830 value 1151.294236
-## iter 840 value 1151.273286
-## iter 850 value 1151.232309
-## final value 1151.228050
+## # weights: 52 (36 variable)
+## initial value 26365.114445
+## iter 10 value 10731.681151
+## iter 20 value 8389.572652
+## iter 30 value 6956.285036
+## iter 40 value 6724.558551
+## iter 50 value 6644.032773
+## iter 60 value 6616.894159
+## iter 70 value 6587.235569
+## iter 80 value 6577.882868
+## iter 90 value 6565.279637
+## iter 100 value 6550.615508
+## iter 110 value 6530.419414
+## iter 120 value 6467.482211
+## iter 130 value 6439.851698
+## iter 140 value 6433.203889
+## iter 150 value 6431.338248
+## iter 160 value 6431.072707
+## iter 170 value 6429.650312
+## iter 180 value 6424.966426
+## iter 190 value 6413.818624
+## iter 200 value 6406.000393
+## iter 210 value 6404.379934
+## iter 220 value 6401.117424
+## iter 220 value 6401.117420
+## final value 6401.117420
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Pune (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days")
@@ -415,33 +353,45 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 36 (24 variable)
-## initial value 2115.927268
-## iter 10 value 988.912285
-## iter 20 value 818.505491
-## iter 30 value 795.963652
-## iter 40 value 786.736094
-## iter 50 value 782.636287
-## iter 60 value 782.474836
-## iter 70 value 781.189386
-## iter 80 value 779.502862
-## iter 90 value 778.867916
-## iter 100 value 778.641017
-## iter 110 value 778.491436
-## iter 120 value 778.292726
-## iter 130 value 778.137265
-## iter 140 value 777.977857
-## iter 150 value 777.841247
-## iter 160 value 777.830332
-## iter 170 value 777.724340
-## iter 180 value 777.648143
-## iter 190 value 777.588056
-## iter 200 value 777.479787
-## iter 210 value 777.401291
-## iter 220 value 777.369784
-## iter 230 value 777.323831
-## iter 240 value 777.289664
-## final value 777.278227
+## # weights: 44 (30 variable)
+## initial value 10212.635967
+## iter 10 value 4590.350258
+## iter 20 value 3862.561393
+## iter 30 value 3544.750729
+## iter 40 value 3498.023239
+## iter 50 value 3486.433437
+## iter 60 value 3483.069952
+## iter 70 value 3481.649036
+## iter 80 value 3479.685451
+## iter 90 value 3477.707985
+## iter 100 value 3474.316912
+## iter 110 value 3469.635470
+## iter 120 value 3467.322351
+## iter 130 value 3467.158034
+## iter 140 value 3466.778290
+## iter 150 value 3466.453209
+## iter 160 value 3466.383448
+## iter 170 value 3466.319461
+## iter 180 value 3466.184408
+## iter 190 value 3464.589688
+## iter 200 value 3464.203208
+## iter 210 value 3464.012242
+## iter 220 value 3463.948100
+## iter 230 value 3463.938896
+## iter 240 value 3463.904465
+## iter 250 value 3463.886884
+## iter 260 value 3463.879986
+## iter 270 value 3463.859002
+## iter 280 value 3463.842795
+## iter 290 value 3463.830995
+## iter 300 value 3463.563810
+## iter 310 value 3463.375418
+## iter 320 value 3463.337145
+## iter 330 value 3463.179199
+## iter 340 value 3463.123598
+## iter 350 value 3463.096437
+## iter 360 value 3463.085424
+## final value 3463.079789
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Pune (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
@@ -489,33 +439,45 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 36 (24 variable)
-## initial value 2115.927268
-## iter 10 value 988.912285
-## iter 20 value 818.505491
-## iter 30 value 795.963652
-## iter 40 value 786.736094
-## iter 50 value 782.636287
-## iter 60 value 782.474836
-## iter 70 value 781.189386
-## iter 80 value 779.502862
-## iter 90 value 778.867916
-## iter 100 value 778.641017
-## iter 110 value 778.491436
-## iter 120 value 778.292726
-## iter 130 value 778.137265
-## iter 140 value 777.977857
-## iter 150 value 777.841247
-## iter 160 value 777.830332
-## iter 170 value 777.724340
-## iter 180 value 777.648143
-## iter 190 value 777.588056
-## iter 200 value 777.479787
-## iter 210 value 777.401291
-## iter 220 value 777.369784
-## iter 230 value 777.323831
-## iter 240 value 777.289664
-## final value 777.278227
+## # weights: 44 (30 variable)
+## initial value 10212.635967
+## iter 10 value 4590.350258
+## iter 20 value 3862.561393
+## iter 30 value 3544.750729
+## iter 40 value 3498.023239
+## iter 50 value 3486.433437
+## iter 60 value 3483.069952
+## iter 70 value 3481.649036
+## iter 80 value 3479.685451
+## iter 90 value 3477.707985
+## iter 100 value 3474.316912
+## iter 110 value 3469.635470
+## iter 120 value 3467.322351
+## iter 130 value 3467.158034
+## iter 140 value 3466.778290
+## iter 150 value 3466.453209
+## iter 160 value 3466.383448
+## iter 170 value 3466.319461
+## iter 180 value 3466.184408
+## iter 190 value 3464.589688
+## iter 200 value 3464.203208
+## iter 210 value 3464.012242
+## iter 220 value 3463.948100
+## iter 230 value 3463.938896
+## iter 240 value 3463.904465
+## iter 250 value 3463.886884
+## iter 260 value 3463.879986
+## iter 270 value 3463.859002
+## iter 280 value 3463.842795
+## iter 290 value 3463.830995
+## iter 300 value 3463.563810
+## iter 310 value 3463.375418
+## iter 320 value 3463.337145
+## iter 330 value 3463.179199
+## iter 340 value 3463.123598
+## iter 350 value 3463.096437
+## iter 360 value 3463.085424
+## final value 3463.079789
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Pune (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
diff --git a/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-5-1.png
index 2afaccfa..af025a89 100644
Binary files a/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-6-1.png
index 4f703d31..eef0a438 100644
Binary files a/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-7-1.png
index 48456f28..55cafead 100644
Binary files a/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-8-1.png
index b6602be4..e284ccaf 100644
Binary files a/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VariantAnimation-Pune_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/VariantAnimation-Singapore.html b/docs/articles/VariantAnimation-Singapore.html
index 0b2d9e00..10c939ec 100644
--- a/docs/articles/VariantAnimation-Singapore.html
+++ b/docs/articles/VariantAnimation-Singapore.html
@@ -134,7 +134,7 @@
Get variants data for Singapore
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_singapore <- gisaid_metadata %>%
filter(Country == "Singapore") %>%
filter(Host == "Human")
@@ -248,43 +248,29 @@ Project wee
gisaid_singapore_weekwise <- gisaid_singapore_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_singapore_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 32 (21 variable)
-## initial value 30158.140679
-## iter 10 value 16516.832744
-## iter 20 value 14331.486068
-## iter 30 value 13078.794244
-## iter 40 value 13029.575883
-## iter 50 value 13009.661322
-## iter 60 value 12971.143371
-## iter 70 value 12807.532459
-## iter 80 value 12657.104555
-## iter 90 value 12651.583080
-## iter 100 value 12650.748373
-## iter 110 value 12611.948642
-## iter 120 value 12609.882074
-## iter 130 value 12590.077969
-## iter 140 value 12589.408015
-## iter 150 value 12585.965358
-## iter 160 value 12584.368535
-## iter 170 value 12582.526603
-## iter 180 value 12580.333649
-## iter 190 value 12578.811574
-## iter 200 value 12578.099224
-## iter 210 value 12576.696484
-## iter 220 value 12574.231520
-## iter 230 value 12573.676667
-## iter 240 value 12573.140207
-## iter 250 value 12572.562160
-## iter 260 value 12571.707944
-## iter 270 value 12571.573981
-## iter 280 value 12571.385233
-## iter 290 value 12570.891482
-## iter 300 value 12570.506819
-## iter 310 value 12569.866015
-## iter 320 value 12569.782789
-## iter 330 value 12569.751877
-## iter 340 value 12568.890149
-## final value 12568.713644
+## # weights: 48 (33 variable)
+## initial value 114315.645517
+## iter 10 value 72043.412962
+## iter 20 value 58286.580181
+## iter 30 value 42928.618218
+## iter 40 value 30702.343427
+## iter 50 value 29674.014823
+## iter 60 value 27058.699436
+## iter 70 value 26819.385494
+## iter 80 value 26623.156945
+## iter 90 value 25790.492935
+## iter 100 value 25607.767871
+## iter 110 value 25564.111015
+## iter 120 value 25520.515129
+## iter 130 value 25492.418859
+## iter 140 value 25478.042952
+## iter 150 value 25476.429625
+## iter 160 value 25474.958530
+## iter 170 value 25474.070826
+## iter 180 value 25471.671088
+## iter 190 value 25469.339900
+## iter 200 value 25466.376730
+## final value 25465.674124
## converged
the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Singapore by variant", caption = "**Source: gisaid.org and covid19datahub.io**<br>", date_breaks = "28 days")
@@ -313,23 +299,21 @@ Project wee
gisaid_singapore_weekwise <- gisaid_singapore_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_singapore_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 28 (18 variable)
-## initial value 25092.511372
-## iter 10 value 14112.902402
-## iter 20 value 12716.788665
-## iter 30 value 12481.379705
-## iter 40 value 12475.006271
-## iter 50 value 12473.409429
-## iter 60 value 12463.971609
-## iter 70 value 12461.373623
-## iter 80 value 12460.698322
-## iter 90 value 12460.557795
-## iter 100 value 12460.290441
-## iter 110 value 12459.855465
-## iter 120 value 12459.441354
-## iter 130 value 12459.330412
-## iter 140 value 12459.044983
-## final value 12458.983235
+## # weights: 40 (27 variable)
+## initial value 79418.462442
+## iter 10 value 46361.977991
+## iter 20 value 33769.136194
+## iter 30 value 25745.689656
+## iter 40 value 23821.442365
+## iter 50 value 23665.148645
+## iter 60 value 23613.784484
+## iter 70 value 23584.420375
+## iter 80 value 23494.936195
+## iter 90 value 23472.595033
+## iter 100 value 23462.346211
+## iter 110 value 23461.537395
+## iter 120 value 23461.499226
+## final value 23461.497355
## converged
the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Singapore by variant", caption = "**Source: gisaid.org and covid19datahub.io**<br>")
diff --git a/docs/articles/VariantAnimation-Singapore_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/VariantAnimation-Singapore_files/figure-html/unnamed-chunk-3-1.png
index aed4bea7..704b6f9a 100644
Binary files a/docs/articles/VariantAnimation-Singapore_files/figure-html/unnamed-chunk-3-1.png and b/docs/articles/VariantAnimation-Singapore_files/figure-html/unnamed-chunk-3-1.png differ
diff --git a/docs/articles/VariantAnimation-SouthAfrica.html b/docs/articles/VariantAnimation-SouthAfrica.html
index 8397c8e6..7a945a05 100644
--- a/docs/articles/VariantAnimation-SouthAfrica.html
+++ b/docs/articles/VariantAnimation-SouthAfrica.html
@@ -134,7 +134,7 @@
Get variants data for South Africa
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_sa <- gisaid_metadata %>%
filter(Country == "South Africa") %>%
filter(Host == "Human")
@@ -223,21 +223,28 @@ Project wee
gisaid_sa_weekwise <- gisaid_sa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_sa_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 20 (12 variable)
-## initial value 16968.303911
-## iter 10 value 10346.146340
-## iter 20 value 6497.476017
-## iter 30 value 5547.021101
-## iter 40 value 5401.510988
-## iter 50 value 5021.539719
-## iter 60 value 4973.058980
-## iter 70 value 4965.274836
-## iter 80 value 4953.400524
-## iter 90 value 4941.585588
-## iter 100 value 4940.342874
-## iter 110 value 4938.760390
-## iter 120 value 4930.848893
-## final value 4928.790665
+## # weights: 24 (15 variable)
+## initial value 97577.428935
+## iter 10 value 55154.515637
+## iter 20 value 27745.616633
+## iter 30 value 19320.442106
+## iter 40 value 19074.963353
+## iter 50 value 18037.261827
+## iter 60 value 17761.240412
+## iter 70 value 17755.556967
+## iter 80 value 17717.403434
+## iter 90 value 17618.849335
+## iter 100 value 17616.957595
+## iter 110 value 17594.139994
+## iter 120 value 17580.872937
+## iter 130 value 17578.935221
+## iter 140 value 17575.180064
+## iter 150 value 17561.415963
+## iter 160 value 17559.971068
+## iter 170 value 17559.071788
+## iter 180 value 17553.115865
+## iter 190 value 17552.670738
+## final value 17552.668116
## converged
the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in South Africa by variant", caption = "**Source: gisaid.org and covid19datahub.io**<br>", date_breaks = "28 days")
@@ -266,11 +273,12 @@ Project wee
gisaid_sa_weekwise <- gisaid_sa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_sa_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 12 (6 variable)
-## initial value 5955.577217
-## iter 10 value 3766.216349
-## iter 20 value 3430.487643
-## final value 3425.483745
+## # weights: 16 (9 variable)
+## initial value 28414.875520
+## iter 10 value 6243.071215
+## iter 20 value 5008.362379
+## iter 30 value 4922.237907
+## final value 4921.335322
## converged
the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in South Africa by variant", caption = "**Source: gisaid.org and covid19datahub.io**<br>")
diff --git a/docs/articles/VariantAnimation-Tamilnadu.html b/docs/articles/VariantAnimation-Tamilnadu.html
index 8ae93d84..4312deb2 100644
--- a/docs/articles/VariantAnimation-Tamilnadu.html
+++ b/docs/articles/VariantAnimation-Tamilnadu.html
@@ -136,7 +136,7 @@
Get variants data for India
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
@@ -178,8 +178,8 @@ Top 10 cities with
state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq)
DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))
-
-
+
+
Get monthly cases for Tamilnadu
@@ -295,35 +295,32 @@ Project wee
gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist)
-## # weights: 48 (33 variable)
-## initial value 8157.948531
-## iter 10 value 3768.646072
-## iter 20 value 3108.353974
-## iter 30 value 3039.670117
-## iter 40 value 2989.981150
-## iter 50 value 2961.180908
-## iter 60 value 2949.857467
-## iter 70 value 2941.070828
-## iter 80 value 2937.737045
-## iter 90 value 2935.686791
-## iter 100 value 2928.947787
-## iter 110 value 2925.676221
-## iter 120 value 2920.315436
-## iter 130 value 2912.909558
-## iter 140 value 2906.693369
-## iter 150 value 2904.764715
-## iter 160 value 2901.429874
-## iter 170 value 2898.685010
-## iter 180 value 2898.114163
-## iter 190 value 2897.274910
-## iter 200 value 2895.432057
-## iter 210 value 2894.632943
-## iter 220 value 2894.394044
-## iter 230 value 2893.136563
-## iter 240 value 2892.920048
-## iter 250 value 2892.630820
-## iter 260 value 2891.984015
-## final value 2891.350401
+## # weights: 52 (36 variable)
+## initial value 48882.804855
+## iter 10 value 22261.083247
+## iter 20 value 16795.407813
+## iter 30 value 14581.674819
+## iter 40 value 13685.708514
+## iter 50 value 13450.947012
+## iter 60 value 13385.513385
+## iter 70 value 13270.613242
+## iter 80 value 13159.881372
+## iter 90 value 13086.982518
+## iter 100 value 13029.959873
+## iter 110 value 13016.284117
+## iter 120 value 13004.515557
+## iter 130 value 12983.865946
+## iter 140 value 12968.678387
+## iter 150 value 12964.228832
+## iter 160 value 12963.962687
+## iter 170 value 12960.911855
+## iter 180 value 12956.023478
+## iter 190 value 12952.260955
+## iter 200 value 12951.643359
+## iter 210 value 12947.955831
+## iter 220 value 12945.278961
+## iter 220 value 12945.278839
+## final value 12945.278839
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Tamil Nadu (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days")
@@ -367,44 +364,20 @@ Project wee
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 44 (30 variable)
-## initial value 5016.396911
-## iter 10 value 3046.283757
-## iter 20 value 2631.109850
-## iter 30 value 2536.669333
-## iter 40 value 2512.966877
-## iter 50 value 2504.757790
-## iter 60 value 2496.599974
-## iter 70 value 2496.381698
-## iter 80 value 2496.010031
-## iter 90 value 2492.373240
-## iter 100 value 2491.814591
-## iter 110 value 2490.558512
-## iter 120 value 2489.516119
-## iter 130 value 2488.342274
-## iter 140 value 2487.703928
-## iter 150 value 2487.505173
-## iter 160 value 2487.442206
-## iter 170 value 2487.032792
-## iter 180 value 2486.723644
-## iter 190 value 2486.422689
-## iter 200 value 2486.375277
-## iter 210 value 2486.337143
-## iter 220 value 2486.251379
-## iter 230 value 2486.227673
-## iter 240 value 2486.194904
-## iter 250 value 2486.131369
-## iter 260 value 2486.121236
-## iter 270 value 2486.111113
-## iter 280 value 2486.099001
-## iter 290 value 2486.061344
-## iter 300 value 2486.005314
-## iter 310 value 2485.728155
-## iter 320 value 2485.701858
-## iter 330 value 2485.639521
-## iter 340 value 2485.624196
-## iter 350 value 2485.607884
-## iter 360 value 2485.599377
-## final value 2485.590617
+## initial value 21887.988050
+## iter 10 value 12913.556566
+## iter 20 value 10039.840106
+## iter 30 value 9160.350931
+## iter 40 value 9024.790026
+## iter 50 value 8994.142902
+## iter 60 value 8989.212071
+## iter 70 value 8986.497678
+## iter 80 value 8983.372214
+## iter 90 value 8977.915907
+## iter 100 value 8973.008756
+## iter 110 value 8970.750450
+## iter 120 value 8970.597054
+## final value 8970.575063
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Tamil Nadu (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
@@ -453,44 +426,20 @@ Project wee
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 44 (30 variable)
-## initial value 5016.396911
-## iter 10 value 3046.283757
-## iter 20 value 2631.109850
-## iter 30 value 2536.669333
-## iter 40 value 2512.966877
-## iter 50 value 2504.757790
-## iter 60 value 2496.599974
-## iter 70 value 2496.381698
-## iter 80 value 2496.010031
-## iter 90 value 2492.373240
-## iter 100 value 2491.814591
-## iter 110 value 2490.558512
-## iter 120 value 2489.516119
-## iter 130 value 2488.342274
-## iter 140 value 2487.703928
-## iter 150 value 2487.505173
-## iter 160 value 2487.442206
-## iter 170 value 2487.032792
-## iter 180 value 2486.723644
-## iter 190 value 2486.422689
-## iter 200 value 2486.375277
-## iter 210 value 2486.337143
-## iter 220 value 2486.251379
-## iter 230 value 2486.227673
-## iter 240 value 2486.194904
-## iter 250 value 2486.131369
-## iter 260 value 2486.121236
-## iter 270 value 2486.111113
-## iter 280 value 2486.099001
-## iter 290 value 2486.061344
-## iter 300 value 2486.005314
-## iter 310 value 2485.728155
-## iter 320 value 2485.701858
-## iter 330 value 2485.639521
-## iter 340 value 2485.624196
-## iter 350 value 2485.607884
-## iter 360 value 2485.599377
-## final value 2485.590617
+## initial value 21887.988050
+## iter 10 value 12913.556566
+## iter 20 value 10039.840106
+## iter 30 value 9160.350931
+## iter 40 value 9024.790026
+## iter 50 value 8994.142902
+## iter 60 value 8989.212071
+## iter 70 value 8986.497678
+## iter 80 value 8983.372214
+## iter 90 value 8977.915907
+## iter 100 value 8973.008756
+## iter 110 value 8970.750450
+## iter 120 value 8970.597054
+## final value 8970.575063
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Tamil Nadu (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
diff --git a/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-5-1.png
index 612c6356..30b6614d 100644
Binary files a/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-6-1.png
index 911fc9db..8f334e28 100644
Binary files a/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-7-1.png
index 76f7e4cd..5f6b2bcf 100644
Binary files a/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-8-1.png
index 254815e9..5bd5877a 100644
Binary files a/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-9-1.png
index ed0318bc..030fb947 100644
Binary files a/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/VariantAnimation-Tamilnadu_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/docs/articles/VariantAnimation-Telangana.html b/docs/articles/VariantAnimation-Telangana.html
index c7560a7c..58219cd8 100644
--- a/docs/articles/VariantAnimation-Telangana.html
+++ b/docs/articles/VariantAnimation-Telangana.html
@@ -136,7 +136,7 @@
Get variants data for India
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
@@ -178,8 +178,8 @@ Top 10 cities with
state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq)
DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))
-
-
+
+
Get monthly cases for Telangana
@@ -295,80 +295,43 @@ Project wee
gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist)
-## # weights: 56 (39 variable)
-## initial value 5602.718711
-## iter 10 value 2116.013341
-## iter 20 value 1323.255038
-## iter 30 value 1115.280413
-## iter 40 value 1043.040021
-## iter 50 value 1023.330161
-## iter 60 value 1018.010729
-## iter 70 value 1014.730107
-## iter 80 value 1011.514949
-## iter 90 value 1010.750265
-## iter 100 value 1008.166736
-## iter 110 value 1007.045913
-## iter 120 value 1005.439054
-## iter 130 value 998.508420
-## iter 140 value 993.102449
-## iter 150 value 982.973581
-## iter 160 value 976.637833
-## iter 170 value 976.299818
-## iter 180 value 975.071266
-## iter 190 value 974.453792
-## iter 200 value 974.246523
-## iter 210 value 973.982788
-## iter 220 value 973.876101
-## iter 230 value 973.416835
-## iter 240 value 972.342944
-## iter 250 value 972.263976
-## iter 260 value 972.110309
-## iter 270 value 971.976590
-## iter 280 value 971.755581
-## iter 290 value 971.565524
-## iter 300 value 971.331528
-## iter 310 value 971.181027
-## iter 320 value 971.072909
-## iter 330 value 970.986834
-## iter 340 value 970.938644
-## iter 350 value 970.864689
-## iter 360 value 970.705833
-## iter 370 value 970.377396
-## iter 380 value 969.984818
-## iter 390 value 969.584304
-## iter 400 value 969.124611
-## iter 410 value 969.043129
-## iter 420 value 968.902796
-## iter 430 value 968.694297
-## iter 440 value 968.622680
-## iter 450 value 968.530160
-## iter 460 value 968.205026
-## iter 470 value 968.071484
-## iter 480 value 967.979301
-## iter 490 value 967.914327
-## iter 500 value 967.855913
-## iter 510 value 967.642718
-## iter 520 value 967.207897
-## iter 530 value 967.070703
-## iter 540 value 966.896199
-## iter 550 value 966.852812
-## iter 560 value 966.729519
-## iter 570 value 966.690269
-## iter 580 value 966.648115
-## iter 590 value 966.589533
-## iter 600 value 966.517249
-## iter 610 value 966.408093
-## iter 620 value 966.292126
-## iter 630 value 965.882591
-## iter 640 value 965.494561
-## iter 650 value 965.420995
-## iter 660 value 965.228104
-## iter 670 value 965.189451
-## iter 680 value 964.885146
-## iter 690 value 964.616141
-## iter 700 value 964.364620
-## iter 710 value 964.290974
-## final value 964.288343
+## # weights: 60 (42 variable)
+## initial value 53706.051588
+## iter 10 value 19089.948274
+## iter 20 value 15271.923578
+## iter 30 value 12165.385199
+## iter 40 value 11696.811843
+## iter 50 value 11531.488444
+## iter 60 value 11407.396612
+## iter 70 value 11390.805643
+## iter 80 value 11378.215547
+## iter 90 value 11372.121578
+## iter 100 value 11368.524855
+## iter 110 value 11347.166496
+## iter 120 value 11338.343161
+## iter 130 value 11319.031443
+## iter 140 value 11304.937484
+## iter 150 value 11290.069718
+## iter 160 value 11284.086458
+## iter 170 value 11282.193713
+## iter 180 value 11281.614269
+## iter 190 value 11281.398993
+## iter 200 value 11277.649494
+## iter 210 value 11274.836315
+## iter 220 value 11274.261561
+## iter 230 value 11272.803028
+## iter 240 value 11269.009386
+## iter 250 value 11267.733930
+## iter 260 value 11266.798701
+## iter 270 value 11266.473193
+## iter 280 value 11266.188635
+## iter 290 value 11265.585484
+## iter 300 value 11264.690201
+## iter 310 value 11263.097225
+## iter 320 value 11262.670208
+## iter 330 value 11262.365255
+## iter 340 value 11261.702540
+## final value 11261.523708
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Telangana (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days")
@@ -412,51 +375,20 @@ Project wee
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 44 (30 variable)
-## initial value 1079.052873
-## iter 10 value 625.634477
-## iter 20 value 547.166139
-## iter 30 value 538.627557
-## iter 40 value 533.593782
-## iter 50 value 531.894799
-## iter 60 value 529.945360
-## iter 70 value 529.863479
-## iter 80 value 529.687090
-## iter 90 value 529.618896
-## iter 100 value 529.592203
-## iter 110 value 529.517234
-## iter 120 value 529.390010
-## iter 130 value 529.371096
-## iter 140 value 529.342747
-## iter 150 value 529.306471
-## iter 160 value 529.295707
-## iter 170 value 529.212047
-## iter 180 value 529.156862
-## iter 190 value 529.149834
-## iter 200 value 529.138589
-## iter 210 value 529.121713
-## iter 220 value 529.090372
-## iter 230 value 529.050669
-## iter 240 value 529.038350
-## iter 250 value 529.034447
-## iter 260 value 529.033852
-## iter 270 value 529.029614
-## iter 280 value 529.020593
-## iter 290 value 529.003070
-## iter 300 value 528.976327
-## iter 310 value 528.957211
-## iter 320 value 528.955473
-## iter 330 value 528.949594
-## iter 340 value 528.935558
-## iter 350 value 528.915221
-## iter 360 value 528.899088
-## iter 370 value 528.891947
-## iter 380 value 528.877815
-## iter 390 value 528.870698
-## iter 400 value 528.868620
-## iter 410 value 528.862931
-## iter 420 value 528.850248
-## iter 430 value 528.830575
-## final value 528.828049
+## initial value 20362.926657
+## iter 10 value 8450.907437
+## iter 20 value 6005.436485
+## iter 30 value 5648.379329
+## iter 40 value 5595.073447
+## iter 50 value 5569.751321
+## iter 60 value 5563.255333
+## iter 70 value 5561.890705
+## iter 80 value 5559.413501
+## iter 90 value 5557.122944
+## iter 100 value 5556.345239
+## iter 110 value 5555.493314
+## iter 120 value 5555.244005
+## final value 5555.165026
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Telangana (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
@@ -505,51 +437,20 @@ Project wee
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
## # weights: 44 (30 variable)
-## initial value 1079.052873
-## iter 10 value 625.634477
-## iter 20 value 547.166139
-## iter 30 value 538.627557
-## iter 40 value 533.593782
-## iter 50 value 531.894799
-## iter 60 value 529.945360
-## iter 70 value 529.863479
-## iter 80 value 529.687090
-## iter 90 value 529.618896
-## iter 100 value 529.592203
-## iter 110 value 529.517234
-## iter 120 value 529.390010
-## iter 130 value 529.371096
-## iter 140 value 529.342747
-## iter 150 value 529.306471
-## iter 160 value 529.295707
-## iter 170 value 529.212047
-## iter 180 value 529.156862
-## iter 190 value 529.149834
-## iter 200 value 529.138589
-## iter 210 value 529.121713
-## iter 220 value 529.090372
-## iter 230 value 529.050669
-## iter 240 value 529.038350
-## iter 250 value 529.034447
-## iter 260 value 529.033852
-## iter 270 value 529.029614
-## iter 280 value 529.020593
-## iter 290 value 529.003070
-## iter 300 value 528.976327
-## iter 310 value 528.957211
-## iter 320 value 528.955473
-## iter 330 value 528.949594
-## iter 340 value 528.935558
-## iter 350 value 528.915221
-## iter 360 value 528.899088
-## iter 370 value 528.891947
-## iter 380 value 528.877815
-## iter 390 value 528.870698
-## iter 400 value 528.868620
-## iter 410 value 528.862931
-## iter 420 value 528.850248
-## iter 430 value 528.830575
-## final value 528.828049
+## initial value 20362.926657
+## iter 10 value 8450.907437
+## iter 20 value 6005.436485
+## iter 30 value 5648.379329
+## iter 40 value 5595.073447
+## iter 50 value 5569.751321
+## iter 60 value 5563.255333
+## iter 70 value 5561.890705
+## iter 80 value 5559.413501
+## iter 90 value 5557.122944
+## iter 100 value 5556.345239
+## iter 110 value 5555.493314
+## iter 120 value 5555.244005
+## final value 5555.165026
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Telangana (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
diff --git a/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-5-1.png
index 8538d92e..1e2668dc 100644
Binary files a/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-6-1.png
index ed347bc9..5e533704 100644
Binary files a/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-7-1.png
index 579cbc7d..61618884 100644
Binary files a/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-8-1.png
index 793954e1..39900a3d 100644
Binary files a/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-9-1.png
index 32d15468..f00dc659 100644
Binary files a/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/VariantAnimation-Telangana_files/figure-html/unnamed-chunk-9-1.png differ
diff --git a/docs/articles/VariantAnimation-UK.html b/docs/articles/VariantAnimation-UK.html
index 94c7a950..ae3ce34f 100644
--- a/docs/articles/VariantAnimation-UK.html
+++ b/docs/articles/VariantAnimation-UK.html
@@ -134,7 +134,7 @@
Get variants data for UK
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_uk <- gisaid_metadata %>%
filter(Country == "United Kingdom") %>%
filter(Host == "Human")
@@ -274,39 +274,34 @@ Project wee
gisaid_uk_weekwise <- gisaid_uk_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
uk_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_uk_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 44 (30 variable)
-## initial value 1145076.521200
-## iter 10 value 485997.744438
-## iter 20 value 473212.004997
-## iter 30 value 387614.144166
-## iter 40 value 243884.767538
-## iter 50 value 197283.772587
-## iter 60 value 177841.735048
-## iter 70 value 175198.420269
-## iter 80 value 166120.758334
-## iter 90 value 160794.210067
-## iter 100 value 160143.439582
-## iter 110 value 159830.974670
-## iter 120 value 159337.299298
-## iter 130 value 159317.981379
-## iter 140 value 159314.996395
-## iter 150 value 159252.397810
-## iter 160 value 159204.681522
-## iter 170 value 159174.250686
-## iter 180 value 159140.698943
-## iter 190 value 159081.345984
-## iter 200 value 159075.040092
-## iter 210 value 159067.944810
-## iter 220 value 159062.216124
-## iter 230 value 159055.451067
-## iter 240 value 159031.071900
-## iter 250 value 159028.143649
-## iter 260 value 159027.718193
-## iter 270 value 159025.053279
-## iter 280 value 159021.058242
-## iter 290 value 159018.631667
-## iter 300 value 159015.772920
-## final value 159011.322634
+## # weights: 60 (42 variable)
+## initial value 8172310.568083
+## iter 10 value 2743547.517967
+## iter 20 value 2525641.121346
+## iter 30 value 2126579.834310
+## iter 40 value 1808320.047747
+## iter 50 value 775094.780290
+## iter 60 value 549759.006540
+## iter 70 value 529243.266982
+## iter 80 value 512394.130990
+## iter 90 value 505138.376920
+## iter 100 value 501555.323403
+## iter 110 value 490053.228890
+## iter 120 value 473036.808321
+## iter 130 value 464964.358075
+## iter 140 value 461848.637738
+## iter 150 value 461486.546237
+## iter 160 value 461065.667929
+## iter 170 value 460962.802384
+## iter 180 value 460957.301405
+## iter 190 value 460954.413661
+## iter 200 value 460927.273149
+## iter 210 value 460849.000014
+## iter 220 value 460799.238251
+## iter 230 value 460785.317886
+## iter 240 value 460629.081216
+## iter 250 value 460610.294257
+## final value 460602.974708
## converged
the_anim <- PlotVariantPrevalenceAnimated(uk_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in New York state by variant", caption = "**Source: gisaid.org and gov.uk**<br>", date_breaks = "28 days")
@@ -335,17 +330,18 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 32 (21 variable)
-## initial value 168324.554474
-## iter 10 value 98384.643169
-## iter 20 value 90710.243078
-## iter 30 value 83891.130429
-## iter 40 value 83659.625820
-## iter 50 value 83659.028147
-## iter 60 value 83656.457527
-## iter 70 value 83651.841962
-## iter 80 value 83648.439809
-## final value 83648.396078
+## # weights: 36 (24 variable)
+## initial value 216061.881588
+## iter 10 value 122081.232449
+## iter 20 value 114882.771885
+## iter 30 value 105583.612784
+## iter 40 value 104884.729251
+## iter 50 value 104872.199675
+## iter 60 value 104869.111877
+## iter 70 value 104847.009961
+## iter 80 value 104815.837220
+## iter 90 value 104790.302860
+## final value 104790.293137
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in the UK by variant", caption = "**Source: gisaid.org and gov.uk**<br>")
diff --git a/docs/articles/VariantAnimation-UK_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/VariantAnimation-UK_files/figure-html/unnamed-chunk-4-1.png
index 6ab1c570..bb36342f 100644
Binary files a/docs/articles/VariantAnimation-UK_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/VariantAnimation-UK_files/figure-html/unnamed-chunk-4-1.png differ
diff --git a/docs/articles/VariantAnimation-USA.html b/docs/articles/VariantAnimation-USA.html
index 5309b033..ffb93975 100644
--- a/docs/articles/VariantAnimation-USA.html
+++ b/docs/articles/VariantAnimation-USA.html
@@ -134,7 +134,7 @@
Get variants data for USA
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_usa <- gisaid_metadata %>%
filter(Country == "USA") %>%
filter(Host == "Human")
@@ -249,41 +249,30 @@ Project wee
gisaid_usa_weekwise <- gisaid_usa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
usa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_usa_weekwise, confirmed_subset_dateweekwise_long)
-#> # weights: 72 (51 variable)
-#> initial value 2495278.171194
-#> iter 10 value 1182062.190228
-#> iter 20 value 1031630.455254
-#> iter 30 value 1006328.427081
-#> iter 40 value 887432.042186
-#> iter 50 value 823408.467787
-#> iter 60 value 731702.542749
-#> iter 70 value 688589.350021
-#> iter 80 value 667644.772124
-#> iter 90 value 646284.095241
-#> iter 100 value 638642.534703
-#> iter 110 value 635466.870818
-#> iter 120 value 634394.896422
-#> iter 130 value 603193.762862
-#> iter 140 value 584864.995593
-#> iter 150 value 580021.328879
-#> iter 160 value 579062.764966
-#> iter 170 value 578020.409465
-#> iter 180 value 577737.545573
-#> iter 190 value 577437.698244
-#> iter 200 value 577180.365748
-#> iter 210 value 577124.338130
-#> iter 220 value 577122.387805
-#> iter 230 value 577118.978013
-#> iter 240 value 577086.812185
-#> iter 250 value 577034.927718
-#> iter 260 value 576993.965164
-#> iter 270 value 576950.775256
-#> iter 280 value 576932.004895
-#> iter 290 value 576918.730294
-#> iter 300 value 576851.701047
-#> iter 310 value 576824.749733
-#> iter 310 value 576824.746197
-#> final value 576824.746197
+#> # weights: 76 (54 variable)
+#> initial value 14592521.803190
+#> iter 10 value 6447202.811578
+#> iter 20 value 5861595.477527
+#> iter 30 value 5790343.712768
+#> iter 40 value 5528120.829208
+#> iter 50 value 4538098.523281
+#> iter 60 value 3575149.786314
+#> iter 70 value 2914099.568952
+#> iter 80 value 2681111.703923
+#> iter 90 value 2630567.428596
+#> iter 100 value 2588910.853970
+#> iter 110 value 2531367.915991
+#> iter 120 value 2522506.115284
+#> iter 130 value 2517585.077550
+#> iter 140 value 2484306.308171
+#> iter 150 value 2435522.265143
+#> iter 160 value 2426914.029037
+#> iter 170 value 2423789.545923
+#> iter 180 value 2423126.243360
+#> iter 190 value 2422886.593126
+#> iter 200 value 2422636.701006
+#> iter 210 value 2422381.267756
+#> final value 2422316.502467
#> converged
the_anim <- PlotVariantPrevalenceAnimated(usa_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in the USA by variant", caption = "**Source: gisaid.org and covid19nytimes**<br>", date_breaks = "28 days")
gganimate::anim_save(filename = here::here("docs/articles/USA_animated.gif"), animation = the_anim)
@@ -311,20 +300,20 @@ Project wee
gisaid_usa_weekwise <- gisaid_usa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
usa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_usa_weekwise, confirmed_subset_dateweekwise_long)
-#> # weights: 40 (27 variable)
-#> initial value 1165810.345508
-#> iter 10 value 588569.431779
-#> iter 20 value 562448.609722
-#> iter 30 value 496569.665855
-#> iter 40 value 453119.138750
-#> iter 50 value 448489.673764
-#> iter 60 value 448158.513227
-#> iter 70 value 448026.648539
-#> iter 80 value 446118.466610
-#> iter 90 value 445853.639244
-#> iter 100 value 445825.732024
-#> iter 110 value 445803.279837
-#> final value 445803.265546
+#> # weights: 44 (30 variable)
+#> initial value 5764163.766249
+#> iter 10 value 2095331.650844
+#> iter 20 value 1926857.507355
+#> iter 30 value 1789325.670173
+#> iter 40 value 1371096.520916
+#> iter 50 value 1337091.106548
+#> iter 60 value 1326424.819570
+#> iter 70 value 1325428.520676
+#> iter 80 value 1321869.796057
+#> iter 90 value 1315817.961808
+#> iter 100 value 1315538.885484
+#> iter 110 value 1315423.773849
+#> final value 1315423.389378
#> converged
the_anim <- PlotVariantPrevalenceAnimated(usa_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in the USA by variant", caption = "**Source: gisaid.org and covid19nytimes**<br>")
#> `geom_line()`: Each group consists of only one observation.
@@ -356,16 +345,18 @@ Project wee
gisaid_usa_weekwise <- gisaid_usa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
usa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_usa_weekwise, confirmed_subset_dateweekwise_long)
-#> # weights: 36 (24 variable)
-#> initial value 619144.927525
-#> iter 10 value 359056.475923
-#> iter 20 value 343328.894628
-#> iter 30 value 285959.651323
-#> iter 40 value 284538.967143
-#> iter 50 value 284425.622645
-#> iter 60 value 284419.973029
-#> iter 70 value 284363.168858
-#> final value 284312.930723
+#> # weights: 40 (27 variable)
+#> initial value 878618.117200
+#> iter 10 value 499499.693774
+#> iter 20 value 478934.552235
+#> iter 30 value 431906.634968
+#> iter 40 value 417940.677649
+#> iter 50 value 417577.713621
+#> iter 60 value 417469.746811
+#> iter 70 value 417419.381273
+#> iter 80 value 417185.921416
+#> iter 90 value 417164.110491
+#> final value 417162.797666
#> converged
the_anim <- PlotVariantPrevalenceAnimated(usa_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in the USA by variant", caption = "**Source: gisaid.org and covid19nytimes**<br>")
#> `geom_line()`: Each group consists of only one observation.
diff --git a/docs/articles/VariantAnimation-USA_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VariantAnimation-USA_files/figure-html/unnamed-chunk-5-1.png
index 9ce39c3f..dc0209f6 100644
Binary files a/docs/articles/VariantAnimation-USA_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VariantAnimation-USA_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/VarinatAnimation-Kolkata.html b/docs/articles/VarinatAnimation-Kolkata.html
index ad27057e..0bb8bcb0 100644
--- a/docs/articles/VarinatAnimation-Kolkata.html
+++ b/docs/articles/VarinatAnimation-Kolkata.html
@@ -136,7 +136,7 @@
Get variants data for India
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
@@ -186,8 +186,8 @@ Top 10 cities with
city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq)
DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))
-
-
+
+
Get monthly cases for Kolkata
@@ -285,95 +285,38 @@ Project wee
gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist)
-## # weights: 32 (21 variable)
-## initial value 1750.889778
-## iter 10 value 626.748193
-## iter 20 value 536.254647
-## iter 30 value 530.811950
-## iter 40 value 509.760387
-## iter 50 value 500.801720
-## iter 60 value 494.314745
-## iter 70 value 485.956165
-## iter 80 value 476.450922
-## iter 90 value 471.247783
-## iter 100 value 469.841441
-## iter 110 value 468.964896
-## iter 120 value 468.741935
-## iter 130 value 467.011407
-## iter 140 value 466.767401
-## iter 150 value 466.296016
-## iter 160 value 466.142023
-## iter 170 value 465.389155
-## iter 180 value 465.274039
-## iter 190 value 465.081620
-## iter 200 value 465.036608
-## iter 210 value 464.923539
-## iter 220 value 464.564645
-## iter 230 value 464.271183
-## iter 240 value 464.232019
-## iter 250 value 464.192138
-## iter 260 value 463.990355
-## iter 270 value 463.820082
-## iter 280 value 463.786740
-## iter 290 value 463.755574
-## iter 300 value 463.568585
-## iter 310 value 463.553375
-## iter 320 value 463.495724
-## iter 330 value 463.409038
-## iter 340 value 463.361392
-## iter 350 value 463.338901
-## iter 360 value 463.311517
-## iter 370 value 463.236557
-## iter 380 value 463.193102
-## iter 390 value 463.139024
-## iter 400 value 463.088294
-## iter 410 value 463.034732
-## iter 420 value 462.975124
-## iter 430 value 462.937903
-## iter 440 value 462.904688
-## iter 450 value 462.886551
-## iter 460 value 462.828593
-## iter 470 value 462.755027
-## iter 480 value 462.738014
-## iter 490 value 462.653073
-## iter 500 value 462.598924
-## iter 510 value 462.584119
-## iter 520 value 462.496394
-## iter 530 value 462.409700
-## iter 540 value 462.398562
-## iter 550 value 462.356787
-## iter 560 value 462.244444
-## iter 570 value 462.228713
-## iter 580 value 462.135241
-## iter 590 value 462.092795
-## iter 600 value 462.080165
-## iter 610 value 462.061369
-## iter 620 value 462.053575
-## iter 630 value 462.013013
-## iter 640 value 461.920232
-## iter 650 value 461.903857
-## iter 660 value 461.871025
-## iter 670 value 461.803031
-## iter 680 value 461.776690
-## iter 690 value 461.761482
-## iter 700 value 461.756041
-## iter 710 value 461.742347
-## iter 720 value 461.716431
-## iter 730 value 461.662583
-## iter 740 value 461.625030
-## iter 750 value 461.582530
-## iter 760 value 461.535611
-## iter 770 value 461.509396
-## iter 780 value 461.499547
-## iter 790 value 461.488872
-## iter 800 value 461.471609
-## iter 810 value 461.431146
-## iter 820 value 461.381560
-## iter 830 value 461.369044
-## iter 840 value 461.323343
-## iter 850 value 461.283620
-## iter 860 value 461.263564
-## final value 461.263064
+## # weights: 52 (36 variable)
+## initial value 19798.844090
+## iter 10 value 11435.635166
+## iter 20 value 9057.108989
+## iter 30 value 8157.246773
+## iter 40 value 7975.159693
+## iter 50 value 7858.708901
+## iter 60 value 7668.444190
+## iter 70 value 7580.672625
+## iter 80 value 7528.451751
+## iter 90 value 7513.272444
+## iter 100 value 7474.103534
+## iter 110 value 7445.218172
+## iter 120 value 7436.097829
+## iter 130 value 7434.641300
+## iter 140 value 7427.176775
+## iter 150 value 7420.804551
+## iter 160 value 7420.661086
+## iter 170 value 7416.507209
+## iter 180 value 7414.348054
+## iter 190 value 7411.764260
+## iter 200 value 7407.259358
+## iter 210 value 7399.943830
+## iter 220 value 7385.067901
+## iter 230 value 7384.795201
+## iter 240 value 7383.401682
+## iter 250 value 7382.550291
+## iter 260 value 7382.092938
+## iter 270 value 7381.786055
+## iter 280 value 7381.431294
+## iter 290 value 7381.101862
+## final value 7380.868859
## converged
the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Kolkata (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**", date_breaks = "28 days")
@@ -416,57 +359,31 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 28 (18 variable)
-## initial value 883.443208
-## iter 10 value 335.108368
-## iter 20 value 324.838657
-## iter 30 value 322.253049
-## iter 40 value 318.432426
-## iter 50 value 317.060307
-## iter 60 value 316.879133
-## iter 70 value 316.296114
-## iter 80 value 316.020128
-## iter 90 value 315.819255
-## iter 100 value 315.748065
-## iter 110 value 315.695031
-## iter 120 value 315.681956
-## iter 130 value 315.634814
-## iter 140 value 315.538348
-## iter 150 value 315.441308
-## iter 160 value 315.350999
-## iter 170 value 315.301060
-## iter 180 value 315.268890
-## iter 190 value 315.142223
-## iter 200 value 315.085838
-## iter 210 value 315.063260
-## iter 220 value 315.050360
-## iter 230 value 315.048052
-## iter 240 value 315.037922
-## iter 250 value 315.021620
-## iter 260 value 314.992851
-## iter 270 value 314.974290
-## iter 280 value 314.958264
-## iter 290 value 314.953458
-## iter 300 value 314.947099
-## iter 310 value 314.942227
-## iter 320 value 314.937633
-## iter 330 value 314.915625
-## iter 340 value 314.887206
-## iter 350 value 314.868674
-## iter 360 value 314.864320
-## iter 370 value 314.856633
-## iter 380 value 314.850492
-## iter 390 value 314.847093
-## iter 400 value 314.844057
-## iter 410 value 314.824075
-## iter 420 value 314.807441
-## iter 430 value 314.802939
-## iter 440 value 314.800667
-## iter 450 value 314.791619
-## iter 460 value 314.787905
-## iter 470 value 314.780216
-## iter 480 value 314.775040
-## final value 314.774803
+## # weights: 40 (27 variable)
+## initial value 9583.359157
+## iter 10 value 5728.384893
+## iter 20 value 4972.850542
+## iter 30 value 4897.274384
+## iter 40 value 4863.449275
+## iter 50 value 4846.053188
+## iter 60 value 4843.406679
+## iter 70 value 4842.740416
+## iter 80 value 4834.636500
+## iter 90 value 4833.226017
+## iter 100 value 4832.262214
+## iter 110 value 4831.508361
+## iter 120 value 4831.250002
+## iter 130 value 4831.025131
+## iter 140 value 4830.942138
+## iter 150 value 4830.802627
+## iter 160 value 4830.678303
+## iter 170 value 4830.004841
+## iter 180 value 4829.978702
+## iter 190 value 4829.841942
+## iter 200 value 4829.711621
+## iter 210 value 4829.608746
+## iter 220 value 4829.532697
+## final value 4829.520347
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Kolkata (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
@@ -514,57 +431,31 @@ Project wee
gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep)
cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long)
-## # weights: 28 (18 variable)
-## initial value 883.443208
-## iter 10 value 335.108368
-## iter 20 value 324.838657
-## iter 30 value 322.253049
-## iter 40 value 318.432426
-## iter 50 value 317.060307
-## iter 60 value 316.879133
-## iter 70 value 316.296114
-## iter 80 value 316.020128
-## iter 90 value 315.819255
-## iter 100 value 315.748065
-## iter 110 value 315.695031
-## iter 120 value 315.681956
-## iter 130 value 315.634814
-## iter 140 value 315.538348
-## iter 150 value 315.441308
-## iter 160 value 315.350999
-## iter 170 value 315.301060
-## iter 180 value 315.268890
-## iter 190 value 315.142223
-## iter 200 value 315.085838
-## iter 210 value 315.063260
-## iter 220 value 315.050360
-## iter 230 value 315.048052
-## iter 240 value 315.037922
-## iter 250 value 315.021620
-## iter 260 value 314.992851
-## iter 270 value 314.974290
-## iter 280 value 314.958264
-## iter 290 value 314.953458
-## iter 300 value 314.947099
-## iter 310 value 314.942227
-## iter 320 value 314.937633
-## iter 330 value 314.915625
-## iter 340 value 314.887206
-## iter 350 value 314.868674
-## iter 360 value 314.864320
-## iter 370 value 314.856633
-## iter 380 value 314.850492
-## iter 390 value 314.847093
-## iter 400 value 314.844057
-## iter 410 value 314.824075
-## iter 420 value 314.807441
-## iter 430 value 314.802939
-## iter 440 value 314.800667
-## iter 450 value 314.791619
-## iter 460 value 314.787905
-## iter 470 value 314.780216
-## iter 480 value 314.775040
-## final value 314.774803
+## # weights: 40 (27 variable)
+## initial value 9583.359157
+## iter 10 value 5728.384893
+## iter 20 value 4972.850542
+## iter 30 value 4897.274384
+## iter 40 value 4863.449275
+## iter 50 value 4846.053188
+## iter 60 value 4843.406679
+## iter 70 value 4842.740416
+## iter 80 value 4834.636500
+## iter 90 value 4833.226017
+## iter 100 value 4832.262214
+## iter 110 value 4831.508361
+## iter 120 value 4831.250002
+## iter 130 value 4831.025131
+## iter 140 value 4830.942138
+## iter 150 value 4830.802627
+## iter 160 value 4830.678303
+## iter 170 value 4830.004841
+## iter 180 value 4829.978702
+## iter 190 value 4829.841942
+## iter 200 value 4829.711621
+## iter 210 value 4829.608746
+## iter 220 value 4829.532697
+## final value 4829.520347
## converged
the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = "Estimated cases (weekly average) in Kolkata (India) by variant", caption = "**Source: gisaid.org and covid19bharat.org**<br>")
diff --git a/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-5-1.png
index a60936b3..93ea6c3e 100644
Binary files a/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-6-1.png
index 60146c24..76f2a355 100644
Binary files a/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-7-1.png
index 3b0e8e6c..caa00f68 100644
Binary files a/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-8-1.png
index 57013595..ac7be485 100644
Binary files a/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/VarinatAnimation-Kolkata_files/figure-html/unnamed-chunk-8-1.png differ
diff --git a/docs/articles/index.html b/docs/articles/index.html
index 86dc1543..e984a43d 100644
--- a/docs/articles/index.html
+++ b/docs/articles/index.html
@@ -97,18 +97,6 @@ All vignettes
- Introduction to covmuller
- -
-
- Multinomial modeling - Germany
- -
-
- Multinomial modeling - Australia
- -
-
- Multinomial modeling - Canada
- -
-
- Multinomial modeling - India
- -
-
- Multinomial modeling - South Africa
- -
-
- Multinomial modeling - United Kingdom
-
- Animation of projected weekly cases - Bengaluru (India)
-
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 50620a86..7df84506 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -1,14 +1,8 @@
-pandoc: 3.1.1
+pandoc: 3.1.11.1
pkgdown: 2.0.7
pkgdown_sha: ~
articles:
Introduction: Introduction.html
- MultinomialModeling-Germany: MultinomialModeling-Germany.html
- MultinomialModeling_Australia: MultinomialModeling_Australia.html
- MultinomialModeling_Canada: MultinomialModeling_Canada.html
- MultinomialModeling_India: MultinomialModeling_India.html
- MultinomialModeling_SouthAfrica: MultinomialModeling_SouthAfrica.html
- MultinomialModeling_UK: MultinomialModeling_UK.html
VariantAnimation-Bengaluru: VariantAnimation-Bengaluru.html
VariantAnimation-Chennai: VariantAnimation-Chennai.html
VariantAnimation-Delhi: VariantAnimation-Delhi.html
@@ -28,7 +22,7 @@ articles:
VariantAnimation-UK: VariantAnimation-UK.html
VariantAnimation-USA: VariantAnimation-USA.html
VarinatAnimation-Kolkata: VarinatAnimation-Kolkata.html
-last_built: 2024-01-09T12:39Z
+last_built: 2024-01-11T20:00Z
urls:
reference: http://saket-choudhary.me/covmuller/reference
article: http://saket-choudhary.me/covmuller/articles
diff --git a/docs/search.json b/docs/search.json
index 6c5fa4de..71dea9d3 100644
--- a/docs/search.json
+++ b/docs/search.json
@@ -1 +1 @@
-[{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"get-cases-data","dir":"Articles","previous_headings":"","what":"Get cases data","title":"Introduction to covmuller","text":"use covid19bharat.org get tally daily confirmed cases summarize monthly level.","code":"indian_state_cases <- GetIndiaConfirmedCasesMonthlyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. india_cases <- indian_state_cases %>% filter(State == \"India\") %>% filter(value > 1) head(india_cases) ## MonthYear State value type ## 1 Mar 2020 India 1635 Confirmed ## 2 Apr 2020 India 33232 Confirmed ## 3 May 2020 India 155781 Confirmed ## 4 Jun 2020 India 395044 Confirmed ## 5 Jul 2020 India 1111273 Confirmed ## 6 Aug 2020 India 1990350 Confirmed"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"plot-cases-for-india","dir":"Articles","previous_headings":"Get cases data","what":"Plot cases for India","title":"Introduction to covmuller","text":"easy visualize monthly case counts bar plot:","code":"p1 <- BarPlot(india_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - India\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"read-variant-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Read variant data from GISAID","title":"Introduction to covmuller","text":"utilize GISAID data look prevalence variants. access data, GISAID requires registration.","code":"current_date <- \"2024_01_08\" fpath.tar <- paste0(\"~/data/epicov/metadata_tsv_\", current_date, \".tar.xz\") fpath.qs <- paste0(\"~/data/epicov/metadata_tsv_\", current_date, \".qs\") if (file.exists(fpath.qs)) { gisaid_metadata <- qs::qread(file = fpath.qs) } else { gisaid_metadata <- ReadGISAIDMetada(path = fpath.tar) qs::qsave(gisaid_metadata, fpath.qs) } ## Warning in untar(path, files = fname, exdir = td): '/bin/tar -xf ## '/home/saket/data/epicov/metadata_tsv_2024_01_08.tar.xz' -C '/tmp/RtmpxJPxAN' ## 'metadata.tsv'' returned error code 2 ## Avoidable 2.776 seconds. This file is very unusual: it ends abruptly without a final newline, and also its size is a multiple of 4096 bytes. Please properly end the last row with a newline using for example 'echo >> file' to avoid this time to copy. ## Warning in fread(input = path, showProgress = showProgress, ...): Discarded ## single-line footer: <>"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"Read variant data from GISAID","what":"Plot total sequenced cases","title":"Introduction to covmuller","text":"can look absolute number cases sequenced country filtering information metadata made available GISAID (includes countries). , visualize total sequenced cases coming India:","code":"gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india, rename_country_as_state = TRUE) p2 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from India\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"overall-how-much-has-india-sequenced-over-months","dir":"Articles","previous_headings":"Read variant data from GISAID","what":"Overall, how much has India sequenced over months?","title":"Introduction to covmuller","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic: context, can combine three plots :","code":"#india_cases_long <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == \"India\") GetIndiaCases <- function(){ data <- read.csv(\"https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/cases_deaths/new_cases.csv\") confirmed <- data %>% select(date, India) colnames(confirmed)[2] <- c(\"cases\") confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_weekwise <- confirmed %>% group_by(MonthYear) %>% summarise(value = sum(cases, na.rm=T)) %>% arrange(MonthYear) } india_cases_long <- GetIndiaCases() india_cases_long$State <- \"India\" india_cases_long$type <- \"Confirmed\" india_sequencing_proportion <- CombineSequencedCases( cases_sequenced = country_seq_stats, confirmed_long = india_cases_long ) p3 <- BarPlot(india_sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from India\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"plot-proportion-of-cases-that-been-deposited-from-each-state","dir":"Articles","previous_headings":"Read variant data from GISAID","what":"Plot proportion of cases that been deposited from each state","title":"Introduction to covmuller","text":"can break proportion sequenced cases state level:","code":"state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_india, drop_country = TRUE) seq_stats <- rbind(country_seq_stats, state_seq_stats) state_cases_long <- GetIndiaConfirmedCasesMonthlyLong() india_sequencing_proportion <- CombineSequencedCases( cases_sequenced = seq_stats, confirmed_long = state_cases_long, month.min = \"Jan 2022\", month.max = \"Feb 2023\", max.percent = 5 ) india_sequencing_proportion$State <- factor( x = india_sequencing_proportion$State, levels = as.character(GetIndianStates()) ) p4 <- PlotSequencedPropHeatmap(india_sequencing_proportion) # p4"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"plot-prevalence","dir":"Articles","previous_headings":"","what":"Plot Prevalence","title":"Introduction to covmuller","text":"Finally, look prevalence variants variants concern (VOCs): animated version prevalence plot, check VariantAnimation.","code":"india_month_counts <- SummarizeVariantsMonthwise(gisaid_india) india_month_counts$State <- \"India\" india_month_prevalence <- CountsToPrevalence(india_month_counts) vocs <- GetVOCs() custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GE.1` = \"GE.1\", `GE.1.*` = \"GE.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) india_month_prevalence <- CollapseLineageToVOCs( variant_df = india_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(india_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling-Germany.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - Germany","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_germany, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"Germany\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling-Germany.html","id":"plot-stateswise-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot stateswise sequenced cases","title":"Multinomial modeling - Germany","text":"","code":"state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_germany) state_seq_stats_summary <- state_seq_stats %>% group_by(State) %>% summarise(value = sum(value)) p1 <- BarPlot(state_seq_stats_summary, xaxis = \"State\", ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"Germany\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling-Germany.html","id":"get-vocs","dir":"Articles","previous_headings":"Plot stateswise sequenced cases","what":"Get VOCs","title":"Multinomial modeling - Germany","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_germany_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_germany, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_germany_collapsed_sel <- gisaid_germany_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") %>% filter(lineage_collapsed != \"Unassigned\") %>% filter(State != \"Unknown\") vocs_to_keep <- table(gisaid_germany_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 50] gisaid_germany_collapsed_sel <- gisaid_germany_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_germany_shared_dateweek <- SummarizeVariantsDatewise(gisaid_germany_collapsed_sel, by_state = TRUE) head(gisaid_germany_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 Baden-Wurttemberg 19268 BA.5 1 ## 2 Baden-Wurttemberg 19270 BA.5 1 ## 3 Baden-Wurttemberg 19276 Others 1 ## 4 Baden-Wurttemberg 19278 BA.5 2 ## 5 Baden-Wurttemberg 19279 BA.2.75 1 ## 6 Baden-Wurttemberg 19279 BA.4 1 fit_germany_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_germany_shared_dateweek) ## # weights: 147 (120 variable) ## initial value 84514.769594 ## iter 10 value 58871.333180 ## iter 20 value 55522.530928 ## iter 30 value 50503.510775 ## iter 40 value 47871.511519 ## iter 50 value 47299.292070 ## iter 60 value 46963.614174 ## iter 70 value 46668.970432 ## iter 80 value 46535.784282 ## iter 90 value 46498.287724 ## iter 100 value 46485.928726 ## iter 110 value 46484.524254 ## iter 120 value 46484.171431 ## iter 130 value 46484.026750 ## final value 46483.999949 ## converged head(fit_germany_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State prob ## 1 BA.2 19268 Baden-Wurttemberg 0.002395273 ## 2 BA.2.75 19268 Baden-Wurttemberg 0.001983825 ## 3 BA.4 19268 Baden-Wurttemberg 0.010924456 ## 4 BA.5 19268 Baden-Wurttemberg 0.561990359 ## 5 BQ.1+ 19268 Baden-Wurttemberg 0.098423301 ## 6 Others 19268 Baden-Wurttemberg 0.324110466 ## SE df asymp.LCL asymp.UCL DateCollected ## 1 0.001243669 NA -4.227349e-05 0.004832819 2022-10-03 ## 2 0.001397073 NA -7.543881e-04 0.004722038 2022-10-03 ## 3 0.006465575 NA -1.747839e-03 0.023596750 2022-10-03 ## 4 0.029268277 NA 5.046256e-01 0.619355127 2022-10-03 ## 5 0.010256478 NA 7.832097e-02 0.118525630 2022-10-03 ## 6 0.023882935 NA 2.773008e-01 0.370920159 2022-10-03"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling-Germany.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - Germany","text":"","code":"muller_germanybystate_mfit <- PlotMullerDailyPrevalence(fit_germany_multi_predsbystate, ncol = 3) muller_germanybystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Australia.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - Australia","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_australia, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"Australia\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Australia.html","id":"get-vocs","dir":"Articles","previous_headings":"","what":"Get VOCs","title":"Multinomial modeling - Australia","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_australia_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_australia, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_australia_collapsed_sel <- gisaid_australia_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") %>% filter(lineage_collapsed != \"Unassigned\") vocs_to_keep <- table(gisaid_australia_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100] gisaid_australia_collapsed_sel <- gisaid_australia_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_australia_shared_dateweek <- SummarizeVariantsDatewise(gisaid_australia_collapsed_sel, by_state = TRUE) head(gisaid_australia_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 Australian Capital Territory 19266 BA.4 1 ## 2 Australian Capital Territory 19266 BA.5 1 ## 3 Australian Capital Territory 19268 BA.5 3 ## 4 Australian Capital Territory 19269 BA.5 5 ## 5 Australian Capital Territory 19269 Others 2 ## 6 Australian Capital Territory 19270 BA.5 6 fit_australia_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_australia_shared_dateweek) ## # weights: 77 (60 variable) ## initial value 81868.331791 ## iter 10 value 44070.203776 ## iter 20 value 41147.140310 ## iter 30 value 37628.202667 ## iter 40 value 35644.341491 ## iter 50 value 34806.030962 ## iter 60 value 34524.606747 ## iter 70 value 34495.422733 ## iter 80 value 34488.423228 ## iter 90 value 34487.026907 ## iter 100 value 34486.832770 ## iter 110 value 34486.808519 ## final value 34486.800097 ## converged head(fit_australia_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State ## 1 BA.2 19266 Australian Capital Territory ## 2 BA.2.75 19266 Australian Capital Territory ## 3 BA.4 19266 Australian Capital Territory ## 4 BA.5 19266 Australian Capital Territory ## 5 BQ.1+ 19266 Australian Capital Territory ## 6 Others 19266 Australian Capital Territory ## prob SE df asymp.LCL asymp.UCL DateCollected ## 1 0.01287056 0.004330736 NA 0.004382473 0.02135865 2022-10-01 ## 2 0.02820800 0.007365799 NA 0.013771296 0.04264470 2022-10-01 ## 3 0.06585284 0.013198964 NA 0.039983347 0.09172233 2022-10-01 ## 4 0.67639409 0.020085207 NA 0.637027807 0.71576037 2022-10-01 ## 5 0.03872073 0.004079806 NA 0.030724455 0.04671700 2022-10-01 ## 6 0.17760819 0.012103338 NA 0.153886085 0.20133030 2022-10-01"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Australia.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - Australia","text":"","code":"muller_australiabystate_mfit <- PlotMullerDailyPrevalence(fit_australia_multi_predsbystate, ncol = 3) muller_australiabystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Canada.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - Canada","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_canada, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"Canada\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Canada.html","id":"get-vocs","dir":"Articles","previous_headings":"","what":"Get VOCs","title":"Multinomial modeling - Canada","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_canada_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_canada, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_canada_collapsed_sel <- gisaid_canada_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") vocs_to_keep <- table(gisaid_canada_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100] gisaid_canada_collapsed_sel <- gisaid_canada_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_canada_shared_dateweek <- SummarizeVariantsDatewise(gisaid_canada_collapsed_sel, by_state = TRUE) head(gisaid_canada_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 Alberta 19270 BA.5 1 ## 2 Alberta 19287 BA.5 1 ## 3 Alberta 19288 BA.5 1 ## 4 Alberta 19288 BQ.1+ 1 ## 5 Alberta 19289 BA.5 4 ## 6 Alberta 19289 BQ.1+ 1 fit_canada_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_canada_shared_dateweek) ## # weights: 78 (60 variable) ## initial value 187840.895716 ## iter 10 value 110689.126358 ## iter 20 value 108427.020931 ## iter 30 value 97154.791951 ## iter 40 value 92547.846240 ## iter 50 value 90348.395369 ## iter 60 value 87691.764293 ## iter 70 value 86673.506577 ## iter 80 value 86654.378224 ## iter 90 value 86644.678472 ## iter 100 value 86643.817674 ## iter 110 value 86643.284694 ## iter 120 value 86642.851219 ## final value 86642.812520 ## converged head(fit_canada_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State prob SE df ## 1 BA.2.75 19267 Alberta 0.0831165146 2.476606e-02 NA ## 2 BA.4 19267 Alberta 0.0751094919 9.840250e-03 NA ## 3 BA.5 19267 Alberta 0.6992750081 2.212831e-02 NA ## 4 BQ.1+ 19267 Alberta 0.0812395411 4.443272e-03 NA ## 5 Others 19267 Alberta 0.0608317700 3.659269e-03 NA ## 6 XBB 19267 Alberta 0.0004276743 3.649025e-05 NA ## asymp.LCL asymp.UCL DateCollected ## 1 0.0345759243 0.1316571050 2022-10-02 ## 2 0.0558229555 0.0943960282 2022-10-02 ## 3 0.6559043089 0.7426457072 2022-10-02 ## 4 0.0725308871 0.0899481950 2022-10-02 ## 5 0.0536597344 0.0680038056 2022-10-02 ## 6 0.0003561548 0.0004991939 2022-10-02"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Canada.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - Canada","text":"","code":"muller_canadabystate_mfit <- PlotMullerDailyPrevalence(fit_canada_multi_predsbystate, ncol = 3) muller_canadabystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_India.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - India","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"India\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_India.html","id":"plot-stateswise-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot stateswise sequenced cases","title":"Multinomial modeling - India","text":"","code":"state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_india) state_seq_stats_summary <- state_seq_stats %>% group_by(State) %>% summarise(value = sum(value)) state_seq_stats_summary$State[state_seq_stats_summary$State == \"Dadra and Nagar Haveli and Daman and Diu\"] <- \"Dadra/N Haveli/Daman/Diu\" p1 <- BarPlot(state_seq_stats_summary, xaxis = \"State\", ylabel = \"Total sequences deposited\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"India\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_India.html","id":"get-vocs","dir":"Articles","previous_headings":"Plot stateswise sequenced cases","what":"Get VOCs","title":"Multinomial modeling - India","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_india_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_india_collapsed_sel <- gisaid_india_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") %>% filter(lineage_collapsed != \"Unassigned\") vocs_to_keep <- table(gisaid_india_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100] gisaid_india_collapsed_sel <- gisaid_india_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_india_shared_dateweek <- SummarizeVariantsDatewise(gisaid_india_collapsed_sel, by_state = TRUE) head(gisaid_india_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 Andhra Pradesh 19448 XBB 1 ## 2 Andhra Pradesh 19506 XBB 1 ## 3 Arunachal Pradesh 19361 XBB 1 ## 4 Arunachal Pradesh 19459 XBB 1 ## 5 Arunachal Pradesh 19556 XBB 1 ## 6 Arunachal Pradesh 19611 Others 1 fit_india_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_india_shared_dateweek) ## # weights: 198 (160 variable) ## initial value 26340.655957 ## iter 10 value 7641.516301 ## iter 20 value 7284.387483 ## iter 30 value 7116.916285 ## iter 40 value 7079.898273 ## iter 50 value 7033.898212 ## iter 60 value 7018.370193 ## iter 70 value 7013.256620 ## iter 80 value 7011.737212 ## iter 90 value 7011.685431 ## iter 100 value 7011.622831 ## final value 7011.619902 ## converged head(fit_india_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State prob ## 1 BA.2 19266 Andhra Pradesh 2.551402e-07 ## 2 BA.2.75 19266 Andhra Pradesh 7.077352e-08 ## 3 BA.2.X 19266 Andhra Pradesh 7.491817e-10 ## 4 BQ.1+ 19266 Andhra Pradesh 2.638376e-09 ## 5 Others 19266 Andhra Pradesh 1.629735e-06 ## 6 XBB 19266 Andhra Pradesh 9.999980e-01 ## SE df asymp.LCL asymp.UCL DateCollected ## 1 1.057238e-07 NA 4.792538e-08 4.623551e-07 2022-10-01 ## 2 1.681864e-08 NA 3.780959e-08 1.037374e-07 2022-10-01 ## 3 3.215486e-10 NA 1.189581e-10 1.379405e-09 2022-10-01 ## 4 2.641967e-08 NA -4.914322e-08 5.441998e-08 2022-10-01 ## 5 2.019993e-07 NA 1.233824e-06 2.025647e-06 2022-10-01 ## 6 2.373022e-07 NA 9.999976e-01 9.999985e-01 2022-10-01"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_India.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - India","text":"","code":"muller_indiabystate_mfit <- PlotMullerDailyPrevalence(fit_india_multi_predsbystate) muller_indiabystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_SouthAfrica.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - South Africa","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_southafrica, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"South Africa\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_SouthAfrica.html","id":"plot-stateswise-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot stateswise sequenced cases","title":"Multinomial modeling - South Africa","text":"","code":"state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_southafrica) state_seq_stats_summary <- state_seq_stats %>% group_by(State) %>% summarise(value = sum(value)) p1 <- BarPlot(state_seq_stats_summary, xaxis = \"State\", ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"South Africa\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_SouthAfrica.html","id":"get-vocs","dir":"Articles","previous_headings":"Plot stateswise sequenced cases","what":"Get VOCs","title":"Multinomial modeling - South Africa","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_southafrica_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_southafrica, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_southafrica_collapsed_sel <- gisaid_southafrica_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") %>% filter(lineage_collapsed != \"Unassigned\") %>% filter(State != \"Unknown\") vocs_to_keep <- table(gisaid_southafrica_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 50] gisaid_southafrica_collapsed_sel <- gisaid_southafrica_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_southafrica_shared_dateweek <- SummarizeVariantsDatewise(gisaid_southafrica_collapsed_sel, by_state = TRUE) head(gisaid_southafrica_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 Eastern Cape 19340 BQ.1+ 1 ## 2 Eastern Cape 19366 BA.5 1 ## 3 Eastern Cape 19366 BQ.1+ 1 ## 4 Eastern Cape 19367 BA.5 2 ## 5 Eastern Cape 19367 BQ.1+ 1 ## 6 Eastern Cape 19367 Others 1 fit_southafrica_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_southafrica_shared_dateweek) ## # weights: 48 (33 variable) ## initial value 6332.592642 ## iter 10 value 4506.511198 ## iter 20 value 3774.308144 ## iter 30 value 3687.379840 ## iter 40 value 3674.078156 ## final value 3673.923064 ## converged head(fit_southafrica_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State prob SE ## 1 BA.5 19269 Eastern Cape 0.7749025935 6.623080e-02 ## 2 BQ.1+ 19269 Eastern Cape 0.0033670249 1.433762e-03 ## 3 Others 19269 Eastern Cape 0.2215801968 6.561908e-02 ## 4 XBB 19269 Eastern Cape 0.0001501848 7.306782e-05 ## 5 BA.5 19276 Eastern Cape 0.7560557338 6.532893e-02 ## 6 BQ.1+ 19276 Eastern Cape 0.0054931242 2.150660e-03 ## df asymp.LCL asymp.UCL DateCollected ## 1 NA 6.450926e-01 0.9047125748 2022-10-04 ## 2 NA 5.569034e-04 0.0061771465 2022-10-04 ## 3 NA 9.296916e-02 0.3501912359 2022-10-04 ## 4 NA 6.974489e-06 0.0002933951 2022-10-04 ## 5 NA 6.280134e-01 0.8840980854 2022-10-11 ## 6 NA 1.277908e-03 0.0097083406 2022-10-11"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_SouthAfrica.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - South Africa","text":"","code":"muller_southafricabystate_mfit <- PlotMullerDailyPrevalence(fit_southafrica_multi_predsbystate, ncol = 3) muller_southafricabystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_UK.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - United Kingdom","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_uk, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"United Kingdom\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_UK.html","id":"get-vocs","dir":"Articles","previous_headings":"","what":"Get VOCs","title":"Multinomial modeling - United Kingdom","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_uk_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_uk, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_uk_collapsed_sel <- gisaid_uk_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") %>% filter(lineage_collapsed != \"Unassigned\") vocs_to_keep <- table(gisaid_uk_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100] gisaid_uk_collapsed_sel <- gisaid_uk_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_uk_shared_dateweek <- SummarizeVariantsDatewise(gisaid_uk_collapsed_sel, by_state = TRUE) head(gisaid_uk_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 England 19266 BA.2.75 1 ## 2 England 19266 BA.5 1 ## 3 England 19266 Others 2 ## 4 England 19267 BA.4 2 ## 5 England 19267 BA.5 3 ## 6 England 19267 Others 3 fit_uk_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_uk_shared_dateweek) ## # weights: 42 (30 variable) ## initial value 212260.785522 ## iter 10 value 132682.285811 ## iter 20 value 124684.559590 ## iter 30 value 114429.990736 ## iter 40 value 111295.757402 ## iter 50 value 110969.952275 ## iter 60 value 110927.717094 ## iter 70 value 110926.524749 ## iter 80 value 110926.239561 ## iter 90 value 110924.251868 ## iter 100 value 110922.200728 ## final value 110922.032284 ## converged head(fit_uk_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State prob SE df ## 1 BA.2.75 19266 England 0.0327501455 8.594579e-03 NA ## 2 BA.4 19266 England 0.0497328609 9.222749e-03 NA ## 3 BA.5 19266 England 0.6155197047 1.628229e-02 NA ## 4 BQ.1+ 19266 England 0.1886427943 9.305751e-03 NA ## 5 Others 19266 England 0.1124983741 5.583855e-03 NA ## 6 XBB 19266 England 0.0008561205 5.794389e-05 NA ## asymp.LCL asymp.UCL DateCollected ## 1 0.0159050796 0.0495952114 2022-10-01 ## 2 0.0316566054 0.0678091164 2022-10-01 ## 3 0.5836070074 0.6474324020 2022-10-01 ## 4 0.1704038582 0.2068817303 2022-10-01 ## 5 0.1015542204 0.1234425279 2022-10-01 ## 6 0.0007425525 0.0009696884 2022-10-01"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_UK.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - United Kingdom","text":"","code":"muller_ukbystate_mfit <- PlotMullerDailyPrevalence(fit_uk_multi_predsbystate, ncol = 3) muller_ukbystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Bengaluru (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Bengaluru (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"get-monthly-cases-for-bengaluru","dir":"Articles","previous_headings":"","what":"Get monthly cases for Bengaluru","title":"Animation of projected weekly cases - Bengaluru (India)","text":"","code":"Bengaluru_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District %in% c(\"Bengaluru Urban\", \"Bengaluru Rural\")) ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Bengaluru_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [3] ## MonthYear State District value ## ## 1 Apr 2020 Karnataka Bengaluru Rural 6 ## 2 Apr 2020 Karnataka Bengaluru Urban 141 ## 3 May 2020 Karnataka Bengaluru Rural 9 ## 4 May 2020 Karnataka Bengaluru Urban 218 ## 5 Jun 2020 Karnataka Bengaluru Rural 114 ## 6 Jun 2020 Karnataka Bengaluru Urban 4196"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"plot-monthly-cases-for-bengaluru","dir":"Articles","previous_headings":"Get monthly cases for Bengaluru","what":"Plot monthly cases for Bengaluru","title":"Animation of projected weekly cases - Bengaluru (India)","text":"","code":"p1 <- BarPlot(Bengaluru_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Bengaluru (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"get-weekly-cases-for-bengaluru","dir":"Articles","previous_headings":"","what":"Get weekly cases for Bengaluru","title":"Animation of projected weekly cases - Bengaluru (India)","text":"","code":"Bengaluru_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Bengaluru\"), rename_country_as_state = TRUE) p2 <- BarPlot(Bengaluru_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Bengaluru (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"overall-how-much-has-bengaluru-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Bengaluru","what":"Overall, how much has Bengaluru sequenced over months?","title":"Animation of projected weekly cases - Bengaluru (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Bengaluru_monthly_cases_tmp <- Bengaluru_monthly_cases %>% select(MonthYear, value) Bengaluru_monthly_cases_tmp$State <- \"India\" Bengaluru_monthly_cases_tmp$type <- \"Confirmed\" Bengaluru_monthly_cases_tmp <- Bengaluru_monthly_cases_tmp %>% group_by(MonthYear, State, type) %>% summarise(value = sum(value)) Bengaluru_monthly_cases_tmp <- Bengaluru_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Bengaluru_seq_stats, confirmed_long = Bengaluru_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Bengaluru (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Bengaluru (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Bengaluru\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Bengaluru Urban\", \"Bengaluru Rural\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 32 (21 variable) ## initial value 3312.550376 ## iter 10 value 773.526257 ## iter 20 value 627.851276 ## iter 30 value 617.623075 ## iter 40 value 609.591180 ## iter 50 value 609.169344 ## iter 60 value 608.472630 ## iter 70 value 602.212579 ## iter 80 value 600.276723 ## iter 90 value 598.014887 ## iter 100 value 597.423158 ## iter 110 value 595.638437 ## iter 120 value 594.100586 ## iter 130 value 593.056069 ## iter 140 value 592.812040 ## iter 150 value 592.259715 ## iter 160 value 592.032754 ## iter 170 value 591.577392 ## iter 180 value 590.747093 ## iter 190 value 590.560249 ## iter 200 value 590.223478 ## iter 210 value 589.985700 ## iter 220 value 589.533072 ## iter 230 value 589.496482 ## iter 240 value 589.334164 ## iter 250 value 589.161166 ## iter 260 value 588.992847 ## iter 270 value 588.975716 ## iter 280 value 588.954196 ## iter 290 value 588.717361 ## iter 300 value 587.293388 ## iter 310 value 587.264117 ## iter 320 value 586.819917 ## iter 330 value 586.741879 ## iter 340 value 586.677068 ## iter 350 value 586.600040 ## iter 360 value 586.596292 ## iter 370 value 586.586127 ## iter 380 value 586.568356 ## iter 390 value 586.384346 ## iter 400 value 586.351792 ## iter 410 value 586.261639 ## iter 420 value 586.242483 ## iter 430 value 586.216603 ## iter 440 value 586.210381 ## iter 450 value 586.205314 ## iter 460 value 586.200564 ## iter 470 value 586.169054 ## iter 480 value 586.165167 ## iter 490 value 586.161566 ## iter 500 value 586.143238 ## iter 510 value 586.133024 ## iter 520 value 586.120649 ## iter 530 value 586.118065 ## iter 540 value 586.110238 ## iter 550 value 586.107076 ## iter 560 value 586.073191 ## iter 570 value 586.071515 ## iter 580 value 586.054136 ## iter 590 value 586.049598 ## iter 600 value 586.043825 ## iter 610 value 586.029238 ## iter 620 value 586.023768 ## iter 630 value 586.015749 ## iter 640 value 586.003773 ## iter 650 value 586.000547 ## iter 660 value 585.999038 ## iter 670 value 585.986995 ## iter 680 value 585.984374 ## iter 690 value 585.975055 ## iter 700 value 585.973831 ## iter 710 value 585.969559 ## iter 720 value 585.965204 ## iter 730 value 585.951227 ## iter 740 value 585.949015 ## iter 750 value 585.945802 ## iter 760 value 585.937485 ## iter 770 value 585.929229 ## iter 780 value 585.917009 ## iter 790 value 585.914528 ## iter 800 value 585.911814 ## iter 810 value 585.884459 ## iter 820 value 585.708546 ## iter 830 value 585.568783 ## iter 840 value 585.557953 ## iter 850 value 585.546461 ## iter 860 value 585.537657 ## iter 870 value 585.517154 ## iter 880 value 585.509741 ## iter 890 value 585.498883 ## iter 900 value 585.492619 ## final value 585.488230 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Bengaluru (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Bengaluru_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Bengaluru Urban\", \"Bengaluru Rural\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Bengaluru\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 32 (21 variable) ## initial value 921.192603 ## iter 10 value 637.332915 ## iter 20 value 606.587631 ## iter 30 value 599.596613 ## iter 40 value 593.194865 ## iter 50 value 590.495369 ## iter 60 value 588.943258 ## iter 70 value 588.195117 ## iter 80 value 587.986667 ## iter 90 value 587.707232 ## iter 100 value 587.568833 ## iter 110 value 587.451504 ## iter 120 value 586.892208 ## iter 130 value 586.088265 ## iter 140 value 585.821760 ## iter 150 value 585.700048 ## iter 160 value 585.671991 ## iter 170 value 585.612740 ## iter 180 value 585.584925 ## iter 190 value 585.535420 ## iter 200 value 585.523463 ## iter 210 value 585.490528 ## iter 220 value 585.397931 ## iter 230 value 585.333381 ## iter 240 value 585.317947 ## iter 250 value 585.307050 ## iter 260 value 585.244933 ## iter 270 value 585.226067 ## iter 280 value 585.202597 ## iter 290 value 585.195030 ## iter 300 value 585.180452 ## iter 310 value 585.142082 ## iter 320 value 585.129631 ## iter 330 value 585.121452 ## iter 340 value 585.105555 ## iter 350 value 585.066093 ## iter 360 value 585.040772 ## iter 370 value 585.027635 ## iter 380 value 585.011006 ## iter 390 value 584.959059 ## iter 400 value 584.933911 ## iter 410 value 584.907723 ## iter 420 value 584.902269 ## iter 430 value 584.891214 ## final value 584.885007 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Bengaluru (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Bengaluru_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Bengaluru Urban\", \"Bengaluru Rural\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Bengaluru\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 32 (21 variable) ## initial value 921.192603 ## iter 10 value 637.332915 ## iter 20 value 606.587631 ## iter 30 value 599.596613 ## iter 40 value 593.194865 ## iter 50 value 590.495369 ## iter 60 value 588.943258 ## iter 70 value 588.195117 ## iter 80 value 587.986667 ## iter 90 value 587.707232 ## iter 100 value 587.568833 ## iter 110 value 587.451504 ## iter 120 value 586.892208 ## iter 130 value 586.088265 ## iter 140 value 585.821760 ## iter 150 value 585.700048 ## iter 160 value 585.671991 ## iter 170 value 585.612740 ## iter 180 value 585.584925 ## iter 190 value 585.535420 ## iter 200 value 585.523463 ## iter 210 value 585.490528 ## iter 220 value 585.397931 ## iter 230 value 585.333381 ## iter 240 value 585.317947 ## iter 250 value 585.307050 ## iter 260 value 585.244933 ## iter 270 value 585.226067 ## iter 280 value 585.202597 ## iter 290 value 585.195030 ## iter 300 value 585.180452 ## iter 310 value 585.142082 ## iter 320 value 585.129631 ## iter 330 value 585.121452 ## iter 340 value 585.105555 ## iter 350 value 585.066093 ## iter 360 value 585.040772 ## iter 370 value 585.027635 ## iter 380 value 585.011006 ## iter 390 value 584.959059 ## iter 400 value 584.933911 ## iter 410 value 584.907723 ## iter 420 value 584.902269 ## iter 430 value 584.891214 ## final value 584.885007 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Bengaluru (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Bengaluru_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- \"Unknown\" gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"state-of-origin-of-ba4ba-5-sequences","dir":"Articles","previous_headings":"","what":"State of origin of BA/4/BA.5 sequences?","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"gisaid_india %>% filter(pangolin_lineage %in% c(\"BA.4\", \"BA.5\")) %>% pull(State) %>% table() %>% as.data.frame() %>% arrange(desc(Freq)) %>% DT::datatable()"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"city-of-origin-of-ba-4ba-5-sequences","dir":"Articles","previous_headings":"","what":"City of origin of BA.4/BA.5 sequences?","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"gisaid_india %>% filter(pangolin_lineage %in% c(\"BA.4\", \"BA.5\")) %>% pull(custom_city) %>% table() %>% as.data.frame() %>% arrange(desc(Freq)) %>% DT::datatable()"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"get-monthly-cases-for-chennai","dir":"Articles","previous_headings":"","what":"Get monthly cases for Chennai","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"chennai_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Chennai\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(chennai_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 Tamil Nadu Chennai 910 ## 2 May 2020 Tamil Nadu Chennai 13889 ## 3 Jun 2020 Tamil Nadu Chennai 43528 ## 4 Jul 2020 Tamil Nadu Chennai 41467 ## 5 Aug 2020 Tamil Nadu Chennai 35803 ## 6 Sep 2020 Tamil Nadu Chennai 31779"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"plot-monthly-cases-for-chennai","dir":"Articles","previous_headings":"Get monthly cases for Chennai","what":"Plot monthly cases for Chennai","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"p1 <- BarPlot(chennai_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Chennai (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"get-weekly-cases-for-chennai","dir":"Articles","previous_headings":"","what":"Get weekly cases for Chennai","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"chennai_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Chennai\"), rename_country_as_state = TRUE) p2 <- BarPlot(chennai_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Chennai (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"overall-how-much-has-chennai-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Chennai","what":"Overall, how much has Chennai sequenced over months?","title":"Animation of projected weekly cases - Chennai (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"chennai_monthly_cases_tmp <- chennai_monthly_cases %>% select(MonthYear, value) chennai_monthly_cases_tmp$State <- \"India\" chennai_monthly_cases_tmp$type <- \"Confirmed\" chennai_monthly_cases_tmp <- chennai_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = chennai_seq_stats, confirmed_long = chennai_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Chennai (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(custom_city == \"Chennai\")) state_month_counts$State <- \"Chennai\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Chennai (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Chennai\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Chennai\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 36 (24 variable) ## initial value 1779.751908 ## iter 10 value 991.793574 ## iter 20 value 889.885834 ## iter 30 value 874.354598 ## iter 40 value 866.610645 ## iter 50 value 860.066748 ## iter 60 value 859.458049 ## iter 70 value 858.588454 ## iter 80 value 852.529458 ## iter 90 value 851.552362 ## iter 100 value 850.538021 ## iter 110 value 850.204650 ## iter 120 value 850.150788 ## iter 130 value 850.019667 ## iter 140 value 849.821623 ## iter 150 value 849.068066 ## iter 160 value 849.025243 ## iter 170 value 848.920775 ## iter 180 value 848.886340 ## iter 190 value 848.760664 ## iter 200 value 848.599107 ## iter 210 value 848.554962 ## iter 220 value 848.520087 ## iter 230 value 848.498250 ## iter 240 value 848.420038 ## iter 250 value 848.304831 ## iter 260 value 848.293434 ## iter 270 value 848.233222 ## iter 280 value 848.201880 ## iter 290 value 848.180200 ## iter 300 value 848.041948 ## iter 310 value 847.984698 ## iter 320 value 847.946892 ## iter 330 value 847.890911 ## iter 340 value 847.866641 ## iter 350 value 847.798708 ## iter 360 value 847.771467 ## iter 370 value 847.742980 ## iter 380 value 847.719187 ## iter 390 value 847.659856 ## iter 400 value 847.508463 ## iter 410 value 847.481159 ## iter 420 value 847.323116 ## iter 430 value 847.301290 ## iter 440 value 847.279707 ## final value 847.278351 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Chennai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Chennai_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Chennai\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Chennai\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 32 (21 variable) ## initial value 1268.459340 ## iter 10 value 795.062679 ## iter 20 value 749.508485 ## iter 30 value 739.179730 ## iter 40 value 736.835110 ## iter 50 value 736.442544 ## iter 60 value 735.864333 ## iter 70 value 734.406026 ## iter 80 value 734.100075 ## iter 90 value 733.327338 ## iter 100 value 732.905875 ## iter 110 value 732.809431 ## iter 120 value 732.471697 ## iter 130 value 732.249288 ## iter 140 value 732.205271 ## iter 150 value 731.930271 ## iter 160 value 731.696672 ## iter 170 value 731.639763 ## iter 180 value 731.559236 ## iter 190 value 731.500805 ## iter 200 value 731.474572 ## iter 210 value 731.329832 ## iter 220 value 731.249310 ## iter 230 value 731.188857 ## iter 240 value 731.066760 ## iter 250 value 731.034609 ## iter 260 value 731.004835 ## iter 270 value 730.990132 ## iter 280 value 730.974169 ## iter 290 value 730.854711 ## iter 300 value 730.621687 ## iter 310 value 730.578534 ## iter 320 value 730.431668 ## iter 330 value 730.355839 ## iter 340 value 730.348660 ## iter 350 value 730.345089 ## iter 360 value 730.341325 ## iter 370 value 730.331525 ## iter 380 value 730.259238 ## iter 390 value 730.153046 ## iter 400 value 730.123614 ## iter 410 value 730.055951 ## iter 420 value 730.040177 ## iter 430 value 730.037826 ## iter 440 value 730.036758 ## iter 450 value 730.035420 ## iter 460 value 730.027286 ## iter 470 value 729.983742 ## final value 729.960267 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Chennai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Chennai_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Chennai\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Chennai\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 32 (21 variable) ## initial value 1268.459340 ## iter 10 value 795.062679 ## iter 20 value 749.508485 ## iter 30 value 739.179730 ## iter 40 value 736.835110 ## iter 50 value 736.442544 ## iter 60 value 735.864333 ## iter 70 value 734.406026 ## iter 80 value 734.100075 ## iter 90 value 733.327338 ## iter 100 value 732.905875 ## iter 110 value 732.809431 ## iter 120 value 732.471697 ## iter 130 value 732.249288 ## iter 140 value 732.205271 ## iter 150 value 731.930271 ## iter 160 value 731.696672 ## iter 170 value 731.639763 ## iter 180 value 731.559236 ## iter 190 value 731.500805 ## iter 200 value 731.474572 ## iter 210 value 731.329832 ## iter 220 value 731.249310 ## iter 230 value 731.188857 ## iter 240 value 731.066760 ## iter 250 value 731.034609 ## iter 260 value 731.004835 ## iter 270 value 730.990132 ## iter 280 value 730.974169 ## iter 290 value 730.854711 ## iter 300 value 730.621687 ## iter 310 value 730.578534 ## iter 320 value 730.431668 ## iter 330 value 730.355839 ## iter 340 value 730.348660 ## iter 350 value 730.345089 ## iter 360 value 730.341325 ## iter 370 value 730.331525 ## iter 380 value 730.259238 ## iter 390 value 730.153046 ## iter 400 value 730.123614 ## iter 410 value 730.055951 ## iter 420 value 730.040177 ## iter 430 value 730.037826 ## iter 440 value 730.036758 ## iter 450 value 730.035420 ## iter 460 value 730.027286 ## iter 470 value 729.983742 ## final value 729.960267 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Chennai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Chennai_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"get-monthly-cases-for-delhi","dir":"Articles","previous_headings":"","what":"Get monthly cases for Delhi","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"NewDelhi_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Delhi\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(NewDelhi_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 Delhi Delhi 3515 ## 2 May 2020 Delhi Delhi 16329 ## 3 Jun 2020 Delhi Delhi 67516 ## 4 Jul 2020 Delhi Delhi 48238 ## 5 Aug 2020 Delhi Delhi 39150 ## 6 Sep 2020 Delhi Delhi 104967"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"plot-monthly-cases-for-new-delhi","dir":"Articles","previous_headings":"Get monthly cases for Delhi","what":"Plot monthly cases for New Delhi","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"p1 <- BarPlot(NewDelhi_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - New Delhi (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"get-weekly-cases-for-new-delhi","dir":"Articles","previous_headings":"","what":"Get weekly cases for New Delhi","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"NewDelhi_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"New Delhi\"), rename_country_as_state = TRUE) p2 <- BarPlot(NewDelhi_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from New Delhi (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"overall-how-much-has-new-delhi-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for New Delhi","what":"Overall, how much has New Delhi sequenced over months?","title":"Animation of projected weekly cases - New Delhi (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"NewDelhi_monthly_cases_cases_tmp <- NewDelhi_monthly_cases %>% select(MonthYear, value) NewDelhi_monthly_cases_cases_tmp$State <- \"India\" NewDelhi_monthly_cases_cases_tmp$type <- \"Confirmed\" NewDelhi_monthly_cases_cases_tmp <- NewDelhi_monthly_cases_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = NewDelhi_seq_stats, confirmed_long = NewDelhi_monthly_cases_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from New Delhi (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(custom_city == \"New Delhi\")) state_month_counts$State <- \"New Delhi\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - New Delhi (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"New Delhi\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Delhi\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 24 (15 variable) ## initial value 842.126951 ## iter 10 value 216.238972 ## iter 20 value 189.791312 ## iter 30 value 161.502995 ## iter 40 value 158.001709 ## iter 50 value 157.620952 ## iter 60 value 157.307382 ## iter 70 value 156.889664 ## iter 80 value 156.544836 ## iter 90 value 156.412922 ## iter 100 value 155.048818 ## iter 110 value 154.848817 ## iter 120 value 154.827926 ## iter 130 value 154.731501 ## iter 140 value 154.658254 ## iter 150 value 154.613782 ## iter 160 value 153.885377 ## iter 170 value 153.604019 ## iter 180 value 153.459823 ## iter 190 value 153.430215 ## iter 200 value 153.412026 ## iter 210 value 153.347006 ## iter 220 value 153.306556 ## iter 230 value 153.280920 ## iter 240 value 153.226716 ## iter 250 value 153.207759 ## iter 260 value 153.200943 ## iter 270 value 153.155258 ## iter 280 value 153.135377 ## iter 290 value 153.119085 ## iter 300 value 153.092022 ## iter 310 value 153.064245 ## iter 320 value 153.053716 ## iter 330 value 152.995881 ## iter 340 value 152.951868 ## iter 350 value 152.851132 ## iter 360 value 152.656721 ## iter 370 value 152.622231 ## iter 380 value 152.586770 ## iter 390 value 152.563590 ## iter 400 value 152.552759 ## iter 410 value 152.459565 ## iter 420 value 152.455760 ## iter 430 value 152.424036 ## iter 440 value 151.570482 ## iter 450 value 151.363254 ## iter 460 value 150.998569 ## iter 470 value 150.984107 ## iter 480 value 150.926106 ## iter 490 value 150.915520 ## iter 500 value 150.628730 ## iter 510 value 150.187642 ## iter 520 value 150.171820 ## final value 150.124810 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New Delhi (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/NewDelhi_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Delhi\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"New Delhi\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 16 (9 variable) ## initial value 88.722839 ## iter 10 value 18.566645 ## iter 20 value 15.275942 ## iter 30 value 14.637524 ## iter 40 value 14.619395 ## iter 50 value 14.608012 ## iter 60 value 14.594810 ## iter 70 value 14.579141 ## iter 80 value 14.557447 ## iter 90 value 14.527072 ## iter 100 value 14.524759 ## iter 110 value 14.518887 ## iter 120 value 14.474850 ## iter 130 value 14.471176 ## iter 140 value 14.462106 ## iter 150 value 14.456082 ## iter 160 value 14.414876 ## iter 170 value 14.393493 ## iter 180 value 14.391128 ## iter 190 value 14.362229 ## iter 200 value 14.336908 ## iter 210 value 14.334876 ## iter 220 value 14.321236 ## iter 230 value 14.315444 ## iter 240 value 14.306113 ## iter 250 value 14.296477 ## iter 260 value 14.290316 ## iter 270 value 14.212284 ## iter 280 value 14.164693 ## iter 290 value 14.147070 ## iter 300 value 14.133277 ## iter 310 value 14.127263 ## iter 320 value 14.119815 ## iter 330 value 14.119150 ## iter 340 value 14.114425 ## iter 350 value 14.111003 ## iter 360 value 14.105709 ## iter 370 value 14.093937 ## iter 380 value 14.088865 ## iter 390 value 14.084908 ## iter 400 value 14.083747 ## iter 410 value 14.081511 ## iter 420 value 14.078802 ## iter 430 value 14.074838 ## iter 440 value 14.073306 ## iter 450 value 14.060703 ## iter 460 value 13.895915 ## iter 470 value 13.888568 ## iter 480 value 13.878325 ## iter 490 value 13.874439 ## iter 500 value 13.867358 ## iter 510 value 13.861740 ## iter 520 value 13.861637 ## iter 530 value 13.854962 ## iter 540 value 13.843729 ## iter 550 value 13.835448 ## iter 560 value 13.833888 ## iter 570 value 13.832535 ## iter 580 value 13.831420 ## iter 590 value 13.830374 ## iter 600 value 13.828765 ## iter 610 value 13.827862 ## iter 620 value 13.826744 ## iter 630 value 13.825367 ## iter 640 value 13.823906 ## iter 650 value 13.822345 ## iter 660 value 13.820044 ## iter 670 value 13.819611 ## iter 680 value 13.817792 ## iter 690 value 13.814517 ## iter 700 value 13.811589 ## iter 710 value 13.811447 ## iter 720 value 13.808551 ## iter 730 value 13.803871 ## iter 740 value 13.799947 ## iter 750 value 13.798061 ## iter 760 value 13.794305 ## iter 770 value 13.790901 ## iter 780 value 13.789124 ## iter 790 value 13.785390 ## iter 800 value 13.775121 ## iter 810 value 13.771331 ## iter 820 value 13.770409 ## iter 830 value 13.769883 ## iter 840 value 13.769200 ## iter 850 value 13.768360 ## iter 860 value 13.768059 ## iter 870 value 13.767148 ## iter 880 value 13.766697 ## iter 890 value 13.765881 ## iter 900 value 13.765745 ## iter 910 value 13.764903 ## iter 920 value 13.764044 ## iter 930 value 13.763257 ## iter 940 value 13.762609 ## iter 950 value 13.761595 ## iter 960 value 13.759836 ## iter 970 value 13.757579 ## iter 980 value 13.756053 ## iter 990 value 13.754867 ## iter1000 value 13.753617 ## final value 13.753617 ## stopped after 1000 iterations the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New Delhi (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/NewDelhi_animated_2021.gif\"), animation = the_anim) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"New Delhi\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 16 (9 variable) ## initial value 88.722839 ## iter 10 value 18.566645 ## iter 20 value 15.275942 ## iter 30 value 14.637524 ## iter 40 value 14.619395 ## iter 50 value 14.608012 ## iter 60 value 14.594810 ## iter 70 value 14.579141 ## iter 80 value 14.557447 ## iter 90 value 14.527072 ## iter 100 value 14.524759 ## iter 110 value 14.518887 ## iter 120 value 14.474850 ## iter 130 value 14.471176 ## iter 140 value 14.462106 ## iter 150 value 14.456082 ## iter 160 value 14.414876 ## iter 170 value 14.393493 ## iter 180 value 14.391128 ## iter 190 value 14.362229 ## iter 200 value 14.336908 ## iter 210 value 14.334876 ## iter 220 value 14.321236 ## iter 230 value 14.315444 ## iter 240 value 14.306113 ## iter 250 value 14.296477 ## iter 260 value 14.290316 ## iter 270 value 14.212284 ## iter 280 value 14.164693 ## iter 290 value 14.147070 ## iter 300 value 14.133277 ## iter 310 value 14.127263 ## iter 320 value 14.119815 ## iter 330 value 14.119150 ## iter 340 value 14.114425 ## iter 350 value 14.111003 ## iter 360 value 14.105709 ## iter 370 value 14.093937 ## iter 380 value 14.088865 ## iter 390 value 14.084908 ## iter 400 value 14.083747 ## iter 410 value 14.081511 ## iter 420 value 14.078802 ## iter 430 value 14.074838 ## iter 440 value 14.073306 ## iter 450 value 14.060703 ## iter 460 value 13.895915 ## iter 470 value 13.888568 ## iter 480 value 13.878325 ## iter 490 value 13.874439 ## iter 500 value 13.867358 ## iter 510 value 13.861740 ## iter 520 value 13.861637 ## iter 530 value 13.854962 ## iter 540 value 13.843729 ## iter 550 value 13.835448 ## iter 560 value 13.833888 ## iter 570 value 13.832535 ## iter 580 value 13.831420 ## iter 590 value 13.830374 ## iter 600 value 13.828765 ## iter 610 value 13.827862 ## iter 620 value 13.826744 ## iter 630 value 13.825367 ## iter 640 value 13.823906 ## iter 650 value 13.822345 ## iter 660 value 13.820044 ## iter 670 value 13.819611 ## iter 680 value 13.817792 ## iter 690 value 13.814517 ## iter 700 value 13.811589 ## iter 710 value 13.811447 ## iter 720 value 13.808551 ## iter 730 value 13.803871 ## iter 740 value 13.799947 ## iter 750 value 13.798061 ## iter 760 value 13.794305 ## iter 770 value 13.790901 ## iter 780 value 13.789124 ## iter 790 value 13.785390 ## iter 800 value 13.775121 ## iter 810 value 13.771331 ## iter 820 value 13.770409 ## iter 830 value 13.769883 ## iter 840 value 13.769200 ## iter 850 value 13.768360 ## iter 860 value 13.768059 ## iter 870 value 13.767148 ## iter 880 value 13.766697 ## iter 890 value 13.765881 ## iter 900 value 13.765745 ## iter 910 value 13.764903 ## iter 920 value 13.764044 ## iter 930 value 13.763257 ## iter 940 value 13.762609 ## iter 950 value 13.761595 ## iter 960 value 13.759836 ## iter 970 value 13.757579 ## iter 980 value 13.756053 ## iter 990 value 13.754867 ## iter1000 value 13.753617 ## final value 13.753617 ## stopped after 1000 iterations the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New Delhi (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/NewDelhi_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Germany.html","id":"get-variants-data-for-germany","dir":"Articles","previous_headings":"","what":"Get variants data for Germany","title":"Animation of projected weekly cases - Germany","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_germany <- gisaid_metadata %>% filter(Country == \"Germany\") %>% filter(Host == \"Human\") # format metadata gisaid_germany <- FormatGISAIDMetadata(gisaid_germany) %>% filter(State != \"\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_germany <- gisaid_germany %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") %>% filter(State != \"Unknown\") vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_germany <- gisaid_germany %>% filter(pangolin_lineage != \"None\") %>% filter(!is.na(MonthYearCollected)) %>% filter(pangolin_lineage != \"Unassigned\") gisaid_germany <- CollapseLineageToVOCs( variant_df = gisaid_germany, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Germany.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Germany","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_germany) state_month_counts$State <- \"Germany\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Germany.html","id":"get-weekly-cases-for-germany","dir":"Articles","previous_headings":"","what":"Get weekly cases for Germany","title":"Animation of projected weekly cases - Germany","text":"","code":"confirmed.tmp <- COVID19::covid19(country = \"Germany\", verbose = FALSE, level = 2) %>% select(date, administrative_area_level_2, confirmed) %>% rename(State = administrative_area_level_2) confirmed <- COVID19::covid19(country = \"Germany\", verbose = FALSE) %>% select(date, confirmed) %>% filter(!is.na(confirmed)) confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_germany_weekwise <- SummarizeVariantsWeekwise(gisaid_germany)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Germany.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Germany","text":"Look cases October,2021 :","code":"voc_to_keep <- gisaid_germany_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_germany_weekwise <- gisaid_germany_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_germany_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 52 (36 variable) ## initial value 365428.334958 ## iter 10 value 217795.790523 ## iter 20 value 182222.924780 ## iter 30 value 162640.399065 ## iter 40 value 133150.540193 ## iter 50 value 123339.803407 ## iter 60 value 120379.141352 ## iter 70 value 119282.449737 ## iter 80 value 119032.405637 ## iter 90 value 118788.427205 ## iter 100 value 117472.705713 ## iter 110 value 116743.881223 ## iter 120 value 116330.532158 ## iter 130 value 116267.934702 ## iter 140 value 116246.039563 ## final value 116235.817226 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Germany by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Germany_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"Dec 2021\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_germany_subset <- gisaid_germany %>% filter(MonthYearCollected > \"Dec 2021\") gisaid_germany_weekwise <- SummarizeVariantsWeekwise(gisaid_germany_subset) voc_to_keep <- gisaid_germany_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_germany_weekwise <- gisaid_germany_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_germany_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 202544.595120 ## iter 10 value 134616.636291 ## iter 20 value 113480.373066 ## iter 30 value 101938.361479 ## iter 40 value 98575.249357 ## iter 50 value 97337.481139 ## iter 60 value 97217.785587 ## iter 70 value 97168.865780 ## iter 80 value 97037.390914 ## iter 90 value 97029.979879 ## final value 97029.903283 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Germany by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Germany_animated_2021.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq) DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"get-monthly-cases-for-gujarat","dir":"Articles","previous_headings":"","what":"Get monthly cases for Gujarat","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"Gujarat_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == \"Gujarat\") ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Gujarat_monthly_cases) ## MonthYear State value type ## 1 Mar 2020 Gujarat 74 Confirmed ## 2 Apr 2020 Gujarat 4321 Confirmed ## 3 May 2020 Gujarat 12399 Confirmed ## 4 Jun 2020 Gujarat 15849 Confirmed ## 5 Jul 2020 Gujarat 28795 Confirmed ## 6 Aug 2020 Gujarat 34997 Confirmed"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"plot-monthly-cases-for-gujarat","dir":"Articles","previous_headings":"Get monthly cases for Gujarat","what":"Plot monthly cases for Gujarat","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"p1 <- BarPlot(Gujarat_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Gujarat (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"get-weekly-cases-for-gujarat","dir":"Articles","previous_headings":"","what":"Get weekly cases for Gujarat","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"Gujarat_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(State == \"Gujarat\"), rename_country_as_state = TRUE) p2 <- BarPlot(Gujarat_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Gujarat (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"overall-how-much-has-gujarat-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Gujarat","what":"Overall, how much has Gujarat sequenced over months?","title":"Animation of projected weekly cases - Gujarat (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Gujarat_monthly_cases_tmp <- Gujarat_monthly_cases %>% select(MonthYear, value) Gujarat_monthly_cases_tmp$State <- \"India\" Gujarat_monthly_cases_tmp$type <- \"Confirmed\" Gujarat_monthly_cases_tmp <- Gujarat_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Gujarat_seq_stats, confirmed_long = Gujarat_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Gujarat (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(State == \"Gujarat\")) state_month_counts$State <- \"Gujarat\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Gujarat (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(State == \"Gujarat\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(State %in% c(\"Gujarat\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 44 (30 variable) ## initial value 11852.796333 ## iter 10 value 5204.938442 ## iter 20 value 4230.005743 ## iter 30 value 3874.885439 ## iter 40 value 3822.985505 ## iter 50 value 3780.950617 ## iter 60 value 3741.386027 ## iter 70 value 3699.654759 ## iter 80 value 3679.619314 ## iter 90 value 3651.111198 ## iter 100 value 3636.847864 ## iter 110 value 3622.823067 ## iter 120 value 3599.758896 ## iter 130 value 3594.464443 ## iter 140 value 3587.385269 ## iter 150 value 3582.623837 ## iter 160 value 3579.096872 ## iter 170 value 3568.869613 ## iter 180 value 3561.514165 ## iter 190 value 3545.173652 ## iter 200 value 3544.467758 ## iter 210 value 3540.668895 ## iter 220 value 3535.527065 ## iter 230 value 3534.266164 ## iter 240 value 3532.022898 ## iter 250 value 3530.532125 ## iter 260 value 3529.998220 ## iter 270 value 3528.827971 ## iter 280 value 3526.850176 ## iter 290 value 3525.801652 ## iter 300 value 3522.965255 ## iter 310 value 3522.583829 ## iter 320 value 3522.543243 ## iter 330 value 3521.515799 ## iter 340 value 3520.749972 ## iter 350 value 3520.232052 ## iter 360 value 3519.200442 ## iter 370 value 3518.315020 ## iter 380 value 3517.629251 ## iter 390 value 3517.375281 ## iter 400 value 3516.633577 ## iter 410 value 3516.368706 ## iter 420 value 3515.875001 ## iter 430 value 3515.548838 ## iter 440 value 3515.535986 ## iter 450 value 3515.350050 ## iter 460 value 3515.044937 ## iter 470 value 3514.831077 ## iter 480 value 3514.302837 ## iter 490 value 3513.851037 ## iter 500 value 3513.818529 ## iter 510 value 3513.579557 ## iter 520 value 3513.503817 ## iter 530 value 3513.388354 ## iter 540 value 3513.020285 ## iter 550 value 3512.749580 ## iter 550 value 3512.749571 ## final value 3512.749571 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Gujarat (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Gujarat_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(State %in% c(\"Gujarat\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Gujarat\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 8970.871522 ## iter 10 value 4077.098919 ## iter 20 value 3511.549306 ## iter 30 value 3371.088320 ## iter 40 value 3317.078177 ## iter 50 value 3315.408474 ## iter 60 value 3314.292756 ## iter 70 value 3313.984443 ## iter 80 value 3313.178808 ## iter 90 value 3312.773496 ## iter 100 value 3312.542516 ## iter 110 value 3311.938413 ## iter 120 value 3311.752572 ## iter 130 value 3311.722829 ## iter 140 value 3311.647620 ## iter 150 value 3311.516536 ## iter 160 value 3311.356727 ## final value 3311.265338 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Gujarat (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Gujarat_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(State %in% c(\"Gujarat\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Gujarat\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 8970.871522 ## iter 10 value 4077.098919 ## iter 20 value 3511.549306 ## iter 30 value 3371.088320 ## iter 40 value 3317.078177 ## iter 50 value 3315.408474 ## iter 60 value 3314.292756 ## iter 70 value 3313.984443 ## iter 80 value 3313.178808 ## iter 90 value 3312.773496 ## iter 100 value 3312.542516 ## iter 110 value 3311.938413 ## iter 120 value 3311.752572 ## iter 130 value 3311.722829 ## iter 140 value 3311.647620 ## iter 150 value 3311.516536 ## iter 160 value 3311.356727 ## final value 3311.265338 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Gujarat (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Gujarat_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-India.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - India","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GE.1` = \"GE.1\", `GE.1.*` = \"GE.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-India.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - India","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india) state_month_counts$State <- \"India\" state_month_prevalence <- CountsToPrevalence(state_month_counts) state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-India.html","id":"get-weekly-cases-for-india","dir":"Articles","previous_headings":"","what":"Get weekly cases for India","title":"Animation of projected weekly cases - India","text":"","code":"GetIndiaCases <- function(){ data <- read.csv(\"https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/cases_deaths/new_cases.csv\") confirmed <- data %>% select(date, India) colnames(confirmed)[2] <- c(\"cases\") confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_weekwise <- confirmed %>% group_by(WeekYear) %>% summarise(cases = mean(cases, na.rm=T)) %>% arrange(WeekYear) confirmed_subset_weekwise$cases <- ceiling(confirmed_subset_weekwise$cases) confirmed_subset_dateweekwise_long_india <- confirmed_subset_weekwise %>% rename(n = cases) %>% rename(WeekYearCollected = WeekYear) } confirmed_subset_dateweekwise_long_india <- GetIndiaCases() gisaid_india_weekwise <- SummarizeVariantsWeekwise(gisaid_india)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-India.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - India","text":"Look cases January, 2022 : Look cases last months: Look cases last months:","code":"voc_to_keep <- gisaid_india_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_india_weekwise <- gisaid_india_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_india_weekwise, confirmed_subset_dateweekwise_long_india) ## # weights: 28 (18 variable) ## initial value 81510.284324 ## iter 10 value 38054.048312 ## iter 20 value 24115.682859 ## iter 30 value 20845.261008 ## iter 40 value 19011.530294 ## iter 50 value 18968.977884 ## iter 60 value 18894.945566 ## iter 70 value 18699.400046 ## iter 80 value 18620.948082 ## iter 90 value 18619.893285 ## iter 100 value 18589.912291 ## iter 110 value 18588.809774 ## final value 18588.805908 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in India by variant\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**\", date_breaks = \"28 days\") # , trans_y=\"log10\") gganimate::anim_save(filename = here::here(\"docs/articles/IN_animated.gif\"), animation = the_anim) ##confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() # confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% # filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% # group_by(WeekYear) %>% # summarise(n = sum(value)) %>% # arrange(WeekYear) %>% # rename(WeekYearCollected = WeekYear) confirmed_subset_dateweekwise_long_india <- GetIndiaCases() %>% filter(WeekYearCollected >= tsibble::yearweek(\"2021 W35\")) gisaid_india <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_india) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india) ## # weights: 24 (15 variable) ## initial value 38784.425471 ## iter 10 value 12730.648310 ## iter 20 value 10325.808044 ## iter 30 value 10201.403230 ## iter 40 value 10170.007525 ## iter 50 value 10154.979021 ## iter 60 value 10138.545159 ## iter 60 value 10138.545063 ## iter 60 value 10138.545063 ## final value 10138.545063 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in India by variant\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**
\") # , trans_y=\"log10\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/IN_animated_2021.gif\"), animation = the_anim) # confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() # confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% # filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% # group_by(WeekYear) %>% # summarise(n = sum(value)) %>% # arrange(WeekYear) %>% # rename(WeekYearCollected = WeekYear) confirmed_subset_dateweekwise_long_india <- GetIndiaCases() %>% filter(WeekYearCollected >= tsibble::yearweek(\"2022 W12\")) gisaid_india <- gisaid_india %>% filter(MonthYearCollected >= \"Mar 2022\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_india) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 10) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india) ## # weights: 36 (24 variable) ## initial value 42340.517605 ## iter 10 value 12243.823368 ## iter 20 value 9987.299574 ## iter 30 value 9749.502975 ## iter 40 value 9703.612388 ## iter 50 value 9697.475009 ## iter 60 value 9697.365270 ## iter 70 value 9695.337980 ## iter 80 value 9689.392183 ## iter 90 value 9682.998997 ## final value 9679.821524 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in India by variant\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/IN_animated_2022.gif\"), animation = the_anim) #confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() # confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% # filter(WeekYear >= tsibble::yearweek(\"2022 W39\")) %>% # group_by(WeekYear) %>% # summarise(n = sum(value)) %>% # arrange(WeekYear) %>% # rename(WeekYearCollected = WeekYear) confirmed_subset_dateweekwise_long_india <- GetIndiaCases() %>% filter(WeekYearCollected >= tsibble::yearweek(\"2022 W39\")) gisaid_india <- gisaid_india %>% filter(MonthYearCollected >= \"Mar 2022\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_india) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 10) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india) ## # weights: 36 (24 variable) ## initial value 42340.517605 ## iter 10 value 12243.823368 ## iter 20 value 9987.299574 ## iter 30 value 9749.502975 ## iter 40 value 9703.612388 ## iter 50 value 9697.475009 ## iter 60 value 9697.365270 ## iter 70 value 9695.337980 ## iter 80 value 9689.392183 ## iter 90 value 9682.998997 ## final value 9679.821524 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in India by variant\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/IN_animated_latest.gif\"), animation = the_anim) #confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() # confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% # filter(WeekYear >= tsibble::yearweek(\"2022 W39\")) %>% # group_by(WeekYear) %>% # summarise(n = sum(value)) %>% # arrange(WeekYear) %>% # rename(WeekYearCollected = WeekYear) confirmed_subset_dateweekwise_long_india <- GetIndiaCases() %>% filter(WeekYearCollected >= tsibble::yearweek(\"2023 W23\")) gisaid_india <- gisaid_india %>% filter(MonthYearCollected >= \"June 2023\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_india) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 10) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india) ## # weights: 12 (6 variable) ## initial value 295.526706 ## iter 10 value 175.310430 ## final value 175.308861 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in India by variant\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/IN_animated_2023.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Jaipur (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Jaipur (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"get-monthly-cases-for-jaipur","dir":"Articles","previous_headings":"","what":"Get monthly cases for Jaipur","title":"Animation of projected weekly cases - Jaipur (India)","text":"","code":"chennai_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Jaipur\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(chennai_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 Rajasthan Jaipur 907 ## 2 May 2020 Rajasthan Jaipur 1084 ## 3 Jun 2020 Rajasthan Jaipur 1327 ## 4 Jul 2020 Rajasthan Jaipur 2100 ## 5 Aug 2020 Rajasthan Jaipur 5373 ## 6 Sep 2020 Rajasthan Jaipur 10697"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"plot-monthly-cases-for-jaipur","dir":"Articles","previous_headings":"Get monthly cases for Jaipur","what":"Plot monthly cases for Jaipur","title":"Animation of projected weekly cases - Jaipur (India)","text":"","code":"p1 <- BarPlot(chennai_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Jaipur (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"get-weekly-cases-for-jaipur","dir":"Articles","previous_headings":"","what":"Get weekly cases for Jaipur","title":"Animation of projected weekly cases - Jaipur (India)","text":"","code":"chennai_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Jaipur\"), rename_country_as_state = TRUE) p2 <- BarPlot(chennai_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Jaipur (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"overall-how-much-has-jaipur-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Jaipur","what":"Overall, how much has Jaipur sequenced over months?","title":"Animation of projected weekly cases - Jaipur (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"chennai_monthly_cases_tmp <- chennai_monthly_cases %>% select(MonthYear, value) chennai_monthly_cases_tmp$State <- \"India\" chennai_monthly_cases_tmp$type <- \"Confirmed\" chennai_monthly_cases_tmp <- chennai_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = chennai_seq_stats, confirmed_long = chennai_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Jaipur (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Jaipur (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Jaipur\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Jaipur\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 32 (21 variable) ## initial value 1617.805519 ## iter 10 value 480.680046 ## iter 20 value 388.097274 ## iter 30 value 380.954800 ## iter 40 value 373.712096 ## iter 50 value 371.282928 ## iter 60 value 370.757331 ## iter 70 value 369.415321 ## iter 80 value 367.823526 ## iter 90 value 367.239289 ## iter 100 value 367.069536 ## iter 110 value 366.938797 ## iter 120 value 366.678526 ## iter 130 value 366.519574 ## iter 140 value 366.487989 ## iter 150 value 366.457991 ## iter 160 value 366.396086 ## iter 170 value 366.245772 ## iter 180 value 366.213012 ## iter 190 value 366.172681 ## iter 200 value 366.158749 ## iter 210 value 366.100283 ## iter 220 value 366.049895 ## iter 230 value 366.039758 ## iter 240 value 365.985949 ## iter 250 value 365.957557 ## iter 260 value 365.899334 ## iter 270 value 365.879119 ## iter 280 value 365.843718 ## iter 290 value 365.828751 ## iter 300 value 365.793715 ## final value 365.792832 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Jaipur (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Jaipur_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Jaipur\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Jaipur\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 24 (15 variable) ## initial value 1290.066818 ## iter 10 value 362.768644 ## iter 20 value 344.153636 ## iter 30 value 343.014915 ## iter 40 value 342.825706 ## iter 50 value 342.152276 ## iter 60 value 340.584532 ## iter 70 value 339.719525 ## iter 80 value 339.377251 ## iter 90 value 339.301194 ## iter 100 value 339.269558 ## iter 110 value 339.250575 ## iter 120 value 339.186443 ## iter 130 value 339.162322 ## iter 140 value 339.131915 ## iter 150 value 339.123937 ## iter 160 value 339.109363 ## iter 170 value 339.106562 ## iter 180 value 339.101308 ## iter 190 value 339.094793 ## iter 200 value 339.092416 ## iter 210 value 339.089950 ## iter 220 value 339.088825 ## iter 230 value 339.088030 ## iter 240 value 339.086764 ## iter 250 value 339.084645 ## iter 260 value 339.083477 ## iter 270 value 339.082670 ## iter 280 value 339.081755 ## iter 290 value 339.081098 ## iter 300 value 339.080655 ## iter 310 value 339.080352 ## iter 320 value 339.080143 ## iter 330 value 339.079784 ## iter 340 value 339.079333 ## final value 339.078769 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Jaipur (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Jaipur_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Jaipur\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Jaipur\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 24 (15 variable) ## initial value 1290.066818 ## iter 10 value 362.768644 ## iter 20 value 344.153636 ## iter 30 value 343.014915 ## iter 40 value 342.825706 ## iter 50 value 342.152276 ## iter 60 value 340.584532 ## iter 70 value 339.719525 ## iter 80 value 339.377251 ## iter 90 value 339.301194 ## iter 100 value 339.269558 ## iter 110 value 339.250575 ## iter 120 value 339.186443 ## iter 130 value 339.162322 ## iter 140 value 339.131915 ## iter 150 value 339.123937 ## iter 160 value 339.109363 ## iter 170 value 339.106562 ## iter 180 value 339.101308 ## iter 190 value 339.094793 ## iter 200 value 339.092416 ## iter 210 value 339.089950 ## iter 220 value 339.088825 ## iter 230 value 339.088030 ## iter 240 value 339.086764 ## iter 250 value 339.084645 ## iter 260 value 339.083477 ## iter 270 value 339.082670 ## iter 280 value 339.081755 ## iter 290 value 339.081098 ## iter 300 value 339.080655 ## iter 310 value 339.080352 ## iter 320 value 339.080143 ## iter 330 value 339.079784 ## iter 340 value 339.079333 ## final value 339.078769 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Jaipur (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Jaipur_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq) DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"get-monthly-cases-for-maharashtra","dir":"Articles","previous_headings":"","what":"Get monthly cases for Maharashtra","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"Maharashtra_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == \"Maharashtra\") ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Maharashtra_monthly_cases) ## MonthYear State value type ## 1 Mar 2020 Maharashtra 302 Confirmed ## 2 Apr 2020 Maharashtra 10196 Confirmed ## 3 May 2020 Maharashtra 57157 Confirmed ## 4 Jun 2020 Maharashtra 107106 Confirmed ## 5 Jul 2020 Maharashtra 247357 Confirmed ## 6 Aug 2020 Maharashtra 370423 Confirmed"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"plot-monthly-cases-for-maharashtra","dir":"Articles","previous_headings":"Get monthly cases for Maharashtra","what":"Plot monthly cases for Maharashtra","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"p1 <- BarPlot(Maharashtra_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Maharashtra (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"get-weekly-cases-for-maharashtra","dir":"Articles","previous_headings":"","what":"Get weekly cases for Maharashtra","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"Maharashtra_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(State == \"Maharashtra\"), rename_country_as_state = TRUE) p2 <- BarPlot(Maharashtra_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Maharashtra (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"overall-how-much-has-maharashtra-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Maharashtra","what":"Overall, how much has Maharashtra sequenced over months?","title":"Animation of projected weekly cases - Maharashtra (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Maharashtra_monthly_cases_tmp <- Maharashtra_monthly_cases %>% select(MonthYear, value) Maharashtra_monthly_cases_tmp$State <- \"India\" Maharashtra_monthly_cases_tmp$type <- \"Confirmed\" Maharashtra_monthly_cases_tmp <- Maharashtra_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Maharashtra_seq_stats, confirmed_long = Maharashtra_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Maharashtra (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(State == \"Maharashtra\")) state_month_counts$State <- \"Maharashtra\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Maharashtra (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(State == \"Maharashtra\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(State %in% c(\"Maharashtra\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 56 (39 variable) ## initial value 19565.971042 ## iter 10 value 7608.774723 ## iter 20 value 6055.611321 ## iter 30 value 5119.389656 ## iter 40 value 5056.861099 ## iter 50 value 4991.059919 ## iter 60 value 4923.933525 ## iter 70 value 4863.216177 ## iter 80 value 4848.767372 ## iter 90 value 4848.150763 ## iter 100 value 4835.654061 ## iter 110 value 4825.777794 ## iter 120 value 4816.939959 ## iter 130 value 4810.664821 ## iter 140 value 4806.240961 ## iter 150 value 4800.638563 ## iter 160 value 4798.941664 ## iter 170 value 4798.913782 ## iter 180 value 4798.238247 ## iter 190 value 4797.227265 ## iter 200 value 4795.932551 ## iter 210 value 4792.381545 ## iter 220 value 4787.800654 ## iter 230 value 4783.473182 ## iter 240 value 4780.290634 ## iter 250 value 4780.170911 ## iter 260 value 4778.979885 ## iter 270 value 4778.573121 ## iter 280 value 4777.527081 ## iter 290 value 4776.920460 ## iter 300 value 4776.532227 ## iter 310 value 4775.729615 ## iter 320 value 4775.138151 ## iter 330 value 4775.113585 ## iter 340 value 4774.893283 ## iter 350 value 4774.786108 ## iter 360 value 4774.640727 ## iter 370 value 4774.537736 ## iter 380 value 4773.708292 ## iter 390 value 4772.942854 ## final value 4772.109029 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Maharashtra (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Maharashtra_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(State %in% c(\"Maharashtra\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Maharashtra\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 9956.061173 ## iter 10 value 5053.817767 ## iter 20 value 4244.480483 ## iter 30 value 4049.143155 ## iter 40 value 4024.907759 ## iter 50 value 4012.618320 ## iter 60 value 4008.272616 ## iter 70 value 4008.103002 ## iter 80 value 4007.361366 ## iter 90 value 4006.740372 ## iter 100 value 4006.622176 ## iter 110 value 4005.275103 ## iter 120 value 4005.040214 ## final value 4005.037615 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Maharashtra (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Maharashtra_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(State %in% c(\"Maharashtra\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Maharashtra\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 9956.061173 ## iter 10 value 5053.817767 ## iter 20 value 4244.480483 ## iter 30 value 4049.143155 ## iter 40 value 4024.907759 ## iter 50 value 4012.618320 ## iter 60 value 4008.272616 ## iter 70 value 4008.103002 ## iter 80 value 4007.361366 ## iter 90 value 4006.740372 ## iter 100 value 4006.622176 ## iter 110 value 4005.275103 ## iter 120 value 4005.040214 ## final value 4005.037615 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Maharashtra (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Maharashtra_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"get-monthly-cases-for-mumbai","dir":"Articles","previous_headings":"","what":"Get monthly cases for Mumbai","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"Mumbai_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Mumbai\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Mumbai_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 Maharashtra Mumbai 7061 ## 2 May 2020 Maharashtra Mumbai 32625 ## 3 Jun 2020 Maharashtra Mumbai 37972 ## 4 Jul 2020 Maharashtra Mumbai 36626 ## 5 Aug 2020 Maharashtra Mumbai 32340 ## 6 Sep 2020 Maharashtra Mumbai 59463"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"plot-monthly-cases-for-mumbai","dir":"Articles","previous_headings":"Get monthly cases for Mumbai","what":"Plot monthly cases for Mumbai","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"p1 <- BarPlot(Mumbai_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Mumbai (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"get-weekly-cases-for-mumbai","dir":"Articles","previous_headings":"","what":"Get weekly cases for Mumbai","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"Mumbai_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Mumbai\"), rename_country_as_state = TRUE) p2 <- BarPlot(Mumbai_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Mumbai (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"overall-how-much-has-mumbai-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Mumbai","what":"Overall, how much has Mumbai sequenced over months?","title":"Animation of projected weekly cases - Mumbai (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Mumbai_monthly_cases_tmp <- Mumbai_monthly_cases %>% select(MonthYear, value) Mumbai_monthly_cases_tmp$State <- \"India\" Mumbai_monthly_cases_tmp$type <- \"Confirmed\" Mumbai_monthly_cases_tmp <- Mumbai_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Mumbai_seq_stats, confirmed_long = Mumbai_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Mumbai (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(custom_city == \"Mumbai\")) state_month_counts$State <- \"Mumbai\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Mumbai (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Mumbai\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Mumbai\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 44 (30 variable) ## initial value 3527.303946 ## iter 10 value 1725.338659 ## iter 20 value 1240.428645 ## iter 30 value 1181.810283 ## iter 40 value 1136.265458 ## iter 50 value 1111.457175 ## iter 60 value 1099.683360 ## iter 70 value 1098.235525 ## iter 80 value 1094.513037 ## iter 90 value 1089.626876 ## iter 100 value 1087.950479 ## iter 110 value 1084.237840 ## iter 120 value 1080.377940 ## iter 130 value 1078.802869 ## iter 140 value 1078.395087 ## iter 150 value 1076.663773 ## iter 160 value 1074.924808 ## iter 170 value 1073.793667 ## iter 180 value 1072.510879 ## iter 190 value 1071.133760 ## iter 200 value 1069.901259 ## iter 210 value 1069.743032 ## iter 220 value 1069.245087 ## iter 230 value 1068.522121 ## iter 240 value 1066.815777 ## iter 250 value 1066.610830 ## iter 260 value 1065.904848 ## iter 270 value 1065.089457 ## iter 280 value 1064.895344 ## iter 290 value 1064.513308 ## iter 300 value 1064.273613 ## iter 310 value 1064.131692 ## iter 320 value 1064.096957 ## iter 330 value 1063.885446 ## iter 340 value 1063.775116 ## iter 350 value 1063.658981 ## iter 360 value 1063.387082 ## iter 370 value 1060.470320 ## iter 380 value 1060.101363 ## iter 390 value 1059.576990 ## iter 400 value 1059.463714 ## iter 410 value 1059.259133 ## iter 420 value 1059.126508 ## final value 1059.092892 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Mumbai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Mumbai_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Mumbai\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Mumbai\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 2291.072168 ## iter 10 value 1159.102986 ## iter 20 value 1006.900113 ## iter 30 value 971.531617 ## iter 40 value 963.134212 ## iter 50 value 961.954272 ## iter 60 value 960.856391 ## iter 70 value 960.402612 ## iter 80 value 959.916524 ## iter 90 value 959.423666 ## iter 100 value 958.709979 ## iter 110 value 957.809712 ## iter 120 value 957.793121 ## iter 130 value 957.674562 ## iter 140 value 957.551925 ## iter 150 value 957.408887 ## iter 160 value 957.355590 ## final value 957.344474 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Mumbai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Mumbai_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Mumbai\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Mumbai\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 2291.072168 ## iter 10 value 1159.102986 ## iter 20 value 1006.900113 ## iter 30 value 971.531617 ## iter 40 value 963.134212 ## iter 50 value 961.954272 ## iter 60 value 960.856391 ## iter 70 value 960.402612 ## iter 80 value 959.916524 ## iter 90 value 959.423666 ## iter 100 value 958.709979 ## iter 110 value 957.809712 ## iter 120 value 957.793121 ## iter 130 value 957.674562 ## iter 140 value 957.551925 ## iter 150 value 957.408887 ## iter 160 value 957.355590 ## final value 957.344474 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Mumbai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Mumbai_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NYC.html","id":"get-variants-data-for-ny-state","dir":"Articles","previous_headings":"","what":"Get variants data for NY state","title":"Animation of projected weekly cases - New York City","text":"","code":"counties <- c(\"New York\", \"New York City\", \"New York County\", \"Queens County\", \"Bronx County\", \"Bronx\", \"Brooklyn\", \"Manhattan\", \"Queens\", \"Richmond County\") gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_usa <- gisaid_metadata %>% filter(Country == \"USA\") %>% filter(Host == \"Human\") # format metadata gisaid_usa <- FormatGISAIDMetadata(gisaid_usa) gisaid_usa <- gisaid_usa %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") gisaid_NY <- gisaid_usa %>% filter(State == \"New York\") gisaid_NYC <- gisaid_NY %>% filter(District %in% counties) vocs <- GetVOCs() custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_NYC <- gisaid_NYC %>% filter(pangolin_lineage != \"None\") gisaid_NYC <- CollapseLineageToVOCs( variant_df = gisaid_NYC, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NYC.html","id":"get-weekly-cases-for-new-york","dir":"Articles","previous_headings":"","what":"Get weekly cases for New York","title":"Animation of projected weekly cases - New York City","text":"","code":"confirmed <- read_csv(\"https://raw.githubusercontent.com/nychealth/coronavirus-data/master/trends/data-by-day.csv\") %>% select(date_of_interest, CASE_COUNT) colnames(confirmed) <- c(\"date\", \"daily_cases\") confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed$MonthYear <- GetMonthYear(confirmed$date, datefmt = \"%m/%d/%Y\") confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_NYC_weekwise <- SummarizeVariantsWeekwise(gisaid_NYC)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NYC.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - New York City","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_NYC) state_month_counts$State <- \"NYC\" state_month_prevalence <- CountsToPrevalence(state_month_counts) state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NYC.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - New York City","text":"Look cases 2023:","code":"voc_to_keep <- gisaid_NYC_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_NYC_weekwise <- gisaid_NYC_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) newyork_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_NYC_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 48 (33 variable) ## initial value 55214.625758 ## iter 10 value 29139.581037 ## iter 20 value 23305.357080 ## iter 30 value 19393.092597 ## iter 40 value 18429.876753 ## iter 50 value 18002.466926 ## iter 60 value 17769.623406 ## iter 70 value 17601.869697 ## iter 80 value 17520.209522 ## iter 90 value 17064.551526 ## iter 100 value 16553.712437 ## iter 110 value 16460.880818 ## iter 120 value 16440.607424 ## iter 130 value 16384.801717 ## final value 16372.683465 ## converged the_anim <- PlotVariantPrevalenceAnimated(newyork_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New York City by variant\", caption = \"**Source: gisaid.org and NYC Health**
\", date_breaks = \"14 days\") gganimate::anim_save(filename = here::here(\"docs/articles/NYC_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"April 2023\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_NYC_subset <- gisaid_NYC %>% filter(MonthYearCollected > \"April 2023\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_NYC_subset) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 32 (21 variable) ## initial value 5327.529230 ## iter 10 value 4039.737561 ## iter 20 value 3758.946653 ## iter 30 value 3745.574275 ## iter 40 value 3742.924257 ## iter 50 value 3742.879272 ## iter 60 value 3742.872099 ## iter 70 value 3742.859234 ## final value 3742.858440 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New York City by variant\", caption = \"**Source: gisaid.org and NYC Health**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/NYC_animated_2023.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NewYork.html","id":"get-variants-data-for-ny-state","dir":"Articles","previous_headings":"","what":"Get variants data for NY state","title":"Animation of projected weekly cases - New York State","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_usa <- gisaid_metadata %>% filter(Country == \"USA\") %>% filter(Host == \"Human\") # format metadata gisaid_usa <- FormatGISAIDMetadata(gisaid_usa) gisaid_usa <- gisaid_usa %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") gisaid_NY <- gisaid_usa %>% filter(State == \"New York\") vocs <- GetVOCs() custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_NY <- gisaid_NY %>% filter(pangolin_lineage != \"None\") gisaid_NY <- CollapseLineageToVOCs( variant_df = gisaid_NY, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NewYork.html","id":"get-weekly-cases-for-new-york","dir":"Articles","previous_headings":"","what":"Get weekly cases for New York","title":"Animation of projected weekly cases - New York State","text":"","code":"confirmed <- covid19(country = \"USA\", level = 2) %>% filter(administrative_area_level_2 == \"New York\") %>% select(date, confirmed) %>% filter(!is.na(confirmed)) ## We have invested a lot of time and effort in creating COVID-19 Data ## Hub, please cite the following when using it: ## ## Guidotti, E., Ardia, D., (2020), \"COVID-19 Data Hub\", Journal of Open ## Source Software 5(51):2376, doi: 10.21105/joss.02376 ## ## The implementation details and the latest version of the data are ## described in: ## ## Guidotti, E., (2022), \"A worldwide epidemiological database for ## COVID-19 at fine-grained spatial resolution\", Sci Data 9(1):112, doi: ## 10.1038/s41597-022-01245-1 ## To print citations in BibTeX format use: ## > print(citation('COVID19'), bibtex=TRUE) ## ## To hide this message use 'verbose = FALSE'. confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_NY_weekwise <- SummarizeVariantsWeekwise(gisaid_NY)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NewYork.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - New York State","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_NY) state_month_counts$State <- \"New York\" state_month_prevalence <- CountsToPrevalence(state_month_counts) state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NewYork.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - New York State","text":"Look cases february, 2022 :","code":"voc_to_keep <- gisaid_NY_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_NY_weekwise <- gisaid_NY_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) newyork_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_NY_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 60 (42 variable) ## initial value 178463.216303 ## iter 10 value 110808.389214 ## iter 20 value 88792.766438 ## iter 30 value 78241.917607 ## iter 40 value 67543.456232 ## iter 50 value 61216.263926 ## iter 60 value 58689.673063 ## iter 70 value 57757.529140 ## iter 80 value 56176.312847 ## iter 90 value 55591.040458 ## iter 100 value 55504.811975 ## iter 110 value 54280.555653 ## iter 120 value 53849.227614 ## iter 130 value 53668.215286 ## iter 140 value 53481.762178 ## iter 150 value 53463.499277 ## iter 160 value 53361.257589 ## iter 170 value 53324.474898 ## iter 180 value 53298.299091 ## iter 190 value 53294.083035 ## iter 200 value 53290.886651 ## iter 210 value 53288.427050 ## iter 220 value 53279.979997 ## iter 230 value 53273.400947 ## iter 240 value 53253.162964 ## iter 250 value 53249.011605 ## final value 53231.262951 ## converged the_anim <- PlotVariantPrevalenceAnimated(newyork_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New York state by variant\", caption = \"**Source: gisaid.org and covid19nytimes**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/NY_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"December 2022\") %>% group_by(WeekYear) %>% summarise(n = sum(daily_cases)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_NY <- gisaid_NY %>% filter(MonthYearCollected > \"December 2022\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_NY) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 32 (21 variable) ## initial value 57280.296707 ## iter 10 value 35939.840454 ## iter 20 value 28224.458492 ## iter 30 value 27764.149841 ## iter 40 value 27751.341971 ## iter 50 value 27746.918766 ## iter 60 value 27745.334762 ## iter 70 value 27737.987179 ## iter 80 value 27735.997653 ## iter 80 value 27735.997450 ## iter 80 value 27735.997450 ## final value 27735.997450 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New York state by variant\", caption = \"**Source: gisaid.org and covid19nytimes**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/NY_animated_2023.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Pune (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Pune (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"get-monthly-cases-for-pune","dir":"Articles","previous_headings":"","what":"Get monthly cases for Pune","title":"Animation of projected weekly cases - Pune (India)","text":"","code":"pune_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Pune\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(pune_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 Maharashtra Pune 1248 ## 2 May 2020 Maharashtra Pune 6671 ## 3 Jun 2020 Maharashtra Pune 14408 ## 4 Jul 2020 Maharashtra Pune 66904 ## 5 Aug 2020 Maharashtra Pune 85874 ## 6 Sep 2020 Maharashtra Pune 117959"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"plot-monthly-cases-for-pune","dir":"Articles","previous_headings":"Get monthly cases for Pune","what":"Plot monthly cases for Pune","title":"Animation of projected weekly cases - Pune (India)","text":"","code":"p1 <- BarPlot(pune_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Pune (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"get-weekly-cases-for-pune","dir":"Articles","previous_headings":"","what":"Get weekly cases for Pune","title":"Animation of projected weekly cases - Pune (India)","text":"","code":"pune_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Pune\"), rename_country_as_state = TRUE) p2 <- BarPlot(pune_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Pune (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"overall-how-much-has-pune-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Pune","what":"Overall, how much has Pune sequenced over months?","title":"Animation of projected weekly cases - Pune (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"pune_monthly_cases_tmp <- pune_monthly_cases %>% select(MonthYear, value) pune_monthly_cases_tmp$State <- \"India\" pune_monthly_cases_tmp$type <- \"Confirmed\" pune_monthly_cases_tmp <- pune_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = pune_seq_stats, confirmed_long = pune_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Pune (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Pune (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Pune\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Pune\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 44 (30 variable) ## initial value 4793.392650 ## iter 10 value 1607.388605 ## iter 20 value 1284.313749 ## iter 30 value 1239.533601 ## iter 40 value 1219.265985 ## iter 50 value 1205.580407 ## iter 60 value 1195.219552 ## iter 70 value 1194.753611 ## iter 80 value 1192.697987 ## iter 90 value 1191.004598 ## iter 100 value 1185.671136 ## iter 110 value 1176.753804 ## iter 120 value 1171.365227 ## iter 130 value 1161.907692 ## iter 140 value 1161.055949 ## iter 150 value 1160.160012 ## iter 160 value 1159.670495 ## iter 170 value 1159.392813 ## iter 180 value 1159.108705 ## iter 190 value 1158.536508 ## iter 200 value 1158.439808 ## iter 210 value 1158.300930 ## iter 220 value 1158.158490 ## iter 230 value 1158.030425 ## iter 240 value 1156.742681 ## iter 250 value 1155.471827 ## iter 260 value 1155.256422 ## iter 270 value 1154.883456 ## iter 280 value 1154.749265 ## iter 290 value 1154.682121 ## iter 300 value 1154.632839 ## iter 310 value 1154.599805 ## iter 320 value 1154.585209 ## iter 330 value 1154.566819 ## iter 340 value 1154.529109 ## iter 350 value 1154.437031 ## iter 360 value 1154.040740 ## iter 370 value 1153.826571 ## iter 380 value 1153.768968 ## iter 390 value 1153.579584 ## iter 400 value 1153.481629 ## iter 410 value 1153.437427 ## iter 420 value 1153.399009 ## iter 430 value 1153.353200 ## iter 440 value 1153.347983 ## iter 450 value 1153.340026 ## iter 460 value 1153.311195 ## iter 470 value 1153.238427 ## iter 480 value 1152.988156 ## iter 490 value 1152.660676 ## iter 500 value 1152.652236 ## iter 510 value 1152.405604 ## iter 520 value 1152.371884 ## iter 530 value 1152.338089 ## iter 540 value 1152.256812 ## iter 550 value 1152.138942 ## iter 560 value 1152.137819 ## iter 570 value 1152.124007 ## iter 580 value 1152.113174 ## iter 590 value 1152.089450 ## iter 600 value 1152.064434 ## iter 610 value 1152.017189 ## iter 620 value 1151.995781 ## iter 630 value 1151.984486 ## iter 640 value 1151.978196 ## iter 650 value 1151.955216 ## iter 660 value 1151.918562 ## iter 670 value 1151.825829 ## iter 680 value 1151.819673 ## iter 690 value 1151.762465 ## iter 700 value 1151.745721 ## iter 710 value 1151.716560 ## iter 720 value 1151.692259 ## iter 730 value 1151.681678 ## iter 740 value 1151.643660 ## iter 750 value 1151.618987 ## iter 760 value 1151.615008 ## iter 770 value 1151.584114 ## iter 780 value 1151.562771 ## iter 790 value 1151.447412 ## iter 800 value 1151.426108 ## iter 810 value 1151.336436 ## iter 820 value 1151.318859 ## iter 830 value 1151.294236 ## iter 840 value 1151.273286 ## iter 850 value 1151.232309 ## final value 1151.228050 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Pune (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Pune_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Pune\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Pune\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 36 (24 variable) ## initial value 2115.927268 ## iter 10 value 988.912285 ## iter 20 value 818.505491 ## iter 30 value 795.963652 ## iter 40 value 786.736094 ## iter 50 value 782.636287 ## iter 60 value 782.474836 ## iter 70 value 781.189386 ## iter 80 value 779.502862 ## iter 90 value 778.867916 ## iter 100 value 778.641017 ## iter 110 value 778.491436 ## iter 120 value 778.292726 ## iter 130 value 778.137265 ## iter 140 value 777.977857 ## iter 150 value 777.841247 ## iter 160 value 777.830332 ## iter 170 value 777.724340 ## iter 180 value 777.648143 ## iter 190 value 777.588056 ## iter 200 value 777.479787 ## iter 210 value 777.401291 ## iter 220 value 777.369784 ## iter 230 value 777.323831 ## iter 240 value 777.289664 ## final value 777.278227 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Pune (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Pune_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Pune\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Pune\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 36 (24 variable) ## initial value 2115.927268 ## iter 10 value 988.912285 ## iter 20 value 818.505491 ## iter 30 value 795.963652 ## iter 40 value 786.736094 ## iter 50 value 782.636287 ## iter 60 value 782.474836 ## iter 70 value 781.189386 ## iter 80 value 779.502862 ## iter 90 value 778.867916 ## iter 100 value 778.641017 ## iter 110 value 778.491436 ## iter 120 value 778.292726 ## iter 130 value 778.137265 ## iter 140 value 777.977857 ## iter 150 value 777.841247 ## iter 160 value 777.830332 ## iter 170 value 777.724340 ## iter 180 value 777.648143 ## iter 190 value 777.588056 ## iter 200 value 777.479787 ## iter 210 value 777.401291 ## iter 220 value 777.369784 ## iter 230 value 777.323831 ## iter 240 value 777.289664 ## final value 777.278227 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Pune (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Pune_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Singapore.html","id":"get-variants-data-for-singapore","dir":"Articles","previous_headings":"","what":"Get variants data for Singapore","title":"Animation of projected weekly cases - Singapore","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_singapore <- gisaid_metadata %>% filter(Country == \"Singapore\") %>% filter(Host == \"Human\") # format metadata gisaid_singapore <- FormatGISAIDMetadata(gisaid_singapore) %>% filter(pangolin_lineage != \"Unassigned\") gisaid_singapore <- gisaid_singapore %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") %>% filter(State != \"Unknown\") vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_singapore <- gisaid_singapore %>% filter(pangolin_lineage != \"None\") %>% filter(!is.na(MonthYearCollected)) %>% filter(pangolin_lineage != \"Unassigned\") gisaid_singapore <- CollapseLineageToVOCs( variant_df = gisaid_singapore, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Singapore.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Singapore","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_singapore) state_month_counts$State <- \"Singapore\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Singapore.html","id":"get-weekly-cases-for-singapore","dir":"Articles","previous_headings":"","what":"Get weekly cases for Singapore","title":"Animation of projected weekly cases - Singapore","text":"","code":"confirmed.tmp <- COVID19::covid19(country = \"Singapore\", verbose = FALSE, level = 2) %>% select(date, administrative_area_level_2, confirmed) %>% rename(State = administrative_area_level_2) confirmed <- COVID19::covid19(country = \"Singapore\", verbose = FALSE) %>% select(date, confirmed) %>% filter(!is.na(confirmed)) confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_singapore_weekwise <- SummarizeVariantsWeekwise(gisaid_singapore)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Singapore.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Singapore","text":"Look cases October,2021 :","code":"voc_to_keep <- gisaid_singapore_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_singapore_weekwise <- gisaid_singapore_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_singapore_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 32 (21 variable) ## initial value 30158.140679 ## iter 10 value 16516.832744 ## iter 20 value 14331.486068 ## iter 30 value 13078.794244 ## iter 40 value 13029.575883 ## iter 50 value 13009.661322 ## iter 60 value 12971.143371 ## iter 70 value 12807.532459 ## iter 80 value 12657.104555 ## iter 90 value 12651.583080 ## iter 100 value 12650.748373 ## iter 110 value 12611.948642 ## iter 120 value 12609.882074 ## iter 130 value 12590.077969 ## iter 140 value 12589.408015 ## iter 150 value 12585.965358 ## iter 160 value 12584.368535 ## iter 170 value 12582.526603 ## iter 180 value 12580.333649 ## iter 190 value 12578.811574 ## iter 200 value 12578.099224 ## iter 210 value 12576.696484 ## iter 220 value 12574.231520 ## iter 230 value 12573.676667 ## iter 240 value 12573.140207 ## iter 250 value 12572.562160 ## iter 260 value 12571.707944 ## iter 270 value 12571.573981 ## iter 280 value 12571.385233 ## iter 290 value 12570.891482 ## iter 300 value 12570.506819 ## iter 310 value 12569.866015 ## iter 320 value 12569.782789 ## iter 330 value 12569.751877 ## iter 340 value 12568.890149 ## final value 12568.713644 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Singapore by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Singapore_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"December 2021\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_singapore_subset <- gisaid_singapore %>% filter(MonthYearCollected > \"December 2021\") gisaid_singapore_weekwise <- SummarizeVariantsWeekwise(gisaid_singapore_subset) voc_to_keep <- gisaid_singapore_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_singapore_weekwise <- gisaid_singapore_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_singapore_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 28 (18 variable) ## initial value 25092.511372 ## iter 10 value 14112.902402 ## iter 20 value 12716.788665 ## iter 30 value 12481.379705 ## iter 40 value 12475.006271 ## iter 50 value 12473.409429 ## iter 60 value 12463.971609 ## iter 70 value 12461.373623 ## iter 80 value 12460.698322 ## iter 90 value 12460.557795 ## iter 100 value 12460.290441 ## iter 110 value 12459.855465 ## iter 120 value 12459.441354 ## iter 130 value 12459.330412 ## iter 140 value 12459.044983 ## final value 12458.983235 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Singapore by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Singapore_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-SouthAfrica.html","id":"get-variants-data-for-south-africa","dir":"Articles","previous_headings":"","what":"Get variants data for South Africa","title":"Animation of projected weekly cases - South Africa","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_sa <- gisaid_metadata %>% filter(Country == \"South Africa\") %>% filter(Host == \"Human\") # format metadata gisaid_sa <- FormatGISAIDMetadata(gisaid_sa) gisaid_sa$State <- CleanSouthAfricanStates(gisaid_sa$State) gisaid_sa <- gisaid_sa %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") %>% filter(State != \"Unknown\") vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_sa <- gisaid_sa %>% filter(pangolin_lineage != \"None\") %>% filter(!is.na(MonthYearCollected)) %>% filter(pangolin_lineage != \"Unassigned\") gisaid_sa <- CollapseLineageToVOCs( variant_df = gisaid_sa, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-SouthAfrica.html","id":"get-weekly-cases-for-south-africa","dir":"Articles","previous_headings":"","what":"Get weekly cases for South Africa","title":"Animation of projected weekly cases - South Africa","text":"","code":"confirmed <- COVID19::covid19(country = \"South Africa\", verbose = FALSE) %>% select(date, confirmed) %>% filter(!is.na(confirmed)) confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_sa_weekwise <- SummarizeVariantsWeekwise(gisaid_sa)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-SouthAfrica.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - South Africa","text":"Look cases December, 2021 :","code":"voc_to_keep <- gisaid_sa_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_sa_weekwise <- gisaid_sa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_sa_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 20 (12 variable) ## initial value 16968.303911 ## iter 10 value 10346.146340 ## iter 20 value 6497.476017 ## iter 30 value 5547.021101 ## iter 40 value 5401.510988 ## iter 50 value 5021.539719 ## iter 60 value 4973.058980 ## iter 70 value 4965.274836 ## iter 80 value 4953.400524 ## iter 90 value 4941.585588 ## iter 100 value 4940.342874 ## iter 110 value 4938.760390 ## iter 120 value 4930.848893 ## final value 4928.790665 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in South Africa by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/SA_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"December 2021\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_sa_subset <- gisaid_sa %>% filter(MonthYearCollected > \"December 2021\") gisaid_sa_weekwise <- SummarizeVariantsWeekwise(gisaid_sa_subset) voc_to_keep <- gisaid_sa_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_sa_weekwise <- gisaid_sa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_sa_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 12 (6 variable) ## initial value 5955.577217 ## iter 10 value 3766.216349 ## iter 20 value 3430.487643 ## final value 3425.483745 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in South Africa by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/SA_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq) DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"get-monthly-cases-for-tamilnadu","dir":"Articles","previous_headings":"","what":"Get monthly cases for Tamilnadu","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"Tamilnadu_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == \"Tamil Nadu\") ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Tamilnadu_monthly_cases) ## MonthYear State value type ## 1 Mar 2020 Tamil Nadu 124 Confirmed ## 2 Apr 2020 Tamil Nadu 2199 Confirmed ## 3 May 2020 Tamil Nadu 20010 Confirmed ## 4 Jun 2020 Tamil Nadu 67834 Confirmed ## 5 Jul 2020 Tamil Nadu 155692 Confirmed ## 6 Aug 2020 Tamil Nadu 182182 Confirmed"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"plot-monthly-cases-for-tamilnadu","dir":"Articles","previous_headings":"Get monthly cases for Tamilnadu","what":"Plot monthly cases for Tamilnadu","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"p1 <- BarPlot(Tamilnadu_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Tamilnadu (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"get-weekly-cases-for-tamilnadu","dir":"Articles","previous_headings":"","what":"Get weekly cases for Tamilnadu","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"Tamilnadu_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(State == \"Tamil Nadu\"), rename_country_as_state = TRUE) p2 <- BarPlot(Tamilnadu_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Tamilnadu (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"overall-how-much-has-tamilnadu-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Tamilnadu","what":"Overall, how much has Tamilnadu sequenced over months?","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Tamilnadu_monthly_cases_tmp <- Tamilnadu_monthly_cases %>% select(MonthYear, value) Tamilnadu_monthly_cases_tmp$State <- \"India\" Tamilnadu_monthly_cases_tmp$type <- \"Confirmed\" Tamilnadu_monthly_cases_tmp <- Tamilnadu_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Tamilnadu_seq_stats, confirmed_long = Tamilnadu_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Tamilnadu (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(State == \"Tamil Nadu\")) state_month_counts$State <- \"Tamil Nadu\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(State == \"Tamil Nadu\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(State %in% c(\"Tamil Nadu\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 48 (33 variable) ## initial value 8157.948531 ## iter 10 value 3768.646072 ## iter 20 value 3108.353974 ## iter 30 value 3039.670117 ## iter 40 value 2989.981150 ## iter 50 value 2961.180908 ## iter 60 value 2949.857467 ## iter 70 value 2941.070828 ## iter 80 value 2937.737045 ## iter 90 value 2935.686791 ## iter 100 value 2928.947787 ## iter 110 value 2925.676221 ## iter 120 value 2920.315436 ## iter 130 value 2912.909558 ## iter 140 value 2906.693369 ## iter 150 value 2904.764715 ## iter 160 value 2901.429874 ## iter 170 value 2898.685010 ## iter 180 value 2898.114163 ## iter 190 value 2897.274910 ## iter 200 value 2895.432057 ## iter 210 value 2894.632943 ## iter 220 value 2894.394044 ## iter 230 value 2893.136563 ## iter 240 value 2892.920048 ## iter 250 value 2892.630820 ## iter 260 value 2891.984015 ## final value 2891.350401 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Tamil Nadu (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Tamilnadu_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(State %in% c(\"Tamil Nadu\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Tamil Nadu\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 5016.396911 ## iter 10 value 3046.283757 ## iter 20 value 2631.109850 ## iter 30 value 2536.669333 ## iter 40 value 2512.966877 ## iter 50 value 2504.757790 ## iter 60 value 2496.599974 ## iter 70 value 2496.381698 ## iter 80 value 2496.010031 ## iter 90 value 2492.373240 ## iter 100 value 2491.814591 ## iter 110 value 2490.558512 ## iter 120 value 2489.516119 ## iter 130 value 2488.342274 ## iter 140 value 2487.703928 ## iter 150 value 2487.505173 ## iter 160 value 2487.442206 ## iter 170 value 2487.032792 ## iter 180 value 2486.723644 ## iter 190 value 2486.422689 ## iter 200 value 2486.375277 ## iter 210 value 2486.337143 ## iter 220 value 2486.251379 ## iter 230 value 2486.227673 ## iter 240 value 2486.194904 ## iter 250 value 2486.131369 ## iter 260 value 2486.121236 ## iter 270 value 2486.111113 ## iter 280 value 2486.099001 ## iter 290 value 2486.061344 ## iter 300 value 2486.005314 ## iter 310 value 2485.728155 ## iter 320 value 2485.701858 ## iter 330 value 2485.639521 ## iter 340 value 2485.624196 ## iter 350 value 2485.607884 ## iter 360 value 2485.599377 ## final value 2485.590617 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Tamil Nadu (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Tamilnadu_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(State %in% c(\"Tamil Nadu\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Tamil Nadu\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 5016.396911 ## iter 10 value 3046.283757 ## iter 20 value 2631.109850 ## iter 30 value 2536.669333 ## iter 40 value 2512.966877 ## iter 50 value 2504.757790 ## iter 60 value 2496.599974 ## iter 70 value 2496.381698 ## iter 80 value 2496.010031 ## iter 90 value 2492.373240 ## iter 100 value 2491.814591 ## iter 110 value 2490.558512 ## iter 120 value 2489.516119 ## iter 130 value 2488.342274 ## iter 140 value 2487.703928 ## iter 150 value 2487.505173 ## iter 160 value 2487.442206 ## iter 170 value 2487.032792 ## iter 180 value 2486.723644 ## iter 190 value 2486.422689 ## iter 200 value 2486.375277 ## iter 210 value 2486.337143 ## iter 220 value 2486.251379 ## iter 230 value 2486.227673 ## iter 240 value 2486.194904 ## iter 250 value 2486.131369 ## iter 260 value 2486.121236 ## iter 270 value 2486.111113 ## iter 280 value 2486.099001 ## iter 290 value 2486.061344 ## iter 300 value 2486.005314 ## iter 310 value 2485.728155 ## iter 320 value 2485.701858 ## iter 330 value 2485.639521 ## iter 340 value 2485.624196 ## iter 350 value 2485.607884 ## iter 360 value 2485.599377 ## final value 2485.590617 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Tamil Nadu (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Tamilnadu_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq) DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"get-monthly-cases-for-telangana","dir":"Articles","previous_headings":"","what":"Get monthly cases for Telangana","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"Telangana_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == \"Telangana\") ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Telangana_monthly_cases) ## MonthYear State value type ## 1 Mar 2020 Telangana 97 Confirmed ## 2 Apr 2020 Telangana 941 Confirmed ## 3 May 2020 Telangana 1660 Confirmed ## 4 Jun 2020 Telangana 13641 Confirmed ## 5 Jul 2020 Telangana 46364 Confirmed ## 6 Aug 2020 Telangana 61750 Confirmed"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"plot-monthly-cases-for-telangana","dir":"Articles","previous_headings":"Get monthly cases for Telangana","what":"Plot monthly cases for Telangana","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"p1 <- BarPlot(Telangana_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Telangana (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"get-weekly-cases-for-telangana","dir":"Articles","previous_headings":"","what":"Get weekly cases for Telangana","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"Telangana_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(State == \"Telangana\"), rename_country_as_state = TRUE) p2 <- BarPlot(Telangana_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Telangana (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"overall-how-much-has-telangana-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Telangana","what":"Overall, how much has Telangana sequenced over months?","title":"Animation of projected weekly cases - Telangana (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Telangana_monthly_cases_tmp <- Telangana_monthly_cases %>% select(MonthYear, value) Telangana_monthly_cases_tmp$State <- \"India\" Telangana_monthly_cases_tmp$type <- \"Confirmed\" Telangana_monthly_cases_tmp <- Telangana_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Telangana_seq_stats, confirmed_long = Telangana_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Telangana (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(State == \"Telangana\")) state_month_counts$State <- \"Telangana\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Telangana (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(State == \"Telangana\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(State %in% c(\"Telangana\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 56 (39 variable) ## initial value 5602.718711 ## iter 10 value 2116.013341 ## iter 20 value 1323.255038 ## iter 30 value 1115.280413 ## iter 40 value 1043.040021 ## iter 50 value 1023.330161 ## iter 60 value 1018.010729 ## iter 70 value 1014.730107 ## iter 80 value 1011.514949 ## iter 90 value 1010.750265 ## iter 100 value 1008.166736 ## iter 110 value 1007.045913 ## iter 120 value 1005.439054 ## iter 130 value 998.508420 ## iter 140 value 993.102449 ## iter 150 value 982.973581 ## iter 160 value 976.637833 ## iter 170 value 976.299818 ## iter 180 value 975.071266 ## iter 190 value 974.453792 ## iter 200 value 974.246523 ## iter 210 value 973.982788 ## iter 220 value 973.876101 ## iter 230 value 973.416835 ## iter 240 value 972.342944 ## iter 250 value 972.263976 ## iter 260 value 972.110309 ## iter 270 value 971.976590 ## iter 280 value 971.755581 ## iter 290 value 971.565524 ## iter 300 value 971.331528 ## iter 310 value 971.181027 ## iter 320 value 971.072909 ## iter 330 value 970.986834 ## iter 340 value 970.938644 ## iter 350 value 970.864689 ## iter 360 value 970.705833 ## iter 370 value 970.377396 ## iter 380 value 969.984818 ## iter 390 value 969.584304 ## iter 400 value 969.124611 ## iter 410 value 969.043129 ## iter 420 value 968.902796 ## iter 430 value 968.694297 ## iter 440 value 968.622680 ## iter 450 value 968.530160 ## iter 460 value 968.205026 ## iter 470 value 968.071484 ## iter 480 value 967.979301 ## iter 490 value 967.914327 ## iter 500 value 967.855913 ## iter 510 value 967.642718 ## iter 520 value 967.207897 ## iter 530 value 967.070703 ## iter 540 value 966.896199 ## iter 550 value 966.852812 ## iter 560 value 966.729519 ## iter 570 value 966.690269 ## iter 580 value 966.648115 ## iter 590 value 966.589533 ## iter 600 value 966.517249 ## iter 610 value 966.408093 ## iter 620 value 966.292126 ## iter 630 value 965.882591 ## iter 640 value 965.494561 ## iter 650 value 965.420995 ## iter 660 value 965.228104 ## iter 670 value 965.189451 ## iter 680 value 964.885146 ## iter 690 value 964.616141 ## iter 700 value 964.364620 ## iter 710 value 964.290974 ## final value 964.288343 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Telangana (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Telangana_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(State %in% c(\"Telangana\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Telangana\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 1079.052873 ## iter 10 value 625.634477 ## iter 20 value 547.166139 ## iter 30 value 538.627557 ## iter 40 value 533.593782 ## iter 50 value 531.894799 ## iter 60 value 529.945360 ## iter 70 value 529.863479 ## iter 80 value 529.687090 ## iter 90 value 529.618896 ## iter 100 value 529.592203 ## iter 110 value 529.517234 ## iter 120 value 529.390010 ## iter 130 value 529.371096 ## iter 140 value 529.342747 ## iter 150 value 529.306471 ## iter 160 value 529.295707 ## iter 170 value 529.212047 ## iter 180 value 529.156862 ## iter 190 value 529.149834 ## iter 200 value 529.138589 ## iter 210 value 529.121713 ## iter 220 value 529.090372 ## iter 230 value 529.050669 ## iter 240 value 529.038350 ## iter 250 value 529.034447 ## iter 260 value 529.033852 ## iter 270 value 529.029614 ## iter 280 value 529.020593 ## iter 290 value 529.003070 ## iter 300 value 528.976327 ## iter 310 value 528.957211 ## iter 320 value 528.955473 ## iter 330 value 528.949594 ## iter 340 value 528.935558 ## iter 350 value 528.915221 ## iter 360 value 528.899088 ## iter 370 value 528.891947 ## iter 380 value 528.877815 ## iter 390 value 528.870698 ## iter 400 value 528.868620 ## iter 410 value 528.862931 ## iter 420 value 528.850248 ## iter 430 value 528.830575 ## final value 528.828049 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Telangana (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Telangana_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(State %in% c(\"Telangana\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Telangana\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 1079.052873 ## iter 10 value 625.634477 ## iter 20 value 547.166139 ## iter 30 value 538.627557 ## iter 40 value 533.593782 ## iter 50 value 531.894799 ## iter 60 value 529.945360 ## iter 70 value 529.863479 ## iter 80 value 529.687090 ## iter 90 value 529.618896 ## iter 100 value 529.592203 ## iter 110 value 529.517234 ## iter 120 value 529.390010 ## iter 130 value 529.371096 ## iter 140 value 529.342747 ## iter 150 value 529.306471 ## iter 160 value 529.295707 ## iter 170 value 529.212047 ## iter 180 value 529.156862 ## iter 190 value 529.149834 ## iter 200 value 529.138589 ## iter 210 value 529.121713 ## iter 220 value 529.090372 ## iter 230 value 529.050669 ## iter 240 value 529.038350 ## iter 250 value 529.034447 ## iter 260 value 529.033852 ## iter 270 value 529.029614 ## iter 280 value 529.020593 ## iter 290 value 529.003070 ## iter 300 value 528.976327 ## iter 310 value 528.957211 ## iter 320 value 528.955473 ## iter 330 value 528.949594 ## iter 340 value 528.935558 ## iter 350 value 528.915221 ## iter 360 value 528.899088 ## iter 370 value 528.891947 ## iter 380 value 528.877815 ## iter 390 value 528.870698 ## iter 400 value 528.868620 ## iter 410 value 528.862931 ## iter 420 value 528.850248 ## iter 430 value 528.830575 ## final value 528.828049 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Telangana (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Telangana_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-UK.html","id":"get-variants-data-for-uk","dir":"Articles","previous_headings":"","what":"Get variants data for UK","title":"Animation of projected weekly cases - United Kingdom","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_uk <- gisaid_metadata %>% filter(Country == \"United Kingdom\") %>% filter(Host == \"Human\") # format metadata gisaid_uk <- FormatGISAIDMetadata(gisaid_uk) gisaid_uk <- gisaid_uk %>% filter(State != \"\") gisaid_uk <- gisaid_uk %>% filter(pangolin_lineage != \"Unknown\") %>% arrange(State, MonthYearCollected) %>% filter(!is.na(MonthYearCollected)) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_uk <- CollapseLineageToVOCs( variant_df = gisaid_uk, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-UK.html","id":"get-daily-case-data","dir":"Articles","previous_headings":"","what":"Get daily case data","title":"Animation of projected weekly cases - United Kingdom","text":"","code":"if (FALSE) { cases.struct <- list( date = \"date\", areaName = \"areaName\", newCasesByPublishDate = \"newCasesByPublishDate\" ) all_nations <- c( \"areaType=nation\" ) cases_data <- get_data( filters = all_nations, structure = cases.struct ) %>% rename(new_cases = newCasesByPublishDate) confirmed <- cases_data %>% arrange(date) %>% group_by(date) %>% summarise(daily_cases = sum(new_cases)) } confirmed <- covid19(country = \"United Kingdom\", level = 1) %>% select(date, confirmed) %>% filter(!is.na(confirmed)) ## We have invested a lot of time and effort in creating COVID-19 Data ## Hub, please cite the following when using it: ## ## Guidotti, E., Ardia, D., (2020), \"COVID-19 Data Hub\", Journal of Open ## Source Software 5(51):2376, doi: 10.21105/joss.02376 ## ## The implementation details and the latest version of the data are ## described in: ## ## Guidotti, E., (2022), \"A worldwide epidemiological database for ## COVID-19 at fine-grained spatial resolution\", Sci Data 9(1):112, doi: ## 10.1038/s41597-022-01245-1 ## To print citations in BibTeX format use: ## > print(citation('COVID19'), bibtex=TRUE) ## ## To hide this message use 'verbose = FALSE'. confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_uk_weekwise <- SummarizeVariantsWeekwise(gisaid_uk)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-UK.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - United Kingdom","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_uk) state_month_counts$State <- \"UK\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-UK.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - United Kingdom","text":"Look cases October,2021 :","code":"voc_to_keep <- gisaid_uk_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_uk_weekwise <- gisaid_uk_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) uk_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_uk_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 1145076.521200 ## iter 10 value 485997.744438 ## iter 20 value 473212.004997 ## iter 30 value 387614.144166 ## iter 40 value 243884.767538 ## iter 50 value 197283.772587 ## iter 60 value 177841.735048 ## iter 70 value 175198.420269 ## iter 80 value 166120.758334 ## iter 90 value 160794.210067 ## iter 100 value 160143.439582 ## iter 110 value 159830.974670 ## iter 120 value 159337.299298 ## iter 130 value 159317.981379 ## iter 140 value 159314.996395 ## iter 150 value 159252.397810 ## iter 160 value 159204.681522 ## iter 170 value 159174.250686 ## iter 180 value 159140.698943 ## iter 190 value 159081.345984 ## iter 200 value 159075.040092 ## iter 210 value 159067.944810 ## iter 220 value 159062.216124 ## iter 230 value 159055.451067 ## iter 240 value 159031.071900 ## iter 250 value 159028.143649 ## iter 260 value 159027.718193 ## iter 270 value 159025.053279 ## iter 280 value 159021.058242 ## iter 290 value 159018.631667 ## iter 300 value 159015.772920 ## final value 159011.322634 ## converged the_anim <- PlotVariantPrevalenceAnimated(uk_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New York state by variant\", caption = \"**Source: gisaid.org and gov.uk**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/UK_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"December 2022\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_uk <- gisaid_uk %>% filter(MonthYearCollected > \"December 2022\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_uk) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 32 (21 variable) ## initial value 168324.554474 ## iter 10 value 98384.643169 ## iter 20 value 90710.243078 ## iter 30 value 83891.130429 ## iter 40 value 83659.625820 ## iter 50 value 83659.028147 ## iter 60 value 83656.457527 ## iter 70 value 83651.841962 ## iter 80 value 83648.439809 ## final value 83648.396078 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in the UK by variant\", caption = \"**Source: gisaid.org and gov.uk**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/UK_animated_2023.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-USA.html","id":"get-variants-data-for-usa","dir":"Articles","previous_headings":"","what":"Get variants data for USA","title":"Animation of projected weekly cases - USA","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_usa <- gisaid_metadata %>% filter(Country == \"USA\") %>% filter(Host == \"Human\") # format metadata gisaid_usa <- FormatGISAIDMetadata(gisaid_usa) gisaid_usa <- gisaid_usa %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") vocs <- GetVOCs() custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_usa <- gisaid_usa %>% filter(pangolin_lineage != \"None\") gisaid_usa <- CollapseLineageToVOCs( variant_df = gisaid_usa, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-USA.html","id":"get-weekly-cases-for-usa","dir":"Articles","previous_headings":"","what":"Get weekly cases for USA","title":"Animation of projected weekly cases - USA","text":"","code":"confirmed <- covid19(country = \"USA\", level = 1) %>% select(date, confirmed) %>% filter(!is.na(confirmed)) #> We have invested a lot of time and effort in creating COVID-19 Data #> Hub, please cite the following when using it: #> #> Guidotti, E., Ardia, D., (2020), \"COVID-19 Data Hub\", Journal of Open #> Source Software 5(51):2376, doi: 10.21105/joss.02376 #> #> The implementation details and the latest version of the data are #> described in: #> #> Guidotti, E., (2022), \"A worldwide epidemiological database for #> COVID-19 at fine-grained spatial resolution\", Sci Data 9(1):112, doi: #> 10.1038/s41597-022-01245-1 #> To print citations in BibTeX format use: #> > print(citation('COVID19'), bibtex=TRUE) #> #> To hide this message use 'verbose = FALSE'. confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_usa_weekwise <- SummarizeVariantsWeekwise(gisaid_usa)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-USA.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - USA","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_usa) state_month_counts$State <- \"USA\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-USA.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - USA","text":"Look cases October,2021 : Look cases past weeks","code":"voc_to_keep <- gisaid_usa_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_usa_weekwise <- gisaid_usa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) usa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_usa_weekwise, confirmed_subset_dateweekwise_long) #> # weights: 72 (51 variable) #> initial value 2495278.171194 #> iter 10 value 1182062.190228 #> iter 20 value 1031630.455254 #> iter 30 value 1006328.427081 #> iter 40 value 887432.042186 #> iter 50 value 823408.467787 #> iter 60 value 731702.542749 #> iter 70 value 688589.350021 #> iter 80 value 667644.772124 #> iter 90 value 646284.095241 #> iter 100 value 638642.534703 #> iter 110 value 635466.870818 #> iter 120 value 634394.896422 #> iter 130 value 603193.762862 #> iter 140 value 584864.995593 #> iter 150 value 580021.328879 #> iter 160 value 579062.764966 #> iter 170 value 578020.409465 #> iter 180 value 577737.545573 #> iter 190 value 577437.698244 #> iter 200 value 577180.365748 #> iter 210 value 577124.338130 #> iter 220 value 577122.387805 #> iter 230 value 577118.978013 #> iter 240 value 577086.812185 #> iter 250 value 577034.927718 #> iter 260 value 576993.965164 #> iter 270 value 576950.775256 #> iter 280 value 576932.004895 #> iter 290 value 576918.730294 #> iter 300 value 576851.701047 #> iter 310 value 576824.749733 #> iter 310 value 576824.746197 #> final value 576824.746197 #> converged the_anim <- PlotVariantPrevalenceAnimated(usa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in the USA by variant\", caption = \"**Source: gisaid.org and covid19nytimes**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/USA_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"Dec 2021\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_usa_subset <- gisaid_usa %>% filter(MonthYearCollected > \"Dec 2021\") gisaid_usa_weekwise <- SummarizeVariantsWeekwise(gisaid_usa_subset) voc_to_keep <- gisaid_usa_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_usa_weekwise <- gisaid_usa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) usa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_usa_weekwise, confirmed_subset_dateweekwise_long) #> # weights: 40 (27 variable) #> initial value 1165810.345508 #> iter 10 value 588569.431779 #> iter 20 value 562448.609722 #> iter 30 value 496569.665855 #> iter 40 value 453119.138750 #> iter 50 value 448489.673764 #> iter 60 value 448158.513227 #> iter 70 value 448026.648539 #> iter 80 value 446118.466610 #> iter 90 value 445853.639244 #> iter 100 value 445825.732024 #> iter 110 value 445803.279837 #> final value 445803.265546 #> converged the_anim <- PlotVariantPrevalenceAnimated(usa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in the USA by variant\", caption = \"**Source: gisaid.org and covid19nytimes**
\") #> `geom_line()`: Each group consists of only one observation. #> ℹ Do you need to adjust the group aesthetic? #> `geom_line()`: Each group consists of only one observation. #> ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/USA_animated_2021.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"December 2022\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_usa_subset <- gisaid_usa %>% filter(MonthYearCollected > \"December 2022\") gisaid_usa_weekwise <- SummarizeVariantsWeekwise(gisaid_usa_subset) voc_to_keep <- gisaid_usa_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_usa_weekwise <- gisaid_usa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) usa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_usa_weekwise, confirmed_subset_dateweekwise_long) #> # weights: 36 (24 variable) #> initial value 619144.927525 #> iter 10 value 359056.475923 #> iter 20 value 343328.894628 #> iter 30 value 285959.651323 #> iter 40 value 284538.967143 #> iter 50 value 284425.622645 #> iter 60 value 284419.973029 #> iter 70 value 284363.168858 #> final value 284312.930723 #> converged the_anim <- PlotVariantPrevalenceAnimated(usa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in the USA by variant\", caption = \"**Source: gisaid.org and covid19nytimes**
\") #> `geom_line()`: Each group consists of only one observation. #> ℹ Do you need to adjust the group aesthetic? #> `geom_line()`: Each group consists of only one observation. #> ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/USA_animated_2023.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Kolkata (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_08.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Kolkata (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"get-monthly-cases-for-kolkata","dir":"Articles","previous_headings":"","what":"Get monthly cases for Kolkata","title":"Animation of projected weekly cases - Kolkata (India)","text":"","code":"chennai_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Kolkata\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(chennai_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 West Bengal Kolkata 184 ## 2 May 2020 West Bengal Kolkata 1941 ## 3 Jun 2020 West Bengal Kolkata 3859 ## 4 Jul 2020 West Bengal Kolkata 15655 ## 5 Aug 2020 West Bengal Kolkata 18518 ## 6 Sep 2020 West Bengal Kolkata 16255"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"plot-monthly-cases-for-kolkata","dir":"Articles","previous_headings":"Get monthly cases for Kolkata","what":"Plot monthly cases for Kolkata","title":"Animation of projected weekly cases - Kolkata (India)","text":"","code":"p1 <- BarPlot(chennai_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Kolkata (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"get-weekly-cases-for-kolkata","dir":"Articles","previous_headings":"","what":"Get weekly cases for Kolkata","title":"Animation of projected weekly cases - Kolkata (India)","text":"","code":"chennai_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Kolkata\"), rename_country_as_state = TRUE) p2 <- BarPlot(chennai_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Kolkata (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"overall-how-much-has-kolkata-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Kolkata","what":"Overall, how much has Kolkata sequenced over months?","title":"Animation of projected weekly cases - Kolkata (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"chennai_monthly_cases_tmp <- chennai_monthly_cases %>% select(MonthYear, value) chennai_monthly_cases_tmp$State <- \"India\" chennai_monthly_cases_tmp$type <- \"Confirmed\" chennai_monthly_cases_tmp <- chennai_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = chennai_seq_stats, confirmed_long = chennai_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Kolkata (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Kolkata (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Kolkata\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Kolkata\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 32 (21 variable) ## initial value 1750.889778 ## iter 10 value 626.748193 ## iter 20 value 536.254647 ## iter 30 value 530.811950 ## iter 40 value 509.760387 ## iter 50 value 500.801720 ## iter 60 value 494.314745 ## iter 70 value 485.956165 ## iter 80 value 476.450922 ## iter 90 value 471.247783 ## iter 100 value 469.841441 ## iter 110 value 468.964896 ## iter 120 value 468.741935 ## iter 130 value 467.011407 ## iter 140 value 466.767401 ## iter 150 value 466.296016 ## iter 160 value 466.142023 ## iter 170 value 465.389155 ## iter 180 value 465.274039 ## iter 190 value 465.081620 ## iter 200 value 465.036608 ## iter 210 value 464.923539 ## iter 220 value 464.564645 ## iter 230 value 464.271183 ## iter 240 value 464.232019 ## iter 250 value 464.192138 ## iter 260 value 463.990355 ## iter 270 value 463.820082 ## iter 280 value 463.786740 ## iter 290 value 463.755574 ## iter 300 value 463.568585 ## iter 310 value 463.553375 ## iter 320 value 463.495724 ## iter 330 value 463.409038 ## iter 340 value 463.361392 ## iter 350 value 463.338901 ## iter 360 value 463.311517 ## iter 370 value 463.236557 ## iter 380 value 463.193102 ## iter 390 value 463.139024 ## iter 400 value 463.088294 ## iter 410 value 463.034732 ## iter 420 value 462.975124 ## iter 430 value 462.937903 ## iter 440 value 462.904688 ## iter 450 value 462.886551 ## iter 460 value 462.828593 ## iter 470 value 462.755027 ## iter 480 value 462.738014 ## iter 490 value 462.653073 ## iter 500 value 462.598924 ## iter 510 value 462.584119 ## iter 520 value 462.496394 ## iter 530 value 462.409700 ## iter 540 value 462.398562 ## iter 550 value 462.356787 ## iter 560 value 462.244444 ## iter 570 value 462.228713 ## iter 580 value 462.135241 ## iter 590 value 462.092795 ## iter 600 value 462.080165 ## iter 610 value 462.061369 ## iter 620 value 462.053575 ## iter 630 value 462.013013 ## iter 640 value 461.920232 ## iter 650 value 461.903857 ## iter 660 value 461.871025 ## iter 670 value 461.803031 ## iter 680 value 461.776690 ## iter 690 value 461.761482 ## iter 700 value 461.756041 ## iter 710 value 461.742347 ## iter 720 value 461.716431 ## iter 730 value 461.662583 ## iter 740 value 461.625030 ## iter 750 value 461.582530 ## iter 760 value 461.535611 ## iter 770 value 461.509396 ## iter 780 value 461.499547 ## iter 790 value 461.488872 ## iter 800 value 461.471609 ## iter 810 value 461.431146 ## iter 820 value 461.381560 ## iter 830 value 461.369044 ## iter 840 value 461.323343 ## iter 850 value 461.283620 ## iter 860 value 461.263564 ## final value 461.263064 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Kolkata (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Kolkata_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Kolkata\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Kolkata\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 28 (18 variable) ## initial value 883.443208 ## iter 10 value 335.108368 ## iter 20 value 324.838657 ## iter 30 value 322.253049 ## iter 40 value 318.432426 ## iter 50 value 317.060307 ## iter 60 value 316.879133 ## iter 70 value 316.296114 ## iter 80 value 316.020128 ## iter 90 value 315.819255 ## iter 100 value 315.748065 ## iter 110 value 315.695031 ## iter 120 value 315.681956 ## iter 130 value 315.634814 ## iter 140 value 315.538348 ## iter 150 value 315.441308 ## iter 160 value 315.350999 ## iter 170 value 315.301060 ## iter 180 value 315.268890 ## iter 190 value 315.142223 ## iter 200 value 315.085838 ## iter 210 value 315.063260 ## iter 220 value 315.050360 ## iter 230 value 315.048052 ## iter 240 value 315.037922 ## iter 250 value 315.021620 ## iter 260 value 314.992851 ## iter 270 value 314.974290 ## iter 280 value 314.958264 ## iter 290 value 314.953458 ## iter 300 value 314.947099 ## iter 310 value 314.942227 ## iter 320 value 314.937633 ## iter 330 value 314.915625 ## iter 340 value 314.887206 ## iter 350 value 314.868674 ## iter 360 value 314.864320 ## iter 370 value 314.856633 ## iter 380 value 314.850492 ## iter 390 value 314.847093 ## iter 400 value 314.844057 ## iter 410 value 314.824075 ## iter 420 value 314.807441 ## iter 430 value 314.802939 ## iter 440 value 314.800667 ## iter 450 value 314.791619 ## iter 460 value 314.787905 ## iter 470 value 314.780216 ## iter 480 value 314.775040 ## final value 314.774803 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Kolkata (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Kolkata_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Kolkata\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Kolkata\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 28 (18 variable) ## initial value 883.443208 ## iter 10 value 335.108368 ## iter 20 value 324.838657 ## iter 30 value 322.253049 ## iter 40 value 318.432426 ## iter 50 value 317.060307 ## iter 60 value 316.879133 ## iter 70 value 316.296114 ## iter 80 value 316.020128 ## iter 90 value 315.819255 ## iter 100 value 315.748065 ## iter 110 value 315.695031 ## iter 120 value 315.681956 ## iter 130 value 315.634814 ## iter 140 value 315.538348 ## iter 150 value 315.441308 ## iter 160 value 315.350999 ## iter 170 value 315.301060 ## iter 180 value 315.268890 ## iter 190 value 315.142223 ## iter 200 value 315.085838 ## iter 210 value 315.063260 ## iter 220 value 315.050360 ## iter 230 value 315.048052 ## iter 240 value 315.037922 ## iter 250 value 315.021620 ## iter 260 value 314.992851 ## iter 270 value 314.974290 ## iter 280 value 314.958264 ## iter 290 value 314.953458 ## iter 300 value 314.947099 ## iter 310 value 314.942227 ## iter 320 value 314.937633 ## iter 330 value 314.915625 ## iter 340 value 314.887206 ## iter 350 value 314.868674 ## iter 360 value 314.864320 ## iter 370 value 314.856633 ## iter 380 value 314.850492 ## iter 390 value 314.847093 ## iter 400 value 314.844057 ## iter 410 value 314.824075 ## iter 420 value 314.807441 ## iter 430 value 314.802939 ## iter 440 value 314.800667 ## iter 450 value 314.791619 ## iter 460 value 314.787905 ## iter 470 value 314.780216 ## iter 480 value 314.775040 ## final value 314.774803 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Kolkata (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Kolkata_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Saket Choudhary. Maintainer.","code":""},{"path":"http://saket-choudhary.me/covmuller/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Choudhary S (2024). covmuller: tool model COVID19 variant prevalence using data GISAID. R package version 0.1.2.0001, https://saketkc.github.io/covmuller.","code":"@Manual{, title = {covmuller: A tool to model COVID19 variant prevalence using data from GISAID}, author = {Saket Choudhary}, year = {2024}, note = {R package version 0.1.2.0001}, url = {https://saketkc.github.io/covmuller}, }"},{"path":"http://saket-choudhary.me/covmuller/index.html","id":"covmuller","dir":"","previous_headings":"","what":"A tool to model COVID19 variant prevalence using data from GISAID","title":"A tool to model COVID19 variant prevalence using data from GISAID","text":"Covmuller R-package designed analysis sequencing metadata deposited GISAID.","code":""},{"path":"http://saket-choudhary.me/covmuller/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"A tool to model COVID19 variant prevalence using data from GISAID","text":"Covmuller currently supports following features: Read preprocess metadata file downloaded GISAID: Vignette Plot variant prevalence: Vignette India USA Canada UK Australia SouthAfrica India New York state South Africa United Kingdom USA New York City (USA) Delhi (India) Mumbai (India) Maharashtra (India) Pune (India)","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanAmericanStates.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean states from the USA — CleanAmericanStates","title":"Clean states from the USA — CleanAmericanStates","text":"Clean states USA","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanAmericanStates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean states from the USA — CleanAmericanStates","text":"","code":"CleanAmericanStates(states)"},{"path":"http://saket-choudhary.me/covmuller/reference/CleanAmericanStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean states from the USA — CleanAmericanStates","text":"state vector state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanAmericanStates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean states from the USA — CleanAmericanStates","text":"vector cleaned state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanCanadaStates.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean states from Canada — CleanCanadaStates","title":"Clean states from Canada — CleanCanadaStates","text":"Clean states Canada","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanCanadaStates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean states from Canada — CleanCanadaStates","text":"","code":"CleanCanadaStates(states)"},{"path":"http://saket-choudhary.me/covmuller/reference/CleanCanadaStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean states from Canada — CleanCanadaStates","text":"state vector state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanCanadaStates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean states from Canada — CleanCanadaStates","text":"vector cleaned state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanIndianStates.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean Indian States — CleanIndianStates","title":"Clean Indian States — CleanIndianStates","text":"Clean Indian States","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanIndianStates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean Indian States — CleanIndianStates","text":"","code":"CleanIndianStates(states)"},{"path":"http://saket-choudhary.me/covmuller/reference/CleanIndianStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean Indian States — CleanIndianStates","text":"state vector state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanIndianStates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean Indian States — CleanIndianStates","text":"vector cleaned state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanSouthAfricanStates.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean states from South Africa — CleanSouthAfricanStates","title":"Clean states from South Africa — CleanSouthAfricanStates","text":"Clean states South Africa","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanSouthAfricanStates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean states from South Africa — CleanSouthAfricanStates","text":"","code":"CleanSouthAfricanStates(states)"},{"path":"http://saket-choudhary.me/covmuller/reference/CleanSouthAfricanStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean states from South Africa — CleanSouthAfricanStates","text":"state vector state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanSouthAfricanStates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean states from South Africa — CleanSouthAfricanStates","text":"vector cleaned state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CollapseLineageToVOCs.html","id":null,"dir":"Reference","previous_headings":"","what":"Collpase pangolin lineage a list of VOCs — CollapseLineageToVOCs","title":"Collpase pangolin lineage a list of VOCs — CollapseLineageToVOCs","text":"Collpase pangolin lineage list VOCs","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CollapseLineageToVOCs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collpase pangolin lineage a list of VOCs — CollapseLineageToVOCs","text":"","code":"CollapseLineageToVOCs( variant_df, vocs = GetVOCs(), custom_voc_mapping = NULL, summarize = TRUE )"},{"path":"http://saket-choudhary.me/covmuller/reference/CollapseLineageToVOCs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collpase pangolin lineage a list of VOCs — CollapseLineageToVOCs","text":"variant_df dataframe \"pangolin_lineage\" column vocs named list VOC (variant concernt) name key list lineages VOC. method replace lineages VOC name. custom_voc_mapping named vector custom mapping naming lineages. See example.","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CollapseLineageToVOCs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collpase pangolin lineage a list of VOCs — CollapseLineageToVOCs","text":"dataframe new column \"lineage_collpased\".","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CombineSequencedCases.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a combined dataframe of sequenced cases and confirmed cases — CombineSequencedCases","title":"Create a combined dataframe of sequenced cases and confirmed cases — CombineSequencedCases","text":"Create combined dataframe sequenced cases confirmed cases","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CombineSequencedCases.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a combined dataframe of sequenced cases and confirmed cases — CombineSequencedCases","text":"","code":"CombineSequencedCases( cases_sequenced, confirmed_long, prune_oversequenced = TRUE, month.min = NULL, month.max = NULL, max.percent = 100 )"},{"path":"http://saket-choudhary.me/covmuller/reference/CombineSequencedCases.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a combined dataframe of sequenced cases and confirmed cases — CombineSequencedCases","text":"cases_sequenced long dataframe per state sequenced cases prune_oversequenced Whether round percentages 100 100. Default TRUE cases_total long dataframe total monthly cases","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CombineSequencedCases.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a combined dataframe of sequenced cases and confirmed cases — CombineSequencedCases","text":"combined dataframe case load sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CountsToPrevalence.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert monthwise counts to prevalence — CountsToPrevalence","title":"Convert monthwise counts to prevalence — CountsToPrevalence","text":"Convert monthwise counts prevalence","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CountsToPrevalence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert monthwise counts to prevalence — CountsToPrevalence","text":"","code":"CountsToPrevalence(variant_df)"},{"path":"http://saket-choudhary.me/covmuller/reference/CountsToPrevalence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert monthwise counts to prevalence — CountsToPrevalence","text":"variant_df dataframe","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CountsToPrevalence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert monthwise counts to prevalence — CountsToPrevalence","text":"dataframe monthwise prevalence variants","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CovmullerTheme.html","id":null,"dir":"Reference","previous_headings":"","what":"Set them — CovmullerTheme","title":"Set them — CovmullerTheme","text":"Set ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CovmullerTheme.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set them — CovmullerTheme","text":"","code":"CovmullerTheme()"},{"path":"http://saket-choudhary.me/covmuller/reference/FilterGISAIDIndia.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter GISAID India Metadata for India — FilterGISAIDIndia","title":"Filter GISAID India Metadata for India — FilterGISAIDIndia","text":"Filter GISAID India Metadata India","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/FilterGISAIDIndia.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter GISAID India Metadata for India — FilterGISAIDIndia","text":"","code":"FilterGISAIDIndia(gisaid_metadata_all)"},{"path":"http://saket-choudhary.me/covmuller/reference/FilterGISAIDIndia.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter GISAID India Metadata for India — FilterGISAIDIndia","text":"gisaid_metadata_all dataframe GISAID metadata","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/FilterGISAIDIndia.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter GISAID India Metadata for India — FilterGISAIDIndia","text":"dataframe Indian entries Human date known","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/FormatGISAIDMetadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Format metadata.tar.x file downloaded from GISAID with some missing columns — FormatGISAIDMetadata","title":"Format metadata.tar.x file downloaded from GISAID with some missing columns — FormatGISAIDMetadata","text":"Format metadata.tar.x file downloaded GISAID missing columns","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/FormatGISAIDMetadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format metadata.tar.x file downloaded from GISAID with some missing columns — FormatGISAIDMetadata","text":"","code":"FormatGISAIDMetadata( df, collection_col = \"Collection date\", submission_col = \"Submission date\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/FormatGISAIDMetadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format metadata.tar.x file downloaded from GISAID with some missing columns — FormatGISAIDMetadata","text":"df GISAID metadata dataframe collection_col Name column representing date collection (Collection date) submission_col Name column representing date submission (Submission date)","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/FormatGISAIDMetadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format metadata.tar.x file downloaded from GISAID with some missing columns — FormatGISAIDMetadata","text":"data frame following extra columns: DateCollected, MonthYearCollected, YearCollected, MonthCollected, WeekCollected DateCollectedNumeric, MonthYearCollectedNumeric DateSubmitted, MonthYearSubmitted, YearSubmitted, MonthSubmitted, WeekSubmitted DateSubmittedNumeric, MonthYearSubmittedNumeric","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GeocodeAddress.html","id":null,"dir":"Reference","previous_headings":"","what":"Geocode a given address to get its latitude, longitude from Gooogle — GeocodeAddress","title":"Geocode a given address to get its latitude, longitude from Gooogle — GeocodeAddress","text":"Geocode given address get latitude, longitude Gooogle","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GeocodeAddress.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Geocode a given address to get its latitude, longitude from Gooogle — GeocodeAddress","text":"","code":"GeocodeAddress(address, api.key = NULL, restrict.to = NULL)"},{"path":"http://saket-choudhary.me/covmuller/reference/GeocodeAddress.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Geocode a given address to get its latitude, longitude from Gooogle — GeocodeAddress","text":"address String address geocode api.key API key Google Maps restrict.Country name search restricted , Currently supports 'India'","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GeocodeAddress.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Geocode a given address to get its latitude, longitude from Gooogle — GeocodeAddress","text":"dataframe geocoded address","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetFiletype.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine filetype — GetFiletype","title":"Determine filetype — GetFiletype","text":"Determine filetype","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetFiletype.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine filetype — GetFiletype","text":"","code":"GetFiletype(path)"},{"path":"http://saket-choudhary.me/covmuller/reference/GetFiletype.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine filetype — GetFiletype","text":"path Path file","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetFiletype.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine filetype — GetFiletype","text":"Extension file","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesCumulative.html","id":null,"dir":"Reference","previous_headings":"","what":"Get daily confirmed cases for India — GetIndiaConfirmedCasesCumulative","title":"Get daily confirmed cases for India — GetIndiaConfirmedCasesCumulative","text":"Get daily confirmed cases India","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesCumulative.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get daily confirmed cases for India — GetIndiaConfirmedCasesCumulative","text":"","code":"GetIndiaConfirmedCasesCumulative( url = \"https://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesCumulative.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get daily confirmed cases for India — GetIndiaConfirmedCasesCumulative","text":"url URL fetch data ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesCumulative.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get daily confirmed cases for India — GetIndiaConfirmedCasesCumulative","text":"data frame containing daily cases state","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesMonthlyLong.html","id":null,"dir":"Reference","previous_headings":"","what":"Get India monthwose cases long — GetIndiaConfirmedCasesMonthlyLong","title":"Get India monthwose cases long — GetIndiaConfirmedCasesMonthlyLong","text":"Get India monthwose cases long","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesMonthlyLong.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get India monthwose cases long — GetIndiaConfirmedCasesMonthlyLong","text":"","code":"GetIndiaConfirmedCasesMonthlyLong( url = \"http://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\", level = \"State\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesMonthlyLong.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get India monthwose cases long — GetIndiaConfirmedCasesMonthlyLong","text":"url URL fetch data ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesMonthlyLong.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get India monthwose cases long — GetIndiaConfirmedCasesMonthlyLong","text":"data frame containing monthly cases state long form","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesWeeklyLong.html","id":null,"dir":"Reference","previous_headings":"","what":"Get India weekwise cases long — GetIndiaConfirmedCasesWeeklyLong","title":"Get India weekwise cases long — GetIndiaConfirmedCasesWeeklyLong","text":"Get India weekwise cases long","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesWeeklyLong.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get India weekwise cases long — GetIndiaConfirmedCasesWeeklyLong","text":"","code":"GetIndiaConfirmedCasesWeeklyLong( url = \"https://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\", level = \"State\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesWeeklyLong.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get India weekwise cases long — GetIndiaConfirmedCasesWeeklyLong","text":"url URL fetch data ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesWeeklyLong.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get India weekwise cases long — GetIndiaConfirmedCasesWeeklyLong","text":"data frame containing monthly cases state long form","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyCasesCumulative.html","id":null,"dir":"Reference","previous_headings":"","what":"Get daily cases for India for a given status type — GetIndiaDailyCasesCumulative","title":"Get daily cases for India for a given status type — GetIndiaDailyCasesCumulative","text":"Get daily cases India given status type","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyCasesCumulative.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get daily cases for India for a given status type — GetIndiaDailyCasesCumulative","text":"","code":"GetIndiaDailyCasesCumulative( url = \"https://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\", status = \"Confirmed\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyCasesCumulative.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get daily cases for India for a given status type — GetIndiaDailyCasesCumulative","text":"url URL fetch data status One \"Confirmed\", \"Recovered\", \"Deceased\"","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyCasesCumulative.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get daily cases for India for a given status type — GetIndiaDailyCasesCumulative","text":"data frame containing daily cases state","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyData.html","id":null,"dir":"Reference","previous_headings":"","what":"Get daily statewise data for India — GetIndiaDailyData","title":"Get daily statewise data for India — GetIndiaDailyData","text":"'Status' column one 'Confirmed', 'Deceased' 'Recovered'","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get daily statewise data for India — GetIndiaDailyData","text":"","code":"GetIndiaDailyData( url = \"https://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get daily statewise data for India — GetIndiaDailyData","text":"url URL fetch data ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyData.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get daily statewise data for India — GetIndiaDailyData","text":"data frame containing daily cases state","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDeceasedCasesCumulative.html","id":null,"dir":"Reference","previous_headings":"","what":"Get daily deceased cases for India — GetIndiaDeceasedCasesCumulative","title":"Get daily deceased cases for India — GetIndiaDeceasedCasesCumulative","text":"Get daily deceased cases India","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDeceasedCasesCumulative.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get daily deceased cases for India — GetIndiaDeceasedCasesCumulative","text":"","code":"GetIndiaDeceasedCasesCumulative( url = \"https://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDeceasedCasesCumulative.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get daily deceased cases for India — GetIndiaDeceasedCasesCumulative","text":"url URL fetch data ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDeceasedCasesCumulative.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get daily deceased cases for India — GetIndiaDeceasedCasesCumulative","text":"data frame containing daily cases state","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaHospitalization.html","id":null,"dir":"Reference","previous_headings":"","what":"Get hospitalization data for India — GetIndiaHospitalization","title":"Get hospitalization data for India — GetIndiaHospitalization","text":"Get hospitalization data India","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaHospitalization.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get hospitalization data for India — GetIndiaHospitalization","text":"","code":"GetIndiaHospitalization(url = \"\")"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndianStates.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a list of Indian name states — GetIndianStates","title":"Get a list of Indian name states — GetIndianStates","text":"Get list Indian name states","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndianStates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a list of Indian name states — GetIndianStates","text":"","code":"GetIndianStates()"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndianStates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a list of Indian name states — GetIndianStates","text":"list state abbreviation key full name value","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetMonthYear.html","id":null,"dir":"Reference","previous_headings":"","what":"Get MonthYear (zoo) from a dataframe string formatted data column — GetMonthYear","title":"Get MonthYear (zoo) from a dataframe string formatted data column — GetMonthYear","text":"Get MonthYear (zoo) dataframe string formatted data column","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetMonthYear.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get MonthYear (zoo) from a dataframe string formatted data column — GetMonthYear","text":"","code":"GetMonthYear(datecol, datefmt = \"%Y-%m-%d\")"},{"path":"http://saket-choudhary.me/covmuller/reference/GetMonthYear.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get MonthYear (zoo) from a dataframe string formatted data column — GetMonthYear","text":"datecol vector string formatted dates datefmt Format date (default Y-m-d)","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetMonthYear.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get MonthYear (zoo) from a dataframe string formatted data column — GetMonthYear","text":"vector dates converted MonthYear format (zoo::.yearmon)","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetVOCs.html","id":null,"dir":"Reference","previous_headings":"","what":"Get variants of concern — GetVOCs","title":"Get variants of concern — GetVOCs","text":"Get variants concern","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetVOCs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get variants of concern — GetVOCs","text":"","code":"GetVOCs()"},{"path":"http://saket-choudhary.me/covmuller/reference/GetVOCs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get variants of concern — GetVOCs","text":"list variants concern pangolin lineage","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotSequencedPropHeatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot heatmap of cases sequenced — PlotSequencedPropHeatmap","title":"Plot heatmap of cases sequenced — PlotSequencedPropHeatmap","text":"Plot heatmap cases sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotSequencedPropHeatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot heatmap of cases sequenced — PlotSequencedPropHeatmap","text":"","code":"PlotSequencedPropHeatmap(df)"},{"path":"http://saket-choudhary.me/covmuller/reference/PlotSequencedPropHeatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot heatmap of cases sequenced — PlotSequencedPropHeatmap","text":"cases_and_shared dataframe containing counts confirmed cases sequenced cases","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotSequencedPropHeatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot heatmap of cases sequenced — PlotSequencedPropHeatmap","text":"heatmap total percentage cases sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotTotalHeatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot heatmap of total cases/sequences — PlotTotalHeatmap","title":"Plot heatmap of total cases/sequences — PlotTotalHeatmap","text":"Plot heatmap total cases/sequences","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotTotalHeatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot heatmap of total cases/sequences — PlotTotalHeatmap","text":"","code":"PlotTotalHeatmap(df, color_legend = \"Total cases\")"},{"path":"http://saket-choudhary.me/covmuller/reference/PlotTotalHeatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot heatmap of total cases/sequences — PlotTotalHeatmap","text":"cases_and_shared dataframe containing counts confirmed cases sequenced cases (column named 'value')","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotTotalHeatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot heatmap of total cases/sequences — PlotTotalHeatmap","text":"heatmap total cases/sequences","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceInstrument.html","id":null,"dir":"Reference","previous_headings":"","what":"Read instrument metadata from GISAID batch downloads — ReadAuspiceInstrument","title":"Read instrument metadata from GISAID batch downloads — ReadAuspiceInstrument","text":"Read instrument metadata GISAID batch downloads","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceInstrument.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read instrument metadata from GISAID batch downloads — ReadAuspiceInstrument","text":"","code":"ReadAuspiceInstrument(path)"},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceInstrument.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read instrument metadata from GISAID batch downloads — ReadAuspiceInstrument","text":"path Path list directories \"sequence.tsv\" inside subdirector","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceInstrument.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read instrument metadata from GISAID batch downloads — ReadAuspiceInstrument","text":"dataframe instrument related metadata","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceMetadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Read all metadata from GISAID batch downloads — ReadAuspiceMetadata","title":"Read all metadata from GISAID batch downloads — ReadAuspiceMetadata","text":"Read metadata GISAID batch downloads","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceMetadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read all metadata from GISAID batch downloads — ReadAuspiceMetadata","text":"","code":"ReadAuspiceMetadata(path)"},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceMetadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read all metadata from GISAID batch downloads — ReadAuspiceMetadata","text":"path Path list directories \"sequence.tsv\" inside subdirector","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceMetadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read all metadata from GISAID batch downloads — ReadAuspiceMetadata","text":"dataframe collated metadata","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadGISAIDMetada.html","id":null,"dir":"Reference","previous_headings":"","what":"Read metadata downloaded from GISAID — ReadGISAIDMetada","title":"Read metadata downloaded from GISAID — ReadGISAIDMetada","text":"Read metadata downloaded GISAID","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadGISAIDMetada.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read metadata downloaded from GISAID — ReadGISAIDMetada","text":"","code":"ReadGISAIDMetada(path, showProgress = FALSE, ...)"},{"path":"http://saket-choudhary.me/covmuller/reference/ReadGISAIDMetada.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read metadata downloaded from GISAID — ReadGISAIDMetada","text":"path Path tar.xz metadata.txt downloaded GISAID showProgress Whether print progress bars fread ... parameters data.table::fread","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadGISAIDMetada.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read metadata downloaded from GISAID — ReadGISAIDMetada","text":"data frame parsed metadata extra columns","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SanitizeColumn.html","id":null,"dir":"Reference","previous_headings":"","what":"Sanitize a vector to remove special characters and convert it to tile — SanitizeColumn","title":"Sanitize a vector to remove special characters and convert it to tile — SanitizeColumn","text":"function removes: 1. Commas space 2. Hyphen space 3. Multiple dots single space 4. Multiple spacies single space 5. NA \"UNKNOWN\"","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SanitizeColumn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sanitize a vector to remove special characters and convert it to tile — SanitizeColumn","text":"","code":"SanitizeColumn(col)"},{"path":"http://saket-choudhary.me/covmuller/reference/SanitizeColumn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sanitize a vector to remove special characters and convert it to tile — SanitizeColumn","text":"col String vector","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SanitizeColumn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sanitize a vector to remove special characters and convert it to tile — SanitizeColumn","text":"string vector sanitized entries","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsDatewise.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the total number of variants per week — SummarizeVariantsDatewise","title":"Summarize the total number of variants per week — SummarizeVariantsDatewise","text":"Summarize total number variants per week","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsDatewise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the total number of variants per week — SummarizeVariantsDatewise","text":"","code":"SummarizeVariantsDatewise(variant_df, by_state = FALSE)"},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsDatewise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the total number of variants per week — SummarizeVariantsDatewise","text":"variant_df dataframe","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsDatewise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize the total number of variants per week — SummarizeVariantsDatewise","text":"dataframe monthwise counts variant sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsMonthwise.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the total number of variants per month — SummarizeVariantsMonthwise","title":"Summarize the total number of variants per month — SummarizeVariantsMonthwise","text":"Summarize total number variants per month","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsMonthwise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the total number of variants per month — SummarizeVariantsMonthwise","text":"","code":"SummarizeVariantsMonthwise(variant_df, by_state = FALSE)"},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsMonthwise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the total number of variants per month — SummarizeVariantsMonthwise","text":"variant_df dataframe","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsMonthwise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize the total number of variants per month — SummarizeVariantsMonthwise","text":"dataframe monthwise counts variant sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsWeekwise.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the total number of variants per week — SummarizeVariantsWeekwise","title":"Summarize the total number of variants per week — SummarizeVariantsWeekwise","text":"Summarize total number variants per week","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsWeekwise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the total number of variants per week — SummarizeVariantsWeekwise","text":"","code":"SummarizeVariantsWeekwise(variant_df, by_state = FALSE)"},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsWeekwise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the total number of variants per week — SummarizeVariantsWeekwise","text":"variant_df dataframe","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsWeekwise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize the total number of variants per week — SummarizeVariantsWeekwise","text":"dataframe monthwise counts variant sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthCountrywise.html","id":null,"dir":"Reference","previous_headings":"","what":"Get total sequenced samples per country — TotalSequencesPerMonthCountrywise","title":"Get total sequenced samples per country — TotalSequencesPerMonthCountrywise","text":"Get total sequenced samples per country","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthCountrywise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get total sequenced samples per country — TotalSequencesPerMonthCountrywise","text":"","code":"TotalSequencesPerMonthCountrywise(variant_df, rename_country_as_state = TRUE)"},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthCountrywise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get total sequenced samples per country — TotalSequencesPerMonthCountrywise","text":"variant_df dataframe","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthCountrywise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get total sequenced samples per country — TotalSequencesPerMonthCountrywise","text":"dataframe sequencing statistics per country","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthStatewise.html","id":null,"dir":"Reference","previous_headings":"","what":"Get total number of sequenced samples per month in a Country — TotalSequencesPerMonthStatewise","title":"Get total number of sequenced samples per month in a Country — TotalSequencesPerMonthStatewise","text":"Get total number sequenced samples per month Country","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthStatewise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get total number of sequenced samples per month in a Country — TotalSequencesPerMonthStatewise","text":"","code":"TotalSequencesPerMonthStatewise(variant_df, drop_country = FALSE)"},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthStatewise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get total number of sequenced samples per month in a Country — TotalSequencesPerMonthStatewise","text":"dataframe sequencing statistics per state per country","code":""}]
+[{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"get-cases-data","dir":"Articles","previous_headings":"","what":"Get cases data","title":"Introduction to covmuller","text":"use covid19bharat.org get tally daily confirmed cases summarize monthly level.","code":"indian_state_cases <- GetIndiaConfirmedCasesMonthlyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. india_cases <- indian_state_cases %>% filter(State == \"India\") %>% filter(value > 1) head(india_cases) ## MonthYear State value type ## 1 Mar 2020 India 1635 Confirmed ## 2 Apr 2020 India 33232 Confirmed ## 3 May 2020 India 155781 Confirmed ## 4 Jun 2020 India 395044 Confirmed ## 5 Jul 2020 India 1111273 Confirmed ## 6 Aug 2020 India 1990350 Confirmed"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"plot-cases-for-india","dir":"Articles","previous_headings":"Get cases data","what":"Plot cases for India","title":"Introduction to covmuller","text":"easy visualize monthly case counts bar plot:","code":"p1 <- BarPlot(india_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - India\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"read-variant-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Read variant data from GISAID","title":"Introduction to covmuller","text":"utilize GISAID data look prevalence variants. access data, GISAID requires registration.","code":"current_date <- \"2024_01_11\" fpath.tar <- paste0(\"~/data/epicov/metadata_tsv_\", current_date, \".tar.xz\") fpath.qs <- paste0(\"~/data/epicov/metadata_tsv_\", current_date, \".qs\") if (file.exists(fpath.qs)) { gisaid_metadata <- qs::qread(file = fpath.qs) } else { gisaid_metadata <- ReadGISAIDMetada(path = fpath.tar) qs::qsave(gisaid_metadata, fpath.qs) }"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"Read variant data from GISAID","what":"Plot total sequenced cases","title":"Introduction to covmuller","text":"can look absolute number cases sequenced country filtering information metadata made available GISAID (includes countries). , visualize total sequenced cases coming India:","code":"gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india, rename_country_as_state = TRUE) p2 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from India\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"overall-how-much-has-india-sequenced-over-months","dir":"Articles","previous_headings":"Read variant data from GISAID","what":"Overall, how much has India sequenced over months?","title":"Introduction to covmuller","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic: context, can combine three plots :","code":"#india_cases_long <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == \"India\") GetIndiaCases <- function(){ data <- read.csv(\"https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/cases_deaths/new_cases.csv\") confirmed <- data %>% select(date, India) colnames(confirmed)[2] <- c(\"cases\") confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_weekwise <- confirmed %>% group_by(MonthYear) %>% summarise(value = sum(cases, na.rm=T)) %>% arrange(MonthYear) } india_cases_long <- GetIndiaCases() india_cases_long$State <- \"India\" india_cases_long$type <- \"Confirmed\" india_sequencing_proportion <- CombineSequencedCases( cases_sequenced = country_seq_stats, confirmed_long = india_cases_long ) p3 <- BarPlot(india_sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from India\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"plot-proportion-of-cases-that-been-deposited-from-each-state","dir":"Articles","previous_headings":"Read variant data from GISAID","what":"Plot proportion of cases that been deposited from each state","title":"Introduction to covmuller","text":"can break proportion sequenced cases state level:","code":"state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_india, drop_country = TRUE) seq_stats <- rbind(country_seq_stats, state_seq_stats) state_cases_long <- GetIndiaConfirmedCasesMonthlyLong() india_sequencing_proportion <- CombineSequencedCases( cases_sequenced = seq_stats, confirmed_long = state_cases_long, month.min = \"Jan 2022\", month.max = \"Feb 2023\", max.percent = 5 ) india_sequencing_proportion$State <- factor( x = india_sequencing_proportion$State, levels = as.character(GetIndianStates()) ) p4 <- PlotSequencedPropHeatmap(india_sequencing_proportion) # p4"},{"path":"http://saket-choudhary.me/covmuller/articles/Introduction.html","id":"plot-prevalence","dir":"Articles","previous_headings":"","what":"Plot Prevalence","title":"Introduction to covmuller","text":"Finally, look prevalence variants variants concern (VOCs): animated version prevalence plot, check VariantAnimation.","code":"india_month_counts <- SummarizeVariantsMonthwise(gisaid_india) india_month_counts$State <- \"India\" india_month_prevalence <- CountsToPrevalence(india_month_counts) vocs <- GetVOCs() custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GE.1` = \"GE.1\", `GE.1.*` = \"GE.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) india_month_prevalence <- CollapseLineageToVOCs( variant_df = india_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(india_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling-Germany.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - Germany","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_germany, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"Germany\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling-Germany.html","id":"plot-stateswise-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot stateswise sequenced cases","title":"Multinomial modeling - Germany","text":"","code":"state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_germany) state_seq_stats_summary <- state_seq_stats %>% group_by(State) %>% summarise(value = sum(value)) p1 <- BarPlot(state_seq_stats_summary, xaxis = \"State\", ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"Germany\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling-Germany.html","id":"get-vocs","dir":"Articles","previous_headings":"Plot stateswise sequenced cases","what":"Get VOCs","title":"Multinomial modeling - Germany","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_germany_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_germany, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_germany_collapsed_sel <- gisaid_germany_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") %>% filter(lineage_collapsed != \"Unassigned\") %>% filter(State != \"Unknown\") vocs_to_keep <- table(gisaid_germany_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 50] gisaid_germany_collapsed_sel <- gisaid_germany_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_germany_shared_dateweek <- SummarizeVariantsDatewise(gisaid_germany_collapsed_sel, by_state = TRUE) head(gisaid_germany_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 Baden-Wurttemberg 19268 BA.5 1 ## 2 Baden-Wurttemberg 19270 BA.5 1 ## 3 Baden-Wurttemberg 19276 Others 1 ## 4 Baden-Wurttemberg 19278 BA.5 2 ## 5 Baden-Wurttemberg 19279 BA.2.75 1 ## 6 Baden-Wurttemberg 19279 BA.4 1 fit_germany_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_germany_shared_dateweek) ## # weights: 147 (120 variable) ## initial value 84514.769594 ## iter 10 value 58871.333180 ## iter 20 value 55522.530928 ## iter 30 value 50503.510775 ## iter 40 value 47871.511519 ## iter 50 value 47299.292070 ## iter 60 value 46963.614174 ## iter 70 value 46668.970432 ## iter 80 value 46535.784282 ## iter 90 value 46498.287724 ## iter 100 value 46485.928726 ## iter 110 value 46484.524254 ## iter 120 value 46484.171431 ## iter 130 value 46484.026750 ## final value 46483.999949 ## converged head(fit_germany_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State prob ## 1 BA.2 19268 Baden-Wurttemberg 0.002395273 ## 2 BA.2.75 19268 Baden-Wurttemberg 0.001983825 ## 3 BA.4 19268 Baden-Wurttemberg 0.010924456 ## 4 BA.5 19268 Baden-Wurttemberg 0.561990359 ## 5 BQ.1+ 19268 Baden-Wurttemberg 0.098423301 ## 6 Others 19268 Baden-Wurttemberg 0.324110466 ## SE df asymp.LCL asymp.UCL DateCollected ## 1 0.001243669 NA -4.227349e-05 0.004832819 2022-10-03 ## 2 0.001397073 NA -7.543881e-04 0.004722038 2022-10-03 ## 3 0.006465575 NA -1.747839e-03 0.023596750 2022-10-03 ## 4 0.029268277 NA 5.046256e-01 0.619355127 2022-10-03 ## 5 0.010256478 NA 7.832097e-02 0.118525630 2022-10-03 ## 6 0.023882935 NA 2.773008e-01 0.370920159 2022-10-03"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling-Germany.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - Germany","text":"","code":"muller_germanybystate_mfit <- PlotMullerDailyPrevalence(fit_germany_multi_predsbystate, ncol = 3) muller_germanybystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Australia.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - Australia","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_australia, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"Australia\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Australia.html","id":"get-vocs","dir":"Articles","previous_headings":"","what":"Get VOCs","title":"Multinomial modeling - Australia","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_australia_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_australia, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_australia_collapsed_sel <- gisaid_australia_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") %>% filter(lineage_collapsed != \"Unassigned\") vocs_to_keep <- table(gisaid_australia_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100] gisaid_australia_collapsed_sel <- gisaid_australia_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_australia_shared_dateweek <- SummarizeVariantsDatewise(gisaid_australia_collapsed_sel, by_state = TRUE) head(gisaid_australia_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 Australian Capital Territory 19266 BA.4 1 ## 2 Australian Capital Territory 19266 BA.5 1 ## 3 Australian Capital Territory 19268 BA.5 3 ## 4 Australian Capital Territory 19269 BA.5 5 ## 5 Australian Capital Territory 19269 Others 2 ## 6 Australian Capital Territory 19270 BA.5 6 fit_australia_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_australia_shared_dateweek) ## # weights: 77 (60 variable) ## initial value 81868.331791 ## iter 10 value 44070.203776 ## iter 20 value 41147.140310 ## iter 30 value 37628.202667 ## iter 40 value 35644.341491 ## iter 50 value 34806.030962 ## iter 60 value 34524.606747 ## iter 70 value 34495.422733 ## iter 80 value 34488.423228 ## iter 90 value 34487.026907 ## iter 100 value 34486.832770 ## iter 110 value 34486.808519 ## final value 34486.800097 ## converged head(fit_australia_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State ## 1 BA.2 19266 Australian Capital Territory ## 2 BA.2.75 19266 Australian Capital Territory ## 3 BA.4 19266 Australian Capital Territory ## 4 BA.5 19266 Australian Capital Territory ## 5 BQ.1+ 19266 Australian Capital Territory ## 6 Others 19266 Australian Capital Territory ## prob SE df asymp.LCL asymp.UCL DateCollected ## 1 0.01287056 0.004330736 NA 0.004382473 0.02135865 2022-10-01 ## 2 0.02820800 0.007365799 NA 0.013771296 0.04264470 2022-10-01 ## 3 0.06585284 0.013198964 NA 0.039983347 0.09172233 2022-10-01 ## 4 0.67639409 0.020085207 NA 0.637027807 0.71576037 2022-10-01 ## 5 0.03872073 0.004079806 NA 0.030724455 0.04671700 2022-10-01 ## 6 0.17760819 0.012103338 NA 0.153886085 0.20133030 2022-10-01"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Australia.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - Australia","text":"","code":"muller_australiabystate_mfit <- PlotMullerDailyPrevalence(fit_australia_multi_predsbystate, ncol = 3) muller_australiabystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Canada.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - Canada","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_canada, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"Canada\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Canada.html","id":"get-vocs","dir":"Articles","previous_headings":"","what":"Get VOCs","title":"Multinomial modeling - Canada","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_canada_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_canada, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_canada_collapsed_sel <- gisaid_canada_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") vocs_to_keep <- table(gisaid_canada_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100] gisaid_canada_collapsed_sel <- gisaid_canada_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_canada_shared_dateweek <- SummarizeVariantsDatewise(gisaid_canada_collapsed_sel, by_state = TRUE) head(gisaid_canada_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 Alberta 19270 BA.5 1 ## 2 Alberta 19287 BA.5 1 ## 3 Alberta 19288 BA.5 1 ## 4 Alberta 19288 BQ.1+ 1 ## 5 Alberta 19289 BA.5 4 ## 6 Alberta 19289 BQ.1+ 1 fit_canada_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_canada_shared_dateweek) ## # weights: 78 (60 variable) ## initial value 187840.895716 ## iter 10 value 110689.126358 ## iter 20 value 108427.020931 ## iter 30 value 97154.791951 ## iter 40 value 92547.846240 ## iter 50 value 90348.395369 ## iter 60 value 87691.764293 ## iter 70 value 86673.506577 ## iter 80 value 86654.378224 ## iter 90 value 86644.678472 ## iter 100 value 86643.817674 ## iter 110 value 86643.284694 ## iter 120 value 86642.851219 ## final value 86642.812520 ## converged head(fit_canada_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State prob SE df ## 1 BA.2.75 19267 Alberta 0.0831165146 2.476606e-02 NA ## 2 BA.4 19267 Alberta 0.0751094919 9.840250e-03 NA ## 3 BA.5 19267 Alberta 0.6992750081 2.212831e-02 NA ## 4 BQ.1+ 19267 Alberta 0.0812395411 4.443272e-03 NA ## 5 Others 19267 Alberta 0.0608317700 3.659269e-03 NA ## 6 XBB 19267 Alberta 0.0004276743 3.649025e-05 NA ## asymp.LCL asymp.UCL DateCollected ## 1 0.0345759243 0.1316571050 2022-10-02 ## 2 0.0558229555 0.0943960282 2022-10-02 ## 3 0.6559043089 0.7426457072 2022-10-02 ## 4 0.0725308871 0.0899481950 2022-10-02 ## 5 0.0536597344 0.0680038056 2022-10-02 ## 6 0.0003561548 0.0004991939 2022-10-02"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_Canada.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - Canada","text":"","code":"muller_canadabystate_mfit <- PlotMullerDailyPrevalence(fit_canada_multi_predsbystate, ncol = 3) muller_canadabystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_India.html","id":null,"dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - India","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"India\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_India.html","id":null,"dir":"Articles","previous_headings":"","what":"Plot stateswise sequenced cases","title":"Multinomial modeling - India","text":"","code":"state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_india) state_seq_stats_summary <- state_seq_stats %>% group_by(State) %>% summarise(value = sum(value)) state_seq_stats_summary$State[state_seq_stats_summary$State == \"Dadra and Nagar Haveli and Daman and Diu\"] <- \"Dadra/N Haveli/Daman/Diu\" p1 <- BarPlot(state_seq_stats_summary, xaxis = \"State\", ylabel = \"Total sequences deposited\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"India\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_India.html","id":null,"dir":"Articles","previous_headings":"","what":"Get VOCs","title":"Multinomial modeling - India","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_india_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_india_collapsed_sel <- gisaid_india_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") %>% filter(lineage_collapsed != \"Unassigned\") vocs_to_keep <- table(gisaid_india_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100] gisaid_india_collapsed_sel <- gisaid_india_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_india_shared_dateweek <- SummarizeVariantsDatewise(gisaid_india_collapsed_sel, by_state = TRUE) head(gisaid_india_shared_dateweek) ## [38;5;246m# A tibble: 6 × 4[39m ## State DateCollectedNumeric lineage_collapsed n ## [3m[38;5;246m[39m[23m [3m[38;5;246m[39m[23m [3m[38;5;246m[39m[23m [3m[38;5;246m[39m[23m ## [38;5;250m1[39m Andhra Pradesh [4m1[24m[4m9[24m448 XBB 1 ## [38;5;250m2[39m Andhra Pradesh [4m1[24m[4m9[24m506 XBB 1 ## [38;5;250m3[39m Arunachal Pradesh [4m1[24m[4m9[24m361 XBB 1 ## [38;5;250m4[39m Arunachal Pradesh [4m1[24m[4m9[24m459 XBB 1 ## [38;5;250m5[39m Arunachal Pradesh [4m1[24m[4m9[24m556 XBB 1 ## [38;5;250m6[39m Arunachal Pradesh [4m1[24m[4m9[24m611 Others 1 fit_india_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_india_shared_dateweek) ## # weights: 204 (165 variable) ## initial value 32936.122563 ## iter 10 value 11412.728941 ## iter 20 value 10497.898156 ## iter 30 value 10060.762985 ## iter 40 value 9915.848503 ## iter 50 value 9795.429255 ## iter 60 value 9722.564462 ## iter 70 value 9691.424610 ## iter 80 value 9677.049745 ## iter 90 value 9675.962483 ## iter 100 value 9675.837818 ## iter 110 value 9675.761679 ## final value 9675.760375 ## converged head(fit_india_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State prob ## 1 BA.2 19266 Andhra Pradesh 7.813500e-05 ## 2 BA.2.75 19266 Andhra Pradesh 4.233569e-05 ## 3 BA.2.X 19266 Andhra Pradesh 4.508509e-08 ## 4 BQ.1+ 19266 Andhra Pradesh 1.724266e-08 ## 5 Others 19266 Andhra Pradesh 1.775514e-03 ## 6 XBB 19266 Andhra Pradesh 9.981040e-01 ## SE df asymp.LCL asymp.UCL DateCollected ## 1 7.635012e-05 NA -7.150849e-05 2.277785e-04 2022-10-01 ## 2 1.180819e-04 NA -1.891006e-04 2.737720e-04 2022-10-01 ## 3 2.883637e-08 NA -1.143316e-08 1.016033e-07 2022-10-01 ## 4 1.160411e-08 NA -5.500971e-09 3.998630e-08 2022-10-01 ## 5 1.676378e-03 NA -1.510127e-03 5.061154e-03 2022-10-01 ## 6 1.737326e-03 NA 9.946989e-01 1.001509e+00 2022-10-01"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_India.html","id":null,"dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - India","text":"","code":"muller_indiabystate_mfit <- PlotMullerDailyPrevalence(fit_india_multi_predsbystate) muller_indiabystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_SouthAfrica.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - South Africa","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_southafrica, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"South Africa\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_SouthAfrica.html","id":"plot-stateswise-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot stateswise sequenced cases","title":"Multinomial modeling - South Africa","text":"","code":"state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_southafrica) state_seq_stats_summary <- state_seq_stats %>% group_by(State) %>% summarise(value = sum(value)) p1 <- BarPlot(state_seq_stats_summary, xaxis = \"State\", ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"South Africa\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_SouthAfrica.html","id":"get-vocs","dir":"Articles","previous_headings":"Plot stateswise sequenced cases","what":"Get VOCs","title":"Multinomial modeling - South Africa","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_southafrica_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_southafrica, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_southafrica_collapsed_sel <- gisaid_southafrica_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") %>% filter(lineage_collapsed != \"Unassigned\") %>% filter(State != \"Unknown\") vocs_to_keep <- table(gisaid_southafrica_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 50] gisaid_southafrica_collapsed_sel <- gisaid_southafrica_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_southafrica_shared_dateweek <- SummarizeVariantsDatewise(gisaid_southafrica_collapsed_sel, by_state = TRUE) head(gisaid_southafrica_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 Eastern Cape 19340 BQ.1+ 1 ## 2 Eastern Cape 19366 BA.5 1 ## 3 Eastern Cape 19366 BQ.1+ 1 ## 4 Eastern Cape 19367 BA.5 2 ## 5 Eastern Cape 19367 BQ.1+ 1 ## 6 Eastern Cape 19367 Others 1 fit_southafrica_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_southafrica_shared_dateweek) ## # weights: 48 (33 variable) ## initial value 6332.592642 ## iter 10 value 4506.511198 ## iter 20 value 3774.308144 ## iter 30 value 3687.379840 ## iter 40 value 3674.078156 ## final value 3673.923064 ## converged head(fit_southafrica_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State prob SE ## 1 BA.5 19269 Eastern Cape 0.7749025935 6.623080e-02 ## 2 BQ.1+ 19269 Eastern Cape 0.0033670249 1.433762e-03 ## 3 Others 19269 Eastern Cape 0.2215801968 6.561908e-02 ## 4 XBB 19269 Eastern Cape 0.0001501848 7.306782e-05 ## 5 BA.5 19276 Eastern Cape 0.7560557338 6.532893e-02 ## 6 BQ.1+ 19276 Eastern Cape 0.0054931242 2.150660e-03 ## df asymp.LCL asymp.UCL DateCollected ## 1 NA 6.450926e-01 0.9047125748 2022-10-04 ## 2 NA 5.569034e-04 0.0061771465 2022-10-04 ## 3 NA 9.296916e-02 0.3501912359 2022-10-04 ## 4 NA 6.974489e-06 0.0002933951 2022-10-04 ## 5 NA 6.280134e-01 0.8840980854 2022-10-11 ## 6 NA 1.277908e-03 0.0097083406 2022-10-11"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_SouthAfrica.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - South Africa","text":"","code":"muller_southafricabystate_mfit <- PlotMullerDailyPrevalence(fit_southafrica_multi_predsbystate, ncol = 3) muller_southafricabystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_UK.html","id":"plot-total-sequenced-cases","dir":"Articles","previous_headings":"","what":"Plot total sequenced cases","title":"Multinomial modeling - United Kingdom","text":"","code":"country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_uk, rename_country_as_state = TRUE) p0 <- BarPlot(country_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, xangle = 90, title = \"United Kingdom\") p0"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_UK.html","id":"get-vocs","dir":"Articles","previous_headings":"","what":"Get VOCs","title":"Multinomial modeling - United Kingdom","text":"","code":"vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_uk_collapsed <- CollapseLineageToVOCs( variant_df = gisaid_uk, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) gisaid_uk_collapsed_sel <- gisaid_uk_collapsed %>% filter(MonthYearCollected >= \"Oct 2022\") %>% filter(lineage_collapsed != \"Unassigned\") vocs_to_keep <- table(gisaid_uk_collapsed_sel$lineage_collapsed) vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100] gisaid_uk_collapsed_sel <- gisaid_uk_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep)) gisaid_uk_shared_dateweek <- SummarizeVariantsDatewise(gisaid_uk_collapsed_sel, by_state = TRUE) head(gisaid_uk_shared_dateweek) ## # A tibble: 6 × 4 ## State DateCollectedNumeric lineage_collapsed n ## ## 1 England 19266 BA.2.75 1 ## 2 England 19266 BA.5 1 ## 3 England 19266 Others 2 ## 4 England 19267 BA.4 2 ## 5 England 19267 BA.5 3 ## 6 England 19267 Others 3 fit_uk_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_uk_shared_dateweek) ## # weights: 42 (30 variable) ## initial value 212260.785522 ## iter 10 value 132682.285811 ## iter 20 value 124684.559590 ## iter 30 value 114429.990736 ## iter 40 value 111295.757402 ## iter 50 value 110969.952275 ## iter 60 value 110927.717094 ## iter 70 value 110926.524749 ## iter 80 value 110926.239561 ## iter 90 value 110924.251868 ## iter 100 value 110922.200728 ## final value 110922.032284 ## converged head(fit_uk_multi_predsbystate) ## lineage_collapsed DateCollectedNumeric State prob SE df ## 1 BA.2.75 19266 England 0.0327501455 8.594579e-03 NA ## 2 BA.4 19266 England 0.0497328609 9.222749e-03 NA ## 3 BA.5 19266 England 0.6155197047 1.628229e-02 NA ## 4 BQ.1+ 19266 England 0.1886427943 9.305751e-03 NA ## 5 Others 19266 England 0.1124983741 5.583855e-03 NA ## 6 XBB 19266 England 0.0008561205 5.794389e-05 NA ## asymp.LCL asymp.UCL DateCollected ## 1 0.0159050796 0.0495952114 2022-10-01 ## 2 0.0316566054 0.0678091164 2022-10-01 ## 3 0.5836070074 0.6474324020 2022-10-01 ## 4 0.1704038582 0.2068817303 2022-10-01 ## 5 0.1015542204 0.1234425279 2022-10-01 ## 6 0.0007425525 0.0009696884 2022-10-01"},{"path":"http://saket-choudhary.me/covmuller/articles/MultinomialModeling_UK.html","id":"plot-smooth-muller-plots","dir":"Articles","previous_headings":"","what":"Plot Smooth Muller Plots","title":"Multinomial modeling - United Kingdom","text":"","code":"muller_ukbystate_mfit <- PlotMullerDailyPrevalence(fit_uk_multi_predsbystate, ncol = 3) muller_ukbystate_mfit"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Bengaluru (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Bengaluru (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"get-monthly-cases-for-bengaluru","dir":"Articles","previous_headings":"","what":"Get monthly cases for Bengaluru","title":"Animation of projected weekly cases - Bengaluru (India)","text":"","code":"Bengaluru_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District %in% c(\"Bengaluru Urban\", \"Bengaluru Rural\")) ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Bengaluru_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [3] ## MonthYear State District value ## ## 1 Apr 2020 Karnataka Bengaluru Rural 6 ## 2 Apr 2020 Karnataka Bengaluru Urban 141 ## 3 May 2020 Karnataka Bengaluru Rural 9 ## 4 May 2020 Karnataka Bengaluru Urban 218 ## 5 Jun 2020 Karnataka Bengaluru Rural 114 ## 6 Jun 2020 Karnataka Bengaluru Urban 4196"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"plot-monthly-cases-for-bengaluru","dir":"Articles","previous_headings":"Get monthly cases for Bengaluru","what":"Plot monthly cases for Bengaluru","title":"Animation of projected weekly cases - Bengaluru (India)","text":"","code":"p1 <- BarPlot(Bengaluru_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Bengaluru (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"get-weekly-cases-for-bengaluru","dir":"Articles","previous_headings":"","what":"Get weekly cases for Bengaluru","title":"Animation of projected weekly cases - Bengaluru (India)","text":"","code":"Bengaluru_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Bengaluru\"), rename_country_as_state = TRUE) p2 <- BarPlot(Bengaluru_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Bengaluru (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"overall-how-much-has-bengaluru-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Bengaluru","what":"Overall, how much has Bengaluru sequenced over months?","title":"Animation of projected weekly cases - Bengaluru (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Bengaluru_monthly_cases_tmp <- Bengaluru_monthly_cases %>% select(MonthYear, value) Bengaluru_monthly_cases_tmp$State <- \"India\" Bengaluru_monthly_cases_tmp$type <- \"Confirmed\" Bengaluru_monthly_cases_tmp <- Bengaluru_monthly_cases_tmp %>% group_by(MonthYear, State, type) %>% summarise(value = sum(value)) Bengaluru_monthly_cases_tmp <- Bengaluru_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Bengaluru_seq_stats, confirmed_long = Bengaluru_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Bengaluru (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Bengaluru.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Bengaluru (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Bengaluru\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Bengaluru Urban\", \"Bengaluru Rural\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 44 (30 variable) ## initial value 27280.854519 ## iter 10 value 12654.212777 ## iter 20 value 6673.400386 ## iter 30 value 5900.795573 ## iter 40 value 5579.611334 ## iter 50 value 5437.754669 ## iter 60 value 5289.623501 ## iter 70 value 5089.205002 ## iter 80 value 4828.414224 ## iter 90 value 4722.853944 ## iter 100 value 4716.025496 ## iter 110 value 4708.762722 ## iter 120 value 4703.187810 ## iter 130 value 4702.317236 ## iter 140 value 4700.036796 ## iter 150 value 4698.415786 ## iter 160 value 4691.593834 ## iter 170 value 4666.532005 ## iter 180 value 4647.199789 ## iter 190 value 4645.953016 ## iter 200 value 4644.413888 ## iter 210 value 4640.909007 ## iter 220 value 4639.913660 ## iter 230 value 4639.756334 ## iter 240 value 4639.163422 ## iter 250 value 4637.084115 ## iter 260 value 4636.784964 ## iter 270 value 4635.808570 ## iter 280 value 4634.779618 ## iter 290 value 4634.438043 ## iter 300 value 4634.244641 ## final value 4632.480217 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Bengaluru (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Bengaluru_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Bengaluru Urban\", \"Bengaluru Rural\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Bengaluru\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 13260.587551 ## iter 10 value 4244.312127 ## iter 20 value 3571.482803 ## iter 30 value 3494.250103 ## iter 40 value 3457.604725 ## iter 50 value 3444.861697 ## iter 60 value 3440.569061 ## iter 70 value 3439.411840 ## iter 80 value 3438.525153 ## iter 90 value 3438.196092 ## iter 100 value 3437.826340 ## iter 110 value 3437.265419 ## iter 120 value 3437.234425 ## iter 130 value 3437.191321 ## iter 140 value 3437.012394 ## iter 150 value 3436.953845 ## iter 160 value 3436.881184 ## iter 170 value 3436.695579 ## iter 180 value 3436.659370 ## iter 190 value 3436.612976 ## iter 200 value 3436.592489 ## iter 210 value 3436.564673 ## iter 220 value 3436.539005 ## final value 3436.537103 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Bengaluru (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Bengaluru_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Bengaluru Urban\", \"Bengaluru Rural\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Bengaluru\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 13260.587551 ## iter 10 value 4244.312127 ## iter 20 value 3571.482803 ## iter 30 value 3494.250103 ## iter 40 value 3457.604725 ## iter 50 value 3444.861697 ## iter 60 value 3440.569061 ## iter 70 value 3439.411840 ## iter 80 value 3438.525153 ## iter 90 value 3438.196092 ## iter 100 value 3437.826340 ## iter 110 value 3437.265419 ## iter 120 value 3437.234425 ## iter 130 value 3437.191321 ## iter 140 value 3437.012394 ## iter 150 value 3436.953845 ## iter 160 value 3436.881184 ## iter 170 value 3436.695579 ## iter 180 value 3436.659370 ## iter 190 value 3436.612976 ## iter 200 value 3436.592489 ## iter 210 value 3436.564673 ## iter 220 value 3436.539005 ## final value 3436.537103 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Bengaluru (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Bengaluru_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- \"Unknown\" gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"state-of-origin-of-ba4ba-5-sequences","dir":"Articles","previous_headings":"","what":"State of origin of BA/4/BA.5 sequences?","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"gisaid_india %>% filter(pangolin_lineage %in% c(\"BA.4\", \"BA.5\")) %>% pull(State) %>% table() %>% as.data.frame() %>% arrange(desc(Freq)) %>% DT::datatable()"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"city-of-origin-of-ba-4ba-5-sequences","dir":"Articles","previous_headings":"","what":"City of origin of BA.4/BA.5 sequences?","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"gisaid_india %>% filter(pangolin_lineage %in% c(\"BA.4\", \"BA.5\")) %>% pull(custom_city) %>% table() %>% as.data.frame() %>% arrange(desc(Freq)) %>% DT::datatable()"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"get-monthly-cases-for-chennai","dir":"Articles","previous_headings":"","what":"Get monthly cases for Chennai","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"chennai_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Chennai\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(chennai_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 Tamil Nadu Chennai 910 ## 2 May 2020 Tamil Nadu Chennai 13889 ## 3 Jun 2020 Tamil Nadu Chennai 43528 ## 4 Jul 2020 Tamil Nadu Chennai 41467 ## 5 Aug 2020 Tamil Nadu Chennai 35803 ## 6 Sep 2020 Tamil Nadu Chennai 31779"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"plot-monthly-cases-for-chennai","dir":"Articles","previous_headings":"Get monthly cases for Chennai","what":"Plot monthly cases for Chennai","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"p1 <- BarPlot(chennai_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Chennai (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"get-weekly-cases-for-chennai","dir":"Articles","previous_headings":"","what":"Get weekly cases for Chennai","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"chennai_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Chennai\"), rename_country_as_state = TRUE) p2 <- BarPlot(chennai_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Chennai (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"overall-how-much-has-chennai-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Chennai","what":"Overall, how much has Chennai sequenced over months?","title":"Animation of projected weekly cases - Chennai (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"chennai_monthly_cases_tmp <- chennai_monthly_cases %>% select(MonthYear, value) chennai_monthly_cases_tmp$State <- \"India\" chennai_monthly_cases_tmp$type <- \"Confirmed\" chennai_monthly_cases_tmp <- chennai_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = chennai_seq_stats, confirmed_long = chennai_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Chennai (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Chennai (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(custom_city == \"Chennai\")) state_month_counts$State <- \"Chennai\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Chennai.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Chennai (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Chennai\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Chennai\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 48 (33 variable) ## initial value 15605.213761 ## iter 10 value 9346.725587 ## iter 20 value 6735.265161 ## iter 30 value 6252.767740 ## iter 40 value 5962.591363 ## iter 50 value 5839.616667 ## iter 60 value 5688.700478 ## iter 70 value 5646.847872 ## iter 80 value 5644.264029 ## iter 90 value 5635.112092 ## iter 100 value 5632.626406 ## iter 110 value 5611.731368 ## iter 120 value 5608.160319 ## iter 130 value 5602.430986 ## iter 140 value 5602.085418 ## iter 150 value 5601.992062 ## iter 160 value 5601.547330 ## iter 170 value 5599.095961 ## iter 180 value 5597.310934 ## iter 190 value 5596.025887 ## iter 200 value 5586.144855 ## iter 210 value 5582.730045 ## iter 220 value 5582.206277 ## iter 230 value 5581.641031 ## iter 240 value 5580.844556 ## iter 250 value 5578.550303 ## iter 260 value 5577.858001 ## iter 270 value 5577.656828 ## iter 280 value 5577.632627 ## iter 290 value 5577.545751 ## iter 300 value 5577.491586 ## iter 310 value 5577.422956 ## iter 320 value 5576.188103 ## iter 330 value 5571.337207 ## final value 5569.995071 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Chennai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Chennai_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Chennai\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Chennai\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 9646.732682 ## iter 10 value 4436.449277 ## iter 20 value 3750.586782 ## iter 30 value 3524.118672 ## iter 40 value 3477.534654 ## iter 50 value 3461.347353 ## iter 60 value 3457.749224 ## iter 70 value 3455.803570 ## iter 80 value 3455.186713 ## iter 90 value 3453.396263 ## iter 100 value 3451.684841 ## iter 110 value 3448.796346 ## iter 120 value 3448.681536 ## iter 130 value 3448.621780 ## iter 140 value 3448.598491 ## iter 150 value 3448.517228 ## iter 160 value 3448.295038 ## iter 170 value 3448.240697 ## iter 180 value 3448.196202 ## iter 190 value 3448.104299 ## iter 200 value 3448.042618 ## iter 210 value 3448.020950 ## iter 220 value 3447.924799 ## iter 230 value 3447.797141 ## iter 240 value 3447.738687 ## iter 250 value 3447.697683 ## iter 260 value 3447.677071 ## iter 270 value 3447.658190 ## iter 280 value 3447.631436 ## iter 290 value 3447.563336 ## iter 300 value 3447.544602 ## final value 3447.504293 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Chennai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Chennai_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Chennai\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Chennai\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 9646.732682 ## iter 10 value 4436.449277 ## iter 20 value 3750.586782 ## iter 30 value 3524.118672 ## iter 40 value 3477.534654 ## iter 50 value 3461.347353 ## iter 60 value 3457.749224 ## iter 70 value 3455.803570 ## iter 80 value 3455.186713 ## iter 90 value 3453.396263 ## iter 100 value 3451.684841 ## iter 110 value 3448.796346 ## iter 120 value 3448.681536 ## iter 130 value 3448.621780 ## iter 140 value 3448.598491 ## iter 150 value 3448.517228 ## iter 160 value 3448.295038 ## iter 170 value 3448.240697 ## iter 180 value 3448.196202 ## iter 190 value 3448.104299 ## iter 200 value 3448.042618 ## iter 210 value 3448.020950 ## iter 220 value 3447.924799 ## iter 230 value 3447.797141 ## iter 240 value 3447.738687 ## iter 250 value 3447.697683 ## iter 260 value 3447.677071 ## iter 270 value 3447.658190 ## iter 280 value 3447.631436 ## iter 290 value 3447.563336 ## iter 300 value 3447.544602 ## final value 3447.504293 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Chennai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Chennai_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"get-monthly-cases-for-delhi","dir":"Articles","previous_headings":"","what":"Get monthly cases for Delhi","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"NewDelhi_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Delhi\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(NewDelhi_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 Delhi Delhi 3515 ## 2 May 2020 Delhi Delhi 16329 ## 3 Jun 2020 Delhi Delhi 67516 ## 4 Jul 2020 Delhi Delhi 48238 ## 5 Aug 2020 Delhi Delhi 39150 ## 6 Sep 2020 Delhi Delhi 104967"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"plot-monthly-cases-for-new-delhi","dir":"Articles","previous_headings":"Get monthly cases for Delhi","what":"Plot monthly cases for New Delhi","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"p1 <- BarPlot(NewDelhi_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - New Delhi (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"get-weekly-cases-for-new-delhi","dir":"Articles","previous_headings":"","what":"Get weekly cases for New Delhi","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"NewDelhi_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"New Delhi\"), rename_country_as_state = TRUE) p2 <- BarPlot(NewDelhi_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from New Delhi (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"overall-how-much-has-new-delhi-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for New Delhi","what":"Overall, how much has New Delhi sequenced over months?","title":"Animation of projected weekly cases - New Delhi (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"NewDelhi_monthly_cases_cases_tmp <- NewDelhi_monthly_cases %>% select(MonthYear, value) NewDelhi_monthly_cases_cases_tmp$State <- \"India\" NewDelhi_monthly_cases_cases_tmp$type <- \"Confirmed\" NewDelhi_monthly_cases_cases_tmp <- NewDelhi_monthly_cases_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = NewDelhi_seq_stats, confirmed_long = NewDelhi_monthly_cases_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from New Delhi (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - New Delhi (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(custom_city == \"New Delhi\")) state_month_counts$State <- \"New Delhi\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Delhi.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - New Delhi (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"New Delhi\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Delhi\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 32 (21 variable) ## initial value 4302.364550 ## iter 10 value 1572.411772 ## iter 20 value 1123.483648 ## iter 30 value 1016.583002 ## iter 40 value 997.937340 ## iter 50 value 984.531287 ## iter 60 value 942.126087 ## iter 70 value 936.966776 ## iter 80 value 921.123735 ## iter 90 value 918.589362 ## iter 100 value 917.222805 ## iter 110 value 909.578605 ## iter 120 value 904.884701 ## iter 130 value 884.008789 ## iter 140 value 881.890180 ## iter 150 value 881.523712 ## iter 160 value 881.336429 ## iter 170 value 877.763992 ## iter 180 value 877.432142 ## iter 190 value 877.150836 ## iter 200 value 876.799542 ## iter 210 value 876.346739 ## iter 220 value 876.299027 ## iter 230 value 876.256709 ## iter 240 value 876.049911 ## iter 250 value 875.612340 ## iter 260 value 874.869984 ## iter 270 value 874.552435 ## iter 280 value 874.227920 ## iter 290 value 873.978667 ## iter 300 value 873.901212 ## iter 310 value 873.879910 ## iter 320 value 873.859179 ## iter 330 value 873.711357 ## iter 340 value 873.060577 ## iter 350 value 872.863673 ## iter 360 value 872.577441 ## iter 370 value 872.384707 ## iter 380 value 872.127411 ## iter 390 value 871.977778 ## iter 400 value 871.876208 ## iter 410 value 871.847102 ## iter 420 value 871.508436 ## iter 430 value 871.060681 ## final value 871.057527 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New Delhi (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/NewDelhi_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Delhi\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"New Delhi\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 24 (15 variable) ## initial value 987.259468 ## iter 10 value 209.938281 ## iter 20 value 191.017827 ## iter 30 value 189.292215 ## iter 40 value 188.434340 ## iter 50 value 187.750904 ## iter 60 value 187.394283 ## iter 70 value 187.164293 ## iter 80 value 187.015105 ## iter 90 value 186.962660 ## iter 100 value 186.868844 ## iter 110 value 186.823994 ## iter 120 value 186.791548 ## iter 130 value 186.759796 ## iter 140 value 186.719025 ## iter 150 value 186.694064 ## iter 160 value 186.685413 ## iter 170 value 186.677086 ## iter 180 value 186.655211 ## iter 190 value 186.632648 ## iter 200 value 186.619366 ## iter 210 value 186.607642 ## iter 220 value 186.588133 ## iter 230 value 186.576262 ## iter 240 value 186.566091 ## iter 250 value 186.539792 ## iter 260 value 186.514579 ## iter 270 value 186.512583 ## iter 280 value 186.498376 ## final value 186.498347 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New Delhi (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/NewDelhi_animated_2021.gif\"), animation = the_anim) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"New Delhi\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 24 (15 variable) ## initial value 987.259468 ## iter 10 value 209.938281 ## iter 20 value 191.017827 ## iter 30 value 189.292215 ## iter 40 value 188.434340 ## iter 50 value 187.750904 ## iter 60 value 187.394283 ## iter 70 value 187.164293 ## iter 80 value 187.015105 ## iter 90 value 186.962660 ## iter 100 value 186.868844 ## iter 110 value 186.823994 ## iter 120 value 186.791548 ## iter 130 value 186.759796 ## iter 140 value 186.719025 ## iter 150 value 186.694064 ## iter 160 value 186.685413 ## iter 170 value 186.677086 ## iter 180 value 186.655211 ## iter 190 value 186.632648 ## iter 200 value 186.619366 ## iter 210 value 186.607642 ## iter 220 value 186.588133 ## iter 230 value 186.576262 ## iter 240 value 186.566091 ## iter 250 value 186.539792 ## iter 260 value 186.514579 ## iter 270 value 186.512583 ## iter 280 value 186.498376 ## final value 186.498347 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New Delhi (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/NewDelhi_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Germany.html","id":"get-variants-data-for-germany","dir":"Articles","previous_headings":"","what":"Get variants data for Germany","title":"Animation of projected weekly cases - Germany","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_germany <- gisaid_metadata %>% filter(Country == \"Germany\") %>% filter(Host == \"Human\") # format metadata gisaid_germany <- FormatGISAIDMetadata(gisaid_germany) %>% filter(State != \"\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_germany <- gisaid_germany %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") %>% filter(State != \"Unknown\") vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_germany <- gisaid_germany %>% filter(pangolin_lineage != \"None\") %>% filter(!is.na(MonthYearCollected)) %>% filter(pangolin_lineage != \"Unassigned\") gisaid_germany <- CollapseLineageToVOCs( variant_df = gisaid_germany, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Germany.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Germany","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_germany) state_month_counts$State <- \"Germany\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Germany.html","id":"get-weekly-cases-for-germany","dir":"Articles","previous_headings":"","what":"Get weekly cases for Germany","title":"Animation of projected weekly cases - Germany","text":"","code":"confirmed.tmp <- COVID19::covid19(country = \"Germany\", verbose = FALSE, level = 2) %>% select(date, administrative_area_level_2, confirmed) %>% rename(State = administrative_area_level_2) confirmed <- COVID19::covid19(country = \"Germany\", verbose = FALSE) %>% select(date, confirmed) %>% filter(!is.na(confirmed)) confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_germany_weekwise <- SummarizeVariantsWeekwise(gisaid_germany)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Germany.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Germany","text":"Look cases October,2021 :","code":"voc_to_keep <- gisaid_germany_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_germany_weekwise <- gisaid_germany_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_germany_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 64 (45 variable) ## initial value 2541013.794392 ## iter 10 value 1436014.351377 ## iter 20 value 1200649.359247 ## iter 30 value 1077138.014753 ## iter 40 value 895460.149087 ## iter 50 value 690003.838247 ## iter 60 value 612618.319791 ## iter 70 value 601203.308286 ## iter 80 value 598226.217654 ## iter 90 value 596582.929614 ## iter 100 value 596255.136217 ## iter 110 value 595722.103952 ## iter 120 value 590570.174104 ## iter 130 value 586915.107977 ## iter 140 value 586633.801923 ## iter 150 value 586531.832978 ## iter 160 value 586527.821082 ## iter 170 value 586527.267376 ## iter 180 value 586526.888955 ## final value 586526.661932 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Germany by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Germany_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"Dec 2021\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_germany_subset <- gisaid_germany %>% filter(MonthYearCollected > \"Dec 2021\") gisaid_germany_weekwise <- SummarizeVariantsWeekwise(gisaid_germany_subset) voc_to_keep <- gisaid_germany_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_germany_weekwise <- gisaid_germany_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_germany_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 1367452.533009 ## iter 10 value 751017.747720 ## iter 20 value 658423.038647 ## iter 30 value 559986.050260 ## iter 40 value 461925.415351 ## iter 50 value 439359.230923 ## iter 60 value 433166.405710 ## iter 70 value 432394.696474 ## iter 80 value 430788.951975 ## iter 90 value 429166.390439 ## iter 100 value 429161.187543 ## final value 429161.084513 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Germany by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Germany_animated_2021.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq) DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"get-monthly-cases-for-gujarat","dir":"Articles","previous_headings":"","what":"Get monthly cases for Gujarat","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"Gujarat_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == \"Gujarat\") ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Gujarat_monthly_cases) ## MonthYear State value type ## 1 Mar 2020 Gujarat 74 Confirmed ## 2 Apr 2020 Gujarat 4321 Confirmed ## 3 May 2020 Gujarat 12399 Confirmed ## 4 Jun 2020 Gujarat 15849 Confirmed ## 5 Jul 2020 Gujarat 28795 Confirmed ## 6 Aug 2020 Gujarat 34997 Confirmed"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"plot-monthly-cases-for-gujarat","dir":"Articles","previous_headings":"Get monthly cases for Gujarat","what":"Plot monthly cases for Gujarat","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"p1 <- BarPlot(Gujarat_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Gujarat (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"get-weekly-cases-for-gujarat","dir":"Articles","previous_headings":"","what":"Get weekly cases for Gujarat","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"Gujarat_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(State == \"Gujarat\"), rename_country_as_state = TRUE) p2 <- BarPlot(Gujarat_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Gujarat (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"overall-how-much-has-gujarat-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Gujarat","what":"Overall, how much has Gujarat sequenced over months?","title":"Animation of projected weekly cases - Gujarat (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Gujarat_monthly_cases_tmp <- Gujarat_monthly_cases %>% select(MonthYear, value) Gujarat_monthly_cases_tmp$State <- \"India\" Gujarat_monthly_cases_tmp$type <- \"Confirmed\" Gujarat_monthly_cases_tmp <- Gujarat_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Gujarat_seq_stats, confirmed_long = Gujarat_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Gujarat (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Gujarat (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(State == \"Gujarat\")) state_month_counts$State <- \"Gujarat\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Gujarat.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Gujarat (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(State == \"Gujarat\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(State %in% c(\"Gujarat\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 52 (36 variable) ## initial value 38764.079639 ## iter 10 value 17744.693245 ## iter 20 value 15353.290900 ## iter 30 value 11804.024603 ## iter 40 value 11003.283524 ## iter 50 value 9855.261192 ## iter 60 value 9537.385392 ## iter 70 value 9478.499569 ## iter 80 value 9461.186853 ## iter 90 value 9456.051637 ## iter 100 value 9431.217254 ## iter 110 value 9407.310468 ## iter 120 value 9377.377643 ## iter 130 value 9344.599124 ## iter 140 value 9330.446441 ## iter 150 value 9322.375629 ## iter 160 value 9321.930201 ## iter 170 value 9317.108359 ## iter 180 value 9312.966862 ## iter 190 value 9309.077117 ## iter 200 value 9301.992421 ## iter 210 value 9286.413430 ## iter 220 value 9269.038826 ## iter 230 value 9268.396739 ## iter 240 value 9265.527420 ## iter 250 value 9262.656451 ## iter 260 value 9261.791977 ## iter 270 value 9260.319589 ## iter 280 value 9259.472335 ## iter 290 value 9258.206341 ## iter 300 value 9257.205463 ## iter 310 value 9257.153682 ## iter 320 value 9256.630873 ## iter 330 value 9255.452898 ## iter 340 value 9254.743776 ## iter 350 value 9253.155977 ## iter 360 value 9251.176747 ## iter 370 value 9250.928093 ## iter 380 value 9250.915270 ## iter 390 value 9250.734815 ## iter 400 value 9250.429761 ## iter 410 value 9250.151556 ## iter 420 value 9249.753608 ## iter 430 value 9249.158697 ## iter 440 value 9248.140073 ## iter 450 value 9248.120433 ## iter 460 value 9247.903035 ## iter 470 value 9247.734087 ## iter 480 value 9247.487534 ## iter 490 value 9247.092301 ## iter 500 value 9246.875676 ## iter 510 value 9246.698038 ## final value 9246.641456 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Gujarat (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Gujarat_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(State %in% c(\"Gujarat\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Gujarat\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 21402.528439 ## iter 10 value 10912.220209 ## iter 20 value 8286.883657 ## iter 30 value 6854.495448 ## iter 40 value 6689.035906 ## iter 50 value 6650.708185 ## iter 60 value 6608.192890 ## iter 70 value 6586.968376 ## iter 80 value 6547.505054 ## iter 90 value 6528.787140 ## iter 100 value 6527.524930 ## iter 110 value 6527.321975 ## final value 6527.321571 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Gujarat (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Gujarat_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(State %in% c(\"Gujarat\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Gujarat\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 21402.528439 ## iter 10 value 10912.220209 ## iter 20 value 8286.883657 ## iter 30 value 6854.495448 ## iter 40 value 6689.035906 ## iter 50 value 6650.708185 ## iter 60 value 6608.192890 ## iter 70 value 6586.968376 ## iter 80 value 6547.505054 ## iter 90 value 6528.787140 ## iter 100 value 6527.524930 ## iter 110 value 6527.321975 ## final value 6527.321571 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Gujarat (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Gujarat_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-India.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - India","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GE.1` = \"GE.1\", `GE.1.*` = \"GE.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-India.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - India","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india) state_month_counts$State <- \"India\" state_month_prevalence <- CountsToPrevalence(state_month_counts) state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-India.html","id":"get-weekly-cases-for-india","dir":"Articles","previous_headings":"","what":"Get weekly cases for India","title":"Animation of projected weekly cases - India","text":"","code":"GetIndiaCases <- function(){ data <- read.csv(\"https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/cases_deaths/new_cases.csv\") confirmed <- data %>% select(date, India) colnames(confirmed)[2] <- c(\"cases\") confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_weekwise <- confirmed %>% group_by(WeekYear) %>% summarise(cases = mean(cases, na.rm=T)) %>% arrange(WeekYear) confirmed_subset_weekwise$cases <- ceiling(confirmed_subset_weekwise$cases) confirmed_subset_dateweekwise_long_india <- confirmed_subset_weekwise %>% rename(n = cases) %>% rename(WeekYearCollected = WeekYear) } confirmed_subset_dateweekwise_long_india <- GetIndiaCases() gisaid_india_weekwise <- SummarizeVariantsWeekwise(gisaid_india)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-India.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - India","text":"Look cases January, 2022 : Look cases last months: Look cases last months:","code":"voc_to_keep <- gisaid_india_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_india_weekwise <- gisaid_india_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_india_weekwise, confirmed_subset_dateweekwise_long_india) ## # weights: 48 (33 variable) ## initial value 604518.150134 ## iter 10 value 239290.717101 ## iter 20 value 211919.842428 ## iter 30 value 150571.240170 ## iter 40 value 115302.479481 ## iter 50 value 111877.511346 ## iter 60 value 108533.841765 ## iter 70 value 106057.824153 ## iter 80 value 106002.127446 ## iter 90 value 105868.155159 ## iter 100 value 105675.198731 ## iter 110 value 105171.392178 ## iter 120 value 105124.977172 ## iter 130 value 105123.283786 ## final value 105122.768012 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in India by variant\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**\", date_breaks = \"28 days\") # , trans_y=\"log10\") gganimate::anim_save(filename = here::here(\"docs/articles/IN_animated.gif\"), animation = the_anim) ##confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() # confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% # filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% # group_by(WeekYear) %>% # summarise(n = sum(value)) %>% # arrange(WeekYear) %>% # rename(WeekYearCollected = WeekYear) confirmed_subset_dateweekwise_long_india <- GetIndiaCases() %>% filter(WeekYearCollected >= tsibble::yearweek(\"2021 W35\")) gisaid_india <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_india) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india) ## # weights: 36 (24 variable) ## initial value 239025.075646 ## iter 10 value 54670.508003 ## iter 20 value 47864.975637 ## iter 30 value 43612.533101 ## iter 40 value 41166.541898 ## iter 50 value 40459.092105 ## iter 60 value 40351.681054 ## iter 70 value 40152.813651 ## iter 80 value 40092.206218 ## iter 90 value 40087.562871 ## iter 100 value 40078.965829 ## iter 110 value 40076.541732 ## iter 120 value 40075.378575 ## iter 130 value 40075.230960 ## iter 140 value 40074.684228 ## final value 40074.591451 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in India by variant\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**
\") # , trans_y=\"log10\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/IN_animated_2021.gif\"), animation = the_anim) # confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() # confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% # filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% # group_by(WeekYear) %>% # summarise(n = sum(value)) %>% # arrange(WeekYear) %>% # rename(WeekYearCollected = WeekYear) confirmed_subset_dateweekwise_long_india <- GetIndiaCases() %>% filter(WeekYearCollected >= tsibble::yearweek(\"2022 W12\")) gisaid_india <- gisaid_india %>% filter(MonthYearCollected >= \"Mar 2022\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_india) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 10) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india) ## # weights: 40 (27 variable) ## initial value 137906.426390 ## iter 10 value 61113.746615 ## iter 20 value 44415.411795 ## iter 30 value 31015.016648 ## iter 40 value 29132.763443 ## iter 50 value 28862.886583 ## iter 60 value 28851.868322 ## iter 70 value 28844.129892 ## iter 80 value 28829.456669 ## iter 90 value 28818.262278 ## iter 100 value 28815.156792 ## iter 110 value 28813.225064 ## iter 120 value 28812.776639 ## iter 130 value 28812.709463 ## iter 140 value 28812.536162 ## iter 150 value 28812.411470 ## iter 160 value 28812.378914 ## final value 28812.316517 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in India by variant\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/IN_animated_2022.gif\"), animation = the_anim) #confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() # confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% # filter(WeekYear >= tsibble::yearweek(\"2022 W39\")) %>% # group_by(WeekYear) %>% # summarise(n = sum(value)) %>% # arrange(WeekYear) %>% # rename(WeekYearCollected = WeekYear) confirmed_subset_dateweekwise_long_india <- GetIndiaCases() %>% filter(WeekYearCollected >= tsibble::yearweek(\"2022 W39\")) gisaid_india <- gisaid_india %>% filter(MonthYearCollected >= \"Mar 2022\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_india) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 10) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india) ## # weights: 40 (27 variable) ## initial value 137906.426390 ## iter 10 value 61113.746615 ## iter 20 value 44415.411795 ## iter 30 value 31015.016648 ## iter 40 value 29132.763443 ## iter 50 value 28862.886583 ## iter 60 value 28851.868322 ## iter 70 value 28844.129892 ## iter 80 value 28829.456669 ## iter 90 value 28818.262278 ## iter 100 value 28815.156792 ## iter 110 value 28813.225064 ## iter 120 value 28812.776639 ## iter 130 value 28812.709463 ## iter 140 value 28812.536162 ## iter 150 value 28812.411470 ## iter 160 value 28812.378914 ## final value 28812.316517 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in India by variant\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/IN_animated_latest.gif\"), animation = the_anim) #confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() # confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% # filter(WeekYear >= tsibble::yearweek(\"2022 W39\")) %>% # group_by(WeekYear) %>% # summarise(n = sum(value)) %>% # arrange(WeekYear) %>% # rename(WeekYearCollected = WeekYear) confirmed_subset_dateweekwise_long_india <- GetIndiaCases() %>% filter(WeekYearCollected >= tsibble::yearweek(\"2023 W23\")) gisaid_india <- gisaid_india %>% filter(MonthYearCollected >= \"June 2023\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_india) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 10) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long_india) ## # weights: 24 (15 variable) ## initial value 1413.698221 ## iter 10 value 599.432562 ## iter 20 value 565.165427 ## iter 30 value 564.967411 ## iter 40 value 564.917097 ## iter 50 value 564.814682 ## iter 60 value 564.168373 ## iter 70 value 563.978967 ## iter 80 value 563.974712 ## final value 563.974621 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in India by variant\", caption = \"**Source: gisaid.org and ourworldindata.org/coronavirus**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/IN_animated_2023.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Jaipur (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Jaipur (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"get-monthly-cases-for-jaipur","dir":"Articles","previous_headings":"","what":"Get monthly cases for Jaipur","title":"Animation of projected weekly cases - Jaipur (India)","text":"","code":"chennai_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Jaipur\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(chennai_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 Rajasthan Jaipur 907 ## 2 May 2020 Rajasthan Jaipur 1084 ## 3 Jun 2020 Rajasthan Jaipur 1327 ## 4 Jul 2020 Rajasthan Jaipur 2100 ## 5 Aug 2020 Rajasthan Jaipur 5373 ## 6 Sep 2020 Rajasthan Jaipur 10697"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"plot-monthly-cases-for-jaipur","dir":"Articles","previous_headings":"Get monthly cases for Jaipur","what":"Plot monthly cases for Jaipur","title":"Animation of projected weekly cases - Jaipur (India)","text":"","code":"p1 <- BarPlot(chennai_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Jaipur (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"get-weekly-cases-for-jaipur","dir":"Articles","previous_headings":"","what":"Get weekly cases for Jaipur","title":"Animation of projected weekly cases - Jaipur (India)","text":"","code":"chennai_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Jaipur\"), rename_country_as_state = TRUE) p2 <- BarPlot(chennai_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Jaipur (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"overall-how-much-has-jaipur-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Jaipur","what":"Overall, how much has Jaipur sequenced over months?","title":"Animation of projected weekly cases - Jaipur (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"chennai_monthly_cases_tmp <- chennai_monthly_cases %>% select(MonthYear, value) chennai_monthly_cases_tmp$State <- \"India\" chennai_monthly_cases_tmp$type <- \"Confirmed\" chennai_monthly_cases_tmp <- chennai_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = chennai_seq_stats, confirmed_long = chennai_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Jaipur (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Jaipur.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Jaipur (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Jaipur\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Jaipur\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 40 (27 variable) ## initial value 11706.342613 ## iter 10 value 4681.457858 ## iter 20 value 3325.044410 ## iter 30 value 2938.538953 ## iter 40 value 2903.499413 ## iter 50 value 2893.454462 ## iter 60 value 2886.934015 ## iter 70 value 2881.288738 ## iter 80 value 2878.495549 ## iter 90 value 2872.100772 ## iter 100 value 2865.587078 ## iter 110 value 2864.104513 ## iter 120 value 2864.001574 ## iter 130 value 2863.350780 ## iter 140 value 2862.395382 ## iter 150 value 2861.821554 ## iter 160 value 2861.059578 ## iter 170 value 2860.837644 ## iter 180 value 2860.742589 ## iter 190 value 2860.225128 ## iter 200 value 2859.887634 ## iter 210 value 2859.745341 ## iter 220 value 2859.447069 ## final value 2859.442954 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Jaipur (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Jaipur_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Jaipur\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Jaipur\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 36 (24 variable) ## initial value 8342.861720 ## iter 10 value 2201.853970 ## iter 20 value 1760.387081 ## iter 30 value 1741.001963 ## iter 40 value 1738.075480 ## iter 50 value 1737.470349 ## iter 60 value 1737.383133 ## iter 70 value 1737.021345 ## iter 80 value 1736.696090 ## iter 90 value 1735.985709 ## iter 100 value 1735.223423 ## iter 110 value 1735.215896 ## iter 120 value 1735.153141 ## iter 130 value 1735.093217 ## iter 140 value 1735.066843 ## iter 150 value 1735.054569 ## iter 160 value 1735.047039 ## iter 170 value 1735.045111 ## iter 180 value 1735.038829 ## iter 190 value 1734.946306 ## final value 1734.930932 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Jaipur (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Jaipur_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Jaipur\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Jaipur\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 36 (24 variable) ## initial value 8342.861720 ## iter 10 value 2201.853970 ## iter 20 value 1760.387081 ## iter 30 value 1741.001963 ## iter 40 value 1738.075480 ## iter 50 value 1737.470349 ## iter 60 value 1737.383133 ## iter 70 value 1737.021345 ## iter 80 value 1736.696090 ## iter 90 value 1735.985709 ## iter 100 value 1735.223423 ## iter 110 value 1735.215896 ## iter 120 value 1735.153141 ## iter 130 value 1735.093217 ## iter 140 value 1735.066843 ## iter 150 value 1735.054569 ## iter 160 value 1735.047039 ## iter 170 value 1735.045111 ## iter 180 value 1735.038829 ## iter 190 value 1734.946306 ## final value 1734.930932 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Jaipur (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Jaipur_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq) DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"get-monthly-cases-for-maharashtra","dir":"Articles","previous_headings":"","what":"Get monthly cases for Maharashtra","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"Maharashtra_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == \"Maharashtra\") ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Maharashtra_monthly_cases) ## MonthYear State value type ## 1 Mar 2020 Maharashtra 302 Confirmed ## 2 Apr 2020 Maharashtra 10196 Confirmed ## 3 May 2020 Maharashtra 57157 Confirmed ## 4 Jun 2020 Maharashtra 107106 Confirmed ## 5 Jul 2020 Maharashtra 247357 Confirmed ## 6 Aug 2020 Maharashtra 370423 Confirmed"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"plot-monthly-cases-for-maharashtra","dir":"Articles","previous_headings":"Get monthly cases for Maharashtra","what":"Plot monthly cases for Maharashtra","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"p1 <- BarPlot(Maharashtra_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Maharashtra (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"get-weekly-cases-for-maharashtra","dir":"Articles","previous_headings":"","what":"Get weekly cases for Maharashtra","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"Maharashtra_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(State == \"Maharashtra\"), rename_country_as_state = TRUE) p2 <- BarPlot(Maharashtra_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Maharashtra (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"overall-how-much-has-maharashtra-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Maharashtra","what":"Overall, how much has Maharashtra sequenced over months?","title":"Animation of projected weekly cases - Maharashtra (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Maharashtra_monthly_cases_tmp <- Maharashtra_monthly_cases %>% select(MonthYear, value) Maharashtra_monthly_cases_tmp$State <- \"India\" Maharashtra_monthly_cases_tmp$type <- \"Confirmed\" Maharashtra_monthly_cases_tmp <- Maharashtra_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Maharashtra_seq_stats, confirmed_long = Maharashtra_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Maharashtra (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Maharashtra (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(State == \"Maharashtra\")) state_month_counts$State <- \"Maharashtra\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Maharashtra.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Maharashtra (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(State == \"Maharashtra\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(State %in% c(\"Maharashtra\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 56 (39 variable) ## initial value 92290.473874 ## iter 10 value 43786.967640 ## iter 20 value 38091.652452 ## iter 30 value 29729.814614 ## iter 40 value 23751.363919 ## iter 50 value 22918.378841 ## iter 60 value 22241.960092 ## iter 70 value 21845.092602 ## iter 80 value 21640.028155 ## iter 90 value 21631.796291 ## iter 100 value 21489.927178 ## iter 110 value 21354.827950 ## iter 120 value 21295.057141 ## iter 130 value 21178.168747 ## iter 140 value 21137.030647 ## iter 150 value 21086.081089 ## iter 160 value 21079.634831 ## iter 170 value 21079.576266 ## iter 180 value 21078.868718 ## iter 190 value 21077.226378 ## iter 200 value 21072.273570 ## iter 210 value 21065.960936 ## iter 220 value 21062.511129 ## iter 230 value 21056.534789 ## iter 240 value 21046.623545 ## iter 250 value 21046.531874 ## iter 260 value 21043.480253 ## iter 270 value 21041.654565 ## iter 280 value 21038.878821 ## iter 290 value 21037.633188 ## iter 300 value 21035.886300 ## iter 310 value 21035.108472 ## final value 21034.906542 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Maharashtra (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Maharashtra_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(State %in% c(\"Maharashtra\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Maharashtra\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 37958.682168 ## iter 10 value 17440.035895 ## iter 20 value 14321.931849 ## iter 30 value 12536.769841 ## iter 40 value 12219.945997 ## iter 50 value 12169.134388 ## iter 60 value 12132.151435 ## iter 70 value 12120.294917 ## iter 80 value 12108.850280 ## iter 90 value 12089.693685 ## iter 100 value 12083.727592 ## iter 110 value 12080.349532 ## iter 120 value 12079.978119 ## final value 12079.589240 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Maharashtra (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Maharashtra_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(State %in% c(\"Maharashtra\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Maharashtra\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 37958.682168 ## iter 10 value 17440.035895 ## iter 20 value 14321.931849 ## iter 30 value 12536.769841 ## iter 40 value 12219.945997 ## iter 50 value 12169.134388 ## iter 60 value 12132.151435 ## iter 70 value 12120.294917 ## iter 80 value 12108.850280 ## iter 90 value 12089.693685 ## iter 100 value 12083.727592 ## iter 110 value 12080.349532 ## iter 120 value 12079.978119 ## final value 12079.589240 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Maharashtra (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Maharashtra_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"get-monthly-cases-for-mumbai","dir":"Articles","previous_headings":"","what":"Get monthly cases for Mumbai","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"Mumbai_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Mumbai\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Mumbai_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 Maharashtra Mumbai 7061 ## 2 May 2020 Maharashtra Mumbai 32625 ## 3 Jun 2020 Maharashtra Mumbai 37972 ## 4 Jul 2020 Maharashtra Mumbai 36626 ## 5 Aug 2020 Maharashtra Mumbai 32340 ## 6 Sep 2020 Maharashtra Mumbai 59463"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"plot-monthly-cases-for-mumbai","dir":"Articles","previous_headings":"Get monthly cases for Mumbai","what":"Plot monthly cases for Mumbai","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"p1 <- BarPlot(Mumbai_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Mumbai (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"get-weekly-cases-for-mumbai","dir":"Articles","previous_headings":"","what":"Get weekly cases for Mumbai","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"Mumbai_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Mumbai\"), rename_country_as_state = TRUE) p2 <- BarPlot(Mumbai_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Mumbai (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"overall-how-much-has-mumbai-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Mumbai","what":"Overall, how much has Mumbai sequenced over months?","title":"Animation of projected weekly cases - Mumbai (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Mumbai_monthly_cases_tmp <- Mumbai_monthly_cases %>% select(MonthYear, value) Mumbai_monthly_cases_tmp$State <- \"India\" Mumbai_monthly_cases_tmp$type <- \"Confirmed\" Mumbai_monthly_cases_tmp <- Mumbai_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Mumbai_seq_stats, confirmed_long = Mumbai_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Mumbai (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Mumbai (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(custom_city == \"Mumbai\")) state_month_counts$State <- \"Mumbai\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Mumbai.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Mumbai (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Mumbai\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Mumbai\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 44 (30 variable) ## initial value 15574.329797 ## iter 10 value 7180.065979 ## iter 20 value 4687.044311 ## iter 30 value 4136.486563 ## iter 40 value 3969.175266 ## iter 50 value 3825.992578 ## iter 60 value 3799.447246 ## iter 70 value 3780.892669 ## iter 80 value 3777.022187 ## iter 90 value 3766.742649 ## iter 100 value 3759.681911 ## iter 110 value 3750.156800 ## iter 120 value 3732.670839 ## iter 130 value 3732.047471 ## iter 140 value 3729.770426 ## iter 150 value 3727.391408 ## iter 160 value 3725.303330 ## iter 170 value 3721.171763 ## iter 180 value 3718.983600 ## iter 190 value 3718.679393 ## iter 200 value 3718.266131 ## iter 210 value 3717.388299 ## iter 220 value 3716.550086 ## iter 230 value 3714.654290 ## iter 240 value 3711.627573 ## iter 250 value 3709.147146 ## iter 260 value 3707.628286 ## iter 270 value 3706.024933 ## iter 280 value 3705.084712 ## iter 290 value 3704.698938 ## iter 300 value 3704.246987 ## final value 3703.258517 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Mumbai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Mumbai_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Mumbai\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Mumbai\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 8236.346878 ## iter 10 value 3535.607096 ## iter 20 value 2813.442453 ## iter 30 value 2610.377376 ## iter 40 value 2578.461798 ## iter 50 value 2569.905312 ## iter 60 value 2553.883708 ## iter 70 value 2552.515452 ## iter 80 value 2550.730665 ## iter 90 value 2548.764127 ## iter 100 value 2546.005380 ## iter 110 value 2544.766794 ## iter 120 value 2544.734442 ## iter 130 value 2544.663193 ## iter 140 value 2544.585915 ## iter 150 value 2544.447931 ## iter 160 value 2544.395797 ## iter 170 value 2544.295029 ## iter 180 value 2544.210785 ## iter 190 value 2544.163845 ## iter 200 value 2544.089318 ## iter 210 value 2543.958257 ## iter 220 value 2543.905407 ## final value 2543.903712 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Mumbai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Mumbai_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Mumbai\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Mumbai\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 8236.346878 ## iter 10 value 3535.607096 ## iter 20 value 2813.442453 ## iter 30 value 2610.377376 ## iter 40 value 2578.461798 ## iter 50 value 2569.905312 ## iter 60 value 2553.883708 ## iter 70 value 2552.515452 ## iter 80 value 2550.730665 ## iter 90 value 2548.764127 ## iter 100 value 2546.005380 ## iter 110 value 2544.766794 ## iter 120 value 2544.734442 ## iter 130 value 2544.663193 ## iter 140 value 2544.585915 ## iter 150 value 2544.447931 ## iter 160 value 2544.395797 ## iter 170 value 2544.295029 ## iter 180 value 2544.210785 ## iter 190 value 2544.163845 ## iter 200 value 2544.089318 ## iter 210 value 2543.958257 ## iter 220 value 2543.905407 ## final value 2543.903712 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Mumbai (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Mumbai_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NYC.html","id":"get-variants-data-for-ny-state","dir":"Articles","previous_headings":"","what":"Get variants data for NY state","title":"Animation of projected weekly cases - New York City","text":"","code":"counties <- c(\"New York\", \"New York City\", \"New York County\", \"Queens County\", \"Bronx County\", \"Bronx\", \"Brooklyn\", \"Manhattan\", \"Queens\", \"Richmond County\") gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_usa <- gisaid_metadata %>% filter(Country == \"USA\") %>% filter(Host == \"Human\") # format metadata gisaid_usa <- FormatGISAIDMetadata(gisaid_usa) gisaid_usa <- gisaid_usa %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") gisaid_NY <- gisaid_usa %>% filter(State == \"New York\") gisaid_NYC <- gisaid_NY %>% filter(District %in% counties) vocs <- GetVOCs() custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_NYC <- gisaid_NYC %>% filter(pangolin_lineage != \"None\") gisaid_NYC <- CollapseLineageToVOCs( variant_df = gisaid_NYC, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NYC.html","id":"get-weekly-cases-for-new-york","dir":"Articles","previous_headings":"","what":"Get weekly cases for New York","title":"Animation of projected weekly cases - New York City","text":"","code":"confirmed <- read_csv(\"https://raw.githubusercontent.com/nychealth/coronavirus-data/master/trends/data-by-day.csv\") %>% select(date_of_interest, CASE_COUNT) colnames(confirmed) <- c(\"date\", \"daily_cases\") confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed$MonthYear <- GetMonthYear(confirmed$date, datefmt = \"%m/%d/%Y\") confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_NYC_weekwise <- SummarizeVariantsWeekwise(gisaid_NYC)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NYC.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - New York City","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_NYC) state_month_counts$State <- \"NYC\" state_month_prevalence <- CountsToPrevalence(state_month_counts) state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NYC.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - New York City","text":"Look cases 2023:","code":"voc_to_keep <- gisaid_NYC_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_NYC_weekwise <- gisaid_NYC_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) newyork_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_NYC_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 68 (48 variable) ## initial value 434742.421579 ## iter 10 value 172908.943693 ## iter 20 value 158096.275203 ## iter 30 value 137963.178756 ## iter 40 value 112185.093400 ## iter 50 value 96349.077242 ## iter 60 value 91375.768307 ## iter 70 value 89558.579783 ## iter 80 value 85230.672765 ## iter 90 value 82059.202655 ## iter 100 value 81330.375423 ## iter 110 value 81288.687707 ## iter 120 value 81082.417118 ## iter 130 value 80500.271895 ## iter 140 value 80215.197664 ## iter 150 value 80056.480328 ## iter 160 value 79994.371220 ## iter 170 value 79963.675813 ## iter 180 value 79926.006538 ## iter 190 value 79856.930388 ## iter 200 value 79851.554087 ## iter 210 value 79851.415523 ## iter 220 value 79848.446744 ## iter 230 value 79834.630875 ## iter 240 value 79829.614291 ## iter 250 value 79824.795167 ## iter 260 value 79817.678629 ## iter 270 value 79813.915561 ## iter 280 value 79810.872483 ## iter 290 value 79809.499585 ## final value 79809.414813 ## converged the_anim <- PlotVariantPrevalenceAnimated(newyork_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New York City by variant\", caption = \"**Source: gisaid.org and NYC Health**
\", date_breaks = \"14 days\") gganimate::anim_save(filename = here::here(\"docs/articles/NYC_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"April 2023\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_NYC_subset <- gisaid_NYC %>% filter(MonthYearCollected > \"April 2023\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_NYC_subset) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 8950.148256 ## iter 10 value 5960.417017 ## iter 20 value 5423.066784 ## iter 30 value 5353.275285 ## iter 40 value 5349.990803 ## iter 50 value 5348.273452 ## iter 60 value 5346.501931 ## iter 60 value 5346.501879 ## iter 70 value 5346.477768 ## iter 80 value 5346.300888 ## iter 90 value 5346.221968 ## iter 100 value 5346.156319 ## iter 110 value 5345.587597 ## final value 5345.582571 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New York City by variant\", caption = \"**Source: gisaid.org and NYC Health**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/NYC_animated_2023.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NewYork.html","id":"get-variants-data-for-ny-state","dir":"Articles","previous_headings":"","what":"Get variants data for NY state","title":"Animation of projected weekly cases - New York State","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_usa <- gisaid_metadata %>% filter(Country == \"USA\") %>% filter(Host == \"Human\") # format metadata gisaid_usa <- FormatGISAIDMetadata(gisaid_usa) gisaid_usa <- gisaid_usa %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") gisaid_NY <- gisaid_usa %>% filter(State == \"New York\") vocs <- GetVOCs() custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_NY <- gisaid_NY %>% filter(pangolin_lineage != \"None\") gisaid_NY <- CollapseLineageToVOCs( variant_df = gisaid_NY, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NewYork.html","id":"get-weekly-cases-for-new-york","dir":"Articles","previous_headings":"","what":"Get weekly cases for New York","title":"Animation of projected weekly cases - New York State","text":"","code":"confirmed <- covid19(country = \"USA\", level = 2) %>% filter(administrative_area_level_2 == \"New York\") %>% select(date, confirmed) %>% filter(!is.na(confirmed)) ## We have invested a lot of time and effort in creating COVID-19 Data ## Hub, please cite the following when using it: ## ## Guidotti, E., Ardia, D., (2020), \"COVID-19 Data Hub\", Journal of Open ## Source Software 5(51):2376, doi: 10.21105/joss.02376 ## ## The implementation details and the latest version of the data are ## described in: ## ## Guidotti, E., (2022), \"A worldwide epidemiological database for ## COVID-19 at fine-grained spatial resolution\", Sci Data 9(1):112, doi: ## 10.1038/s41597-022-01245-1 ## To print citations in BibTeX format use: ## > print(citation('COVID19'), bibtex=TRUE) ## ## To hide this message use 'verbose = FALSE'. confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_NY_weekwise <- SummarizeVariantsWeekwise(gisaid_NY)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NewYork.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - New York State","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_NY) state_month_counts$State <- \"New York\" state_month_prevalence <- CountsToPrevalence(state_month_counts) state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-NewYork.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - New York State","text":"Look cases february, 2022 :","code":"voc_to_keep <- gisaid_NY_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_NY_weekwise <- gisaid_NY_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) newyork_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_NY_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 76 (54 variable) ## initial value 1017648.166663 ## iter 10 value 635967.740786 ## iter 20 value 561253.118952 ## iter 30 value 506758.650450 ## iter 40 value 415396.456372 ## iter 50 value 301316.426486 ## iter 60 value 234166.334608 ## iter 70 value 211152.164742 ## iter 80 value 204120.020928 ## iter 90 value 201692.347518 ## iter 100 value 199658.516348 ## iter 110 value 195917.115777 ## iter 120 value 195611.515708 ## iter 130 value 194517.524249 ## iter 140 value 190809.512018 ## iter 150 value 189596.048810 ## iter 160 value 189290.073377 ## iter 170 value 189164.804994 ## iter 180 value 189067.017700 ## iter 190 value 188977.611539 ## iter 200 value 188875.645604 ## iter 210 value 188838.343778 ## iter 220 value 188829.583671 ## iter 230 value 188828.429929 ## iter 240 value 188826.842527 ## iter 250 value 188825.845445 ## iter 260 value 188813.193107 ## iter 270 value 188804.354187 ## iter 280 value 188795.991184 ## iter 290 value 188785.979340 ## iter 300 value 188784.091699 ## iter 310 value 188779.709328 ## iter 320 value 188774.638386 ## final value 188768.378730 ## converged the_anim <- PlotVariantPrevalenceAnimated(newyork_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New York state by variant\", caption = \"**Source: gisaid.org and covid19nytimes**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/NY_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"December 2022\") %>% group_by(WeekYear) %>% summarise(n = sum(daily_cases)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_NY <- gisaid_NY %>% filter(MonthYearCollected > \"December 2022\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_NY) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 36 (24 variable) ## initial value 80895.217264 ## iter 10 value 55509.333467 ## iter 20 value 44058.411224 ## iter 30 value 40374.163074 ## iter 40 value 40178.920030 ## iter 50 value 40154.494550 ## iter 60 value 40153.247039 ## iter 70 value 40144.235800 ## iter 80 value 40138.867078 ## iter 90 value 40126.790788 ## final value 40126.694135 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New York state by variant\", caption = \"**Source: gisaid.org and covid19nytimes**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/NY_animated_2023.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Pune (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Pune (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"get-monthly-cases-for-pune","dir":"Articles","previous_headings":"","what":"Get monthly cases for Pune","title":"Animation of projected weekly cases - Pune (India)","text":"","code":"pune_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Pune\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(pune_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 Maharashtra Pune 1248 ## 2 May 2020 Maharashtra Pune 6671 ## 3 Jun 2020 Maharashtra Pune 14408 ## 4 Jul 2020 Maharashtra Pune 66904 ## 5 Aug 2020 Maharashtra Pune 85874 ## 6 Sep 2020 Maharashtra Pune 117959"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"plot-monthly-cases-for-pune","dir":"Articles","previous_headings":"Get monthly cases for Pune","what":"Plot monthly cases for Pune","title":"Animation of projected weekly cases - Pune (India)","text":"","code":"p1 <- BarPlot(pune_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Pune (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"get-weekly-cases-for-pune","dir":"Articles","previous_headings":"","what":"Get weekly cases for Pune","title":"Animation of projected weekly cases - Pune (India)","text":"","code":"pune_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Pune\"), rename_country_as_state = TRUE) p2 <- BarPlot(pune_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Pune (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"overall-how-much-has-pune-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Pune","what":"Overall, how much has Pune sequenced over months?","title":"Animation of projected weekly cases - Pune (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"pune_monthly_cases_tmp <- pune_monthly_cases %>% select(MonthYear, value) pune_monthly_cases_tmp$State <- \"India\" pune_monthly_cases_tmp$type <- \"Confirmed\" pune_monthly_cases_tmp <- pune_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = pune_seq_stats, confirmed_long = pune_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Pune (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Pune.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Pune (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Pune\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Pune\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 52 (36 variable) ## initial value 26365.114445 ## iter 10 value 10731.681151 ## iter 20 value 8389.572652 ## iter 30 value 6956.285036 ## iter 40 value 6724.558551 ## iter 50 value 6644.032773 ## iter 60 value 6616.894159 ## iter 70 value 6587.235569 ## iter 80 value 6577.882868 ## iter 90 value 6565.279637 ## iter 100 value 6550.615508 ## iter 110 value 6530.419414 ## iter 120 value 6467.482211 ## iter 130 value 6439.851698 ## iter 140 value 6433.203889 ## iter 150 value 6431.338248 ## iter 160 value 6431.072707 ## iter 170 value 6429.650312 ## iter 180 value 6424.966426 ## iter 190 value 6413.818624 ## iter 200 value 6406.000393 ## iter 210 value 6404.379934 ## iter 220 value 6401.117424 ## iter 220 value 6401.117420 ## final value 6401.117420 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Pune (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Pune_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Pune\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Pune\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 10212.635967 ## iter 10 value 4590.350258 ## iter 20 value 3862.561393 ## iter 30 value 3544.750729 ## iter 40 value 3498.023239 ## iter 50 value 3486.433437 ## iter 60 value 3483.069952 ## iter 70 value 3481.649036 ## iter 80 value 3479.685451 ## iter 90 value 3477.707985 ## iter 100 value 3474.316912 ## iter 110 value 3469.635470 ## iter 120 value 3467.322351 ## iter 130 value 3467.158034 ## iter 140 value 3466.778290 ## iter 150 value 3466.453209 ## iter 160 value 3466.383448 ## iter 170 value 3466.319461 ## iter 180 value 3466.184408 ## iter 190 value 3464.589688 ## iter 200 value 3464.203208 ## iter 210 value 3464.012242 ## iter 220 value 3463.948100 ## iter 230 value 3463.938896 ## iter 240 value 3463.904465 ## iter 250 value 3463.886884 ## iter 260 value 3463.879986 ## iter 270 value 3463.859002 ## iter 280 value 3463.842795 ## iter 290 value 3463.830995 ## iter 300 value 3463.563810 ## iter 310 value 3463.375418 ## iter 320 value 3463.337145 ## iter 330 value 3463.179199 ## iter 340 value 3463.123598 ## iter 350 value 3463.096437 ## iter 360 value 3463.085424 ## final value 3463.079789 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Pune (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Pune_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Pune\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Pune\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 10212.635967 ## iter 10 value 4590.350258 ## iter 20 value 3862.561393 ## iter 30 value 3544.750729 ## iter 40 value 3498.023239 ## iter 50 value 3486.433437 ## iter 60 value 3483.069952 ## iter 70 value 3481.649036 ## iter 80 value 3479.685451 ## iter 90 value 3477.707985 ## iter 100 value 3474.316912 ## iter 110 value 3469.635470 ## iter 120 value 3467.322351 ## iter 130 value 3467.158034 ## iter 140 value 3466.778290 ## iter 150 value 3466.453209 ## iter 160 value 3466.383448 ## iter 170 value 3466.319461 ## iter 180 value 3466.184408 ## iter 190 value 3464.589688 ## iter 200 value 3464.203208 ## iter 210 value 3464.012242 ## iter 220 value 3463.948100 ## iter 230 value 3463.938896 ## iter 240 value 3463.904465 ## iter 250 value 3463.886884 ## iter 260 value 3463.879986 ## iter 270 value 3463.859002 ## iter 280 value 3463.842795 ## iter 290 value 3463.830995 ## iter 300 value 3463.563810 ## iter 310 value 3463.375418 ## iter 320 value 3463.337145 ## iter 330 value 3463.179199 ## iter 340 value 3463.123598 ## iter 350 value 3463.096437 ## iter 360 value 3463.085424 ## final value 3463.079789 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Pune (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Pune_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Singapore.html","id":"get-variants-data-for-singapore","dir":"Articles","previous_headings":"","what":"Get variants data for Singapore","title":"Animation of projected weekly cases - Singapore","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_singapore <- gisaid_metadata %>% filter(Country == \"Singapore\") %>% filter(Host == \"Human\") # format metadata gisaid_singapore <- FormatGISAIDMetadata(gisaid_singapore) %>% filter(pangolin_lineage != \"Unassigned\") gisaid_singapore <- gisaid_singapore %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") %>% filter(State != \"Unknown\") vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_singapore <- gisaid_singapore %>% filter(pangolin_lineage != \"None\") %>% filter(!is.na(MonthYearCollected)) %>% filter(pangolin_lineage != \"Unassigned\") gisaid_singapore <- CollapseLineageToVOCs( variant_df = gisaid_singapore, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Singapore.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Singapore","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_singapore) state_month_counts$State <- \"Singapore\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Singapore.html","id":"get-weekly-cases-for-singapore","dir":"Articles","previous_headings":"","what":"Get weekly cases for Singapore","title":"Animation of projected weekly cases - Singapore","text":"","code":"confirmed.tmp <- COVID19::covid19(country = \"Singapore\", verbose = FALSE, level = 2) %>% select(date, administrative_area_level_2, confirmed) %>% rename(State = administrative_area_level_2) confirmed <- COVID19::covid19(country = \"Singapore\", verbose = FALSE) %>% select(date, confirmed) %>% filter(!is.na(confirmed)) confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_singapore_weekwise <- SummarizeVariantsWeekwise(gisaid_singapore)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Singapore.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Singapore","text":"Look cases October,2021 :","code":"voc_to_keep <- gisaid_singapore_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_singapore_weekwise <- gisaid_singapore_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_singapore_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 48 (33 variable) ## initial value 114315.645517 ## iter 10 value 72043.412962 ## iter 20 value 58286.580181 ## iter 30 value 42928.618218 ## iter 40 value 30702.343427 ## iter 50 value 29674.014823 ## iter 60 value 27058.699436 ## iter 70 value 26819.385494 ## iter 80 value 26623.156945 ## iter 90 value 25790.492935 ## iter 100 value 25607.767871 ## iter 110 value 25564.111015 ## iter 120 value 25520.515129 ## iter 130 value 25492.418859 ## iter 140 value 25478.042952 ## iter 150 value 25476.429625 ## iter 160 value 25474.958530 ## iter 170 value 25474.070826 ## iter 180 value 25471.671088 ## iter 190 value 25469.339900 ## iter 200 value 25466.376730 ## final value 25465.674124 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Singapore by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Singapore_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"December 2021\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_singapore_subset <- gisaid_singapore %>% filter(MonthYearCollected > \"December 2021\") gisaid_singapore_weekwise <- SummarizeVariantsWeekwise(gisaid_singapore_subset) voc_to_keep <- gisaid_singapore_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_singapore_weekwise <- gisaid_singapore_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_singapore_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 79418.462442 ## iter 10 value 46361.977991 ## iter 20 value 33769.136194 ## iter 30 value 25745.689656 ## iter 40 value 23821.442365 ## iter 50 value 23665.148645 ## iter 60 value 23613.784484 ## iter 70 value 23584.420375 ## iter 80 value 23494.936195 ## iter 90 value 23472.595033 ## iter 100 value 23462.346211 ## iter 110 value 23461.537395 ## iter 120 value 23461.499226 ## final value 23461.497355 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Singapore by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Singapore_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-SouthAfrica.html","id":"get-variants-data-for-south-africa","dir":"Articles","previous_headings":"","what":"Get variants data for South Africa","title":"Animation of projected weekly cases - South Africa","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_sa <- gisaid_metadata %>% filter(Country == \"South Africa\") %>% filter(Host == \"Human\") # format metadata gisaid_sa <- FormatGISAIDMetadata(gisaid_sa) gisaid_sa$State <- CleanSouthAfricanStates(gisaid_sa$State) gisaid_sa <- gisaid_sa %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") %>% filter(State != \"Unknown\") vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_sa <- gisaid_sa %>% filter(pangolin_lineage != \"None\") %>% filter(!is.na(MonthYearCollected)) %>% filter(pangolin_lineage != \"Unassigned\") gisaid_sa <- CollapseLineageToVOCs( variant_df = gisaid_sa, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-SouthAfrica.html","id":"get-weekly-cases-for-south-africa","dir":"Articles","previous_headings":"","what":"Get weekly cases for South Africa","title":"Animation of projected weekly cases - South Africa","text":"","code":"confirmed <- COVID19::covid19(country = \"South Africa\", verbose = FALSE) %>% select(date, confirmed) %>% filter(!is.na(confirmed)) confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_sa_weekwise <- SummarizeVariantsWeekwise(gisaid_sa)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-SouthAfrica.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - South Africa","text":"Look cases December, 2021 :","code":"voc_to_keep <- gisaid_sa_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_sa_weekwise <- gisaid_sa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_sa_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 24 (15 variable) ## initial value 97577.428935 ## iter 10 value 55154.515637 ## iter 20 value 27745.616633 ## iter 30 value 19320.442106 ## iter 40 value 19074.963353 ## iter 50 value 18037.261827 ## iter 60 value 17761.240412 ## iter 70 value 17755.556967 ## iter 80 value 17717.403434 ## iter 90 value 17618.849335 ## iter 100 value 17616.957595 ## iter 110 value 17594.139994 ## iter 120 value 17580.872937 ## iter 130 value 17578.935221 ## iter 140 value 17575.180064 ## iter 150 value 17561.415963 ## iter 160 value 17559.971068 ## iter 170 value 17559.071788 ## iter 180 value 17553.115865 ## iter 190 value 17552.670738 ## final value 17552.668116 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in South Africa by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/SA_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"December 2021\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_sa_subset <- gisaid_sa %>% filter(MonthYearCollected > \"December 2021\") gisaid_sa_weekwise <- SummarizeVariantsWeekwise(gisaid_sa_subset) voc_to_keep <- gisaid_sa_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_sa_weekwise <- gisaid_sa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) sa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_sa_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 16 (9 variable) ## initial value 28414.875520 ## iter 10 value 6243.071215 ## iter 20 value 5008.362379 ## iter 30 value 4922.237907 ## final value 4921.335322 ## converged the_anim <- PlotVariantPrevalenceAnimated(sa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in South Africa by variant\", caption = \"**Source: gisaid.org and covid19datahub.io**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/SA_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq) DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"get-monthly-cases-for-tamilnadu","dir":"Articles","previous_headings":"","what":"Get monthly cases for Tamilnadu","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"Tamilnadu_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == \"Tamil Nadu\") ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Tamilnadu_monthly_cases) ## MonthYear State value type ## 1 Mar 2020 Tamil Nadu 124 Confirmed ## 2 Apr 2020 Tamil Nadu 2199 Confirmed ## 3 May 2020 Tamil Nadu 20010 Confirmed ## 4 Jun 2020 Tamil Nadu 67834 Confirmed ## 5 Jul 2020 Tamil Nadu 155692 Confirmed ## 6 Aug 2020 Tamil Nadu 182182 Confirmed"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"plot-monthly-cases-for-tamilnadu","dir":"Articles","previous_headings":"Get monthly cases for Tamilnadu","what":"Plot monthly cases for Tamilnadu","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"p1 <- BarPlot(Tamilnadu_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Tamilnadu (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"get-weekly-cases-for-tamilnadu","dir":"Articles","previous_headings":"","what":"Get weekly cases for Tamilnadu","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"Tamilnadu_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(State == \"Tamil Nadu\"), rename_country_as_state = TRUE) p2 <- BarPlot(Tamilnadu_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Tamilnadu (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"overall-how-much-has-tamilnadu-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Tamilnadu","what":"Overall, how much has Tamilnadu sequenced over months?","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Tamilnadu_monthly_cases_tmp <- Tamilnadu_monthly_cases %>% select(MonthYear, value) Tamilnadu_monthly_cases_tmp$State <- \"India\" Tamilnadu_monthly_cases_tmp$type <- \"Confirmed\" Tamilnadu_monthly_cases_tmp <- Tamilnadu_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Tamilnadu_seq_stats, confirmed_long = Tamilnadu_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Tamilnadu (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(State == \"Tamil Nadu\")) state_month_counts$State <- \"Tamil Nadu\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Tamilnadu.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Tamil Nadu (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(State == \"Tamil Nadu\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(State %in% c(\"Tamil Nadu\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 52 (36 variable) ## initial value 48882.804855 ## iter 10 value 22261.083247 ## iter 20 value 16795.407813 ## iter 30 value 14581.674819 ## iter 40 value 13685.708514 ## iter 50 value 13450.947012 ## iter 60 value 13385.513385 ## iter 70 value 13270.613242 ## iter 80 value 13159.881372 ## iter 90 value 13086.982518 ## iter 100 value 13029.959873 ## iter 110 value 13016.284117 ## iter 120 value 13004.515557 ## iter 130 value 12983.865946 ## iter 140 value 12968.678387 ## iter 150 value 12964.228832 ## iter 160 value 12963.962687 ## iter 170 value 12960.911855 ## iter 180 value 12956.023478 ## iter 190 value 12952.260955 ## iter 200 value 12951.643359 ## iter 210 value 12947.955831 ## iter 220 value 12945.278961 ## iter 220 value 12945.278839 ## final value 12945.278839 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Tamil Nadu (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Tamilnadu_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(State %in% c(\"Tamil Nadu\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Tamil Nadu\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 21887.988050 ## iter 10 value 12913.556566 ## iter 20 value 10039.840106 ## iter 30 value 9160.350931 ## iter 40 value 9024.790026 ## iter 50 value 8994.142902 ## iter 60 value 8989.212071 ## iter 70 value 8986.497678 ## iter 80 value 8983.372214 ## iter 90 value 8977.915907 ## iter 100 value 8973.008756 ## iter 110 value 8970.750450 ## iter 120 value 8970.597054 ## final value 8970.575063 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Tamil Nadu (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Tamilnadu_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(State %in% c(\"Tamil Nadu\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Tamil Nadu\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 21887.988050 ## iter 10 value 12913.556566 ## iter 20 value 10039.840106 ## iter 30 value 9160.350931 ## iter 40 value 9024.790026 ## iter 50 value 8994.142902 ## iter 60 value 8989.212071 ## iter 70 value 8986.497678 ## iter 80 value 8983.372214 ## iter 90 value 8977.915907 ## iter 100 value 8973.008756 ## iter 110 value 8970.750450 ## iter 120 value 8970.597054 ## final value 8970.575063 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Tamil Nadu (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Tamilnadu_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1` = \"BA.1\", `BA.1.*` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.*` = \"BA.2\", `BA.3` = \"BA.3\", `BA.3.*` = \"BA.3\", `BA.4` = \"BA.4\", `BA.4.*` = \"BA.4\", `BA.5` = \"BA.5\", `BA.5.*` = \"BA.5\", `XBB` = \"XBB\", `XBB.1` = \"XBB.1+\", `XBB.1.*` = \"XBB.1+\", `XBB.1.5` = \"XBB.1.5\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"state_counts <- as.data.frame(table(gisaid_india$State)) %>% rename(State = Var1, `Total sequences` = Freq) DT::datatable(state_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"get-monthly-cases-for-telangana","dir":"Articles","previous_headings":"","what":"Get monthly cases for Telangana","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"Telangana_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong() %>% filter(State == \"Telangana\") ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(Telangana_monthly_cases) ## MonthYear State value type ## 1 Mar 2020 Telangana 97 Confirmed ## 2 Apr 2020 Telangana 941 Confirmed ## 3 May 2020 Telangana 1660 Confirmed ## 4 Jun 2020 Telangana 13641 Confirmed ## 5 Jul 2020 Telangana 46364 Confirmed ## 6 Aug 2020 Telangana 61750 Confirmed"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"plot-monthly-cases-for-telangana","dir":"Articles","previous_headings":"Get monthly cases for Telangana","what":"Plot monthly cases for Telangana","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"p1 <- BarPlot(Telangana_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Telangana (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"get-weekly-cases-for-telangana","dir":"Articles","previous_headings":"","what":"Get weekly cases for Telangana","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"Telangana_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(State == \"Telangana\"), rename_country_as_state = TRUE) p2 <- BarPlot(Telangana_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Telangana (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"overall-how-much-has-telangana-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Telangana","what":"Overall, how much has Telangana sequenced over months?","title":"Animation of projected weekly cases - Telangana (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"Telangana_monthly_cases_tmp <- Telangana_monthly_cases %>% select(MonthYear, value) Telangana_monthly_cases_tmp$State <- \"India\" Telangana_monthly_cases_tmp$type <- \"Confirmed\" Telangana_monthly_cases_tmp <- Telangana_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = Telangana_seq_stats, confirmed_long = Telangana_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Telangana (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - Telangana (India)","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_india %>% filter(State == \"Telangana\")) state_month_counts$State <- \"Telangana\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-Telangana.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Telangana (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(State == \"Telangana\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(State %in% c(\"Telangana\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 60 (42 variable) ## initial value 53706.051588 ## iter 10 value 19089.948274 ## iter 20 value 15271.923578 ## iter 30 value 12165.385199 ## iter 40 value 11696.811843 ## iter 50 value 11531.488444 ## iter 60 value 11407.396612 ## iter 70 value 11390.805643 ## iter 80 value 11378.215547 ## iter 90 value 11372.121578 ## iter 100 value 11368.524855 ## iter 110 value 11347.166496 ## iter 120 value 11338.343161 ## iter 130 value 11319.031443 ## iter 140 value 11304.937484 ## iter 150 value 11290.069718 ## iter 160 value 11284.086458 ## iter 170 value 11282.193713 ## iter 180 value 11281.614269 ## iter 190 value 11281.398993 ## iter 200 value 11277.649494 ## iter 210 value 11274.836315 ## iter 220 value 11274.261561 ## iter 230 value 11272.803028 ## iter 240 value 11269.009386 ## iter 250 value 11267.733930 ## iter 260 value 11266.798701 ## iter 270 value 11266.473193 ## iter 280 value 11266.188635 ## iter 290 value 11265.585484 ## iter 300 value 11264.690201 ## iter 310 value 11263.097225 ## iter 320 value 11262.670208 ## iter 330 value 11262.365255 ## iter 340 value 11261.702540 ## final value 11261.523708 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Telangana (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Telangana_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(State %in% c(\"Telangana\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Telangana\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 20362.926657 ## iter 10 value 8450.907437 ## iter 20 value 6005.436485 ## iter 30 value 5648.379329 ## iter 40 value 5595.073447 ## iter 50 value 5569.751321 ## iter 60 value 5563.255333 ## iter 70 value 5561.890705 ## iter 80 value 5559.413501 ## iter 90 value 5557.122944 ## iter 100 value 5556.345239 ## iter 110 value 5555.493314 ## iter 120 value 5555.244005 ## final value 5555.165026 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Telangana (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Telangana_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong() ## Rows: 3183 Columns: 42 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): Date, Status ## dbl (39): TT, AN, AP, AR, AS, BR, CH, CT, DN, DD, DL, GA, GJ, HR, HP, JK, J... ## date (1): Date_YMD ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(State %in% c(\"Telangana\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(State == \"Telangana\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 44 (30 variable) ## initial value 20362.926657 ## iter 10 value 8450.907437 ## iter 20 value 6005.436485 ## iter 30 value 5648.379329 ## iter 40 value 5595.073447 ## iter 50 value 5569.751321 ## iter 60 value 5563.255333 ## iter 70 value 5561.890705 ## iter 80 value 5559.413501 ## iter 90 value 5557.122944 ## iter 100 value 5556.345239 ## iter 110 value 5555.493314 ## iter 120 value 5555.244005 ## final value 5555.165026 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Telangana (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Telangana_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-UK.html","id":"get-variants-data-for-uk","dir":"Articles","previous_headings":"","what":"Get variants data for UK","title":"Animation of projected weekly cases - United Kingdom","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_uk <- gisaid_metadata %>% filter(Country == \"United Kingdom\") %>% filter(Host == \"Human\") # format metadata gisaid_uk <- FormatGISAIDMetadata(gisaid_uk) gisaid_uk <- gisaid_uk %>% filter(State != \"\") gisaid_uk <- gisaid_uk %>% filter(pangolin_lineage != \"Unknown\") %>% arrange(State, MonthYearCollected) %>% filter(!is.na(MonthYearCollected)) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_uk <- CollapseLineageToVOCs( variant_df = gisaid_uk, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-UK.html","id":"get-daily-case-data","dir":"Articles","previous_headings":"","what":"Get daily case data","title":"Animation of projected weekly cases - United Kingdom","text":"","code":"if (FALSE) { cases.struct <- list( date = \"date\", areaName = \"areaName\", newCasesByPublishDate = \"newCasesByPublishDate\" ) all_nations <- c( \"areaType=nation\" ) cases_data <- get_data( filters = all_nations, structure = cases.struct ) %>% rename(new_cases = newCasesByPublishDate) confirmed <- cases_data %>% arrange(date) %>% group_by(date) %>% summarise(daily_cases = sum(new_cases)) } confirmed <- covid19(country = \"United Kingdom\", level = 1) %>% select(date, confirmed) %>% filter(!is.na(confirmed)) ## We have invested a lot of time and effort in creating COVID-19 Data ## Hub, please cite the following when using it: ## ## Guidotti, E., Ardia, D., (2020), \"COVID-19 Data Hub\", Journal of Open ## Source Software 5(51):2376, doi: 10.21105/joss.02376 ## ## The implementation details and the latest version of the data are ## described in: ## ## Guidotti, E., (2022), \"A worldwide epidemiological database for ## COVID-19 at fine-grained spatial resolution\", Sci Data 9(1):112, doi: ## 10.1038/s41597-022-01245-1 ## To print citations in BibTeX format use: ## > print(citation('COVID19'), bibtex=TRUE) ## ## To hide this message use 'verbose = FALSE'. confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_uk_weekwise <- SummarizeVariantsWeekwise(gisaid_uk)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-UK.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - United Kingdom","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_uk) state_month_counts$State <- \"UK\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-UK.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - United Kingdom","text":"Look cases October,2021 :","code":"voc_to_keep <- gisaid_uk_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_uk_weekwise <- gisaid_uk_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) uk_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_uk_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 60 (42 variable) ## initial value 8172310.568083 ## iter 10 value 2743547.517967 ## iter 20 value 2525641.121346 ## iter 30 value 2126579.834310 ## iter 40 value 1808320.047747 ## iter 50 value 775094.780290 ## iter 60 value 549759.006540 ## iter 70 value 529243.266982 ## iter 80 value 512394.130990 ## iter 90 value 505138.376920 ## iter 100 value 501555.323403 ## iter 110 value 490053.228890 ## iter 120 value 473036.808321 ## iter 130 value 464964.358075 ## iter 140 value 461848.637738 ## iter 150 value 461486.546237 ## iter 160 value 461065.667929 ## iter 170 value 460962.802384 ## iter 180 value 460957.301405 ## iter 190 value 460954.413661 ## iter 200 value 460927.273149 ## iter 210 value 460849.000014 ## iter 220 value 460799.238251 ## iter 230 value 460785.317886 ## iter 240 value 460629.081216 ## iter 250 value 460610.294257 ## final value 460602.974708 ## converged the_anim <- PlotVariantPrevalenceAnimated(uk_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in New York state by variant\", caption = \"**Source: gisaid.org and gov.uk**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/UK_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"December 2022\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_uk <- gisaid_uk %>% filter(MonthYearCollected > \"December 2022\") gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_uk) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 36 (24 variable) ## initial value 216061.881588 ## iter 10 value 122081.232449 ## iter 20 value 114882.771885 ## iter 30 value 105583.612784 ## iter 40 value 104884.729251 ## iter 50 value 104872.199675 ## iter 60 value 104869.111877 ## iter 70 value 104847.009961 ## iter 80 value 104815.837220 ## iter 90 value 104790.302860 ## final value 104790.293137 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in the UK by variant\", caption = \"**Source: gisaid.org and gov.uk**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/UK_animated_2023.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-USA.html","id":"get-variants-data-for-usa","dir":"Articles","previous_headings":"","what":"Get variants data for USA","title":"Animation of projected weekly cases - USA","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_usa <- gisaid_metadata %>% filter(Country == \"USA\") %>% filter(Host == \"Human\") # format metadata gisaid_usa <- FormatGISAIDMetadata(gisaid_usa) gisaid_usa <- gisaid_usa %>% arrange(State, MonthYearCollected) %>% filter(pangolin_lineage != \"Unknown\") vocs <- GetVOCs() custom_voc_mapping <- list( `XBB` = \"XBB\", `XBB.1.5` = \"XBB\", `XBB.1` = \"XBB\", `XBB.1.*` = \"XBB\", `XBB.*` = \"XBB\", `XBB.*.*` = \"XBB\", `XBB.*.*.*` = \"XBB\", `BQ.1` = \"BQ.1\", `BQ.1.*` = \"BQ.1\", `EG.5` = \"EG.5\", `EG.5.1` = \"EG.5\", `EG.5.1.1` = \"EG.5\", `EG.5.*` = \"EG.5\", `EG.5.1` = \"EG.5\", # `EG.6.*` = \"EG.6\", # `EG.6.1` = \"EG.6\", `FL.1.*` = \"FL.1\", `FU.1` = \"FU.1\", `FU.1.*` = \"FU.1\", `GJ.1.2` = \"GJ.1\", `GJ.1.*` = \"GJ.1\", `JN.1` = \"JN.1\", `JN.1.*` = \"JN.1\", `HV.1` = \"HV.1\", `HV.1.*` = \"HV.1\" ) gisaid_usa <- gisaid_usa %>% filter(pangolin_lineage != \"None\") gisaid_usa <- CollapseLineageToVOCs( variant_df = gisaid_usa, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-USA.html","id":"get-weekly-cases-for-usa","dir":"Articles","previous_headings":"","what":"Get weekly cases for USA","title":"Animation of projected weekly cases - USA","text":"","code":"confirmed <- covid19(country = \"USA\", level = 1) %>% select(date, confirmed) %>% filter(!is.na(confirmed)) #> We have invested a lot of time and effort in creating COVID-19 Data #> Hub, please cite the following when using it: #> #> Guidotti, E., Ardia, D., (2020), \"COVID-19 Data Hub\", Journal of Open #> Source Software 5(51):2376, doi: 10.21105/joss.02376 #> #> The implementation details and the latest version of the data are #> described in: #> #> Guidotti, E., (2022), \"A worldwide epidemiological database for #> COVID-19 at fine-grained spatial resolution\", Sci Data 9(1):112, doi: #> 10.1038/s41597-022-01245-1 #> To print citations in BibTeX format use: #> > print(citation('COVID19'), bibtex=TRUE) #> #> To hide this message use 'verbose = FALSE'. confirmed$daily_cases <- c(confirmed$confirmed[1], diff(confirmed$confirmed)) confirmed$WeekYear <- tsibble::yearweek(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_usa_weekwise <- SummarizeVariantsWeekwise(gisaid_usa)"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-USA.html","id":"distribution-of-variants","dir":"Articles","previous_headings":"","what":"Distribution of variants","title":"Animation of projected weekly cases - USA","text":"","code":"state_month_counts <- SummarizeVariantsMonthwise(gisaid_usa) state_month_counts$State <- \"USA\" state_month_prevalence <- CountsToPrevalence(state_month_counts) vocs <- GetVOCs() state_month_prevalence <- CollapseLineageToVOCs( variant_df = state_month_prevalence, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE ) p5 <- StackedBarPlotPrevalence(state_month_prevalence) p5"},{"path":"http://saket-choudhary.me/covmuller/articles/VariantAnimation-USA.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - USA","text":"Look cases October,2021 : Look cases past weeks","code":"voc_to_keep <- gisaid_usa_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_usa_weekwise <- gisaid_usa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) usa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_usa_weekwise, confirmed_subset_dateweekwise_long) #> # weights: 76 (54 variable) #> initial value 14592521.803190 #> iter 10 value 6447202.811578 #> iter 20 value 5861595.477527 #> iter 30 value 5790343.712768 #> iter 40 value 5528120.829208 #> iter 50 value 4538098.523281 #> iter 60 value 3575149.786314 #> iter 70 value 2914099.568952 #> iter 80 value 2681111.703923 #> iter 90 value 2630567.428596 #> iter 100 value 2588910.853970 #> iter 110 value 2531367.915991 #> iter 120 value 2522506.115284 #> iter 130 value 2517585.077550 #> iter 140 value 2484306.308171 #> iter 150 value 2435522.265143 #> iter 160 value 2426914.029037 #> iter 170 value 2423789.545923 #> iter 180 value 2423126.243360 #> iter 190 value 2422886.593126 #> iter 200 value 2422636.701006 #> iter 210 value 2422381.267756 #> final value 2422316.502467 #> converged the_anim <- PlotVariantPrevalenceAnimated(usa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in the USA by variant\", caption = \"**Source: gisaid.org and covid19nytimes**
\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/USA_animated.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"Dec 2021\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_usa_subset <- gisaid_usa %>% filter(MonthYearCollected > \"Dec 2021\") gisaid_usa_weekwise <- SummarizeVariantsWeekwise(gisaid_usa_subset) voc_to_keep <- gisaid_usa_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_usa_weekwise <- gisaid_usa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) usa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_usa_weekwise, confirmed_subset_dateweekwise_long) #> # weights: 44 (30 variable) #> initial value 5764163.766249 #> iter 10 value 2095331.650844 #> iter 20 value 1926857.507355 #> iter 30 value 1789325.670173 #> iter 40 value 1371096.520916 #> iter 50 value 1337091.106548 #> iter 60 value 1326424.819570 #> iter 70 value 1325428.520676 #> iter 80 value 1321869.796057 #> iter 90 value 1315817.961808 #> iter 100 value 1315538.885484 #> iter 110 value 1315423.773849 #> final value 1315423.389378 #> converged the_anim <- PlotVariantPrevalenceAnimated(usa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in the USA by variant\", caption = \"**Source: gisaid.org and covid19nytimes**
\") #> `geom_line()`: Each group consists of only one observation. #> ℹ Do you need to adjust the group aesthetic? #> `geom_line()`: Each group consists of only one observation. #> ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/USA_animated_2021.gif\"), animation = the_anim) confirmed$MonthYear <- GetMonthYear(confirmed$date) confirmed_subset_dateweekwise_long <- confirmed %>% filter(MonthYear > \"December 2022\") %>% group_by(WeekYear) %>% summarise(n = ceiling(mean(daily_cases, na.rm = T))) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_usa_subset <- gisaid_usa %>% filter(MonthYearCollected > \"December 2022\") gisaid_usa_weekwise <- SummarizeVariantsWeekwise(gisaid_usa_subset) voc_to_keep <- gisaid_usa_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 50) %>% pull(lineage_collapsed) %>% unique() gisaid_usa_weekwise <- gisaid_usa_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) usa_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_usa_weekwise, confirmed_subset_dateweekwise_long) #> # weights: 40 (27 variable) #> initial value 878618.117200 #> iter 10 value 499499.693774 #> iter 20 value 478934.552235 #> iter 30 value 431906.634968 #> iter 40 value 417940.677649 #> iter 50 value 417577.713621 #> iter 60 value 417469.746811 #> iter 70 value 417419.381273 #> iter 80 value 417185.921416 #> iter 90 value 417164.110491 #> final value 417162.797666 #> converged the_anim <- PlotVariantPrevalenceAnimated(usa_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in the USA by variant\", caption = \"**Source: gisaid.org and covid19nytimes**
\") #> `geom_line()`: Each group consists of only one observation. #> ℹ Do you need to adjust the group aesthetic? #> `geom_line()`: Each group consists of only one observation. #> ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/USA_animated_2023.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"get-variants-data-for-india","dir":"Articles","previous_headings":"","what":"Get variants data for India","title":"Animation of projected weekly cases - Kolkata (India)","text":"","code":"gisaid_metadata <- qs::qread(\"~/data/epicov/metadata_tsv_2024_01_11.qs\") gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata) vocs <- GetVOCs() omicron <- vocs[[\"omicron\"]] vocs[[\"omicron\"]] <- NULL custom_voc_mapping <- list( `BA.1.1` = \"BA.1\", `BA.1` = \"BA.1\", `BA.2` = \"BA.2\", `BA.2.10` = \"BA.2.X\", `BA.2.10.1` = \"BA.2.X\", `BA.2.12` = \"BA.2.X\", `BA.2.12.1` = \"BA.2.X\", `BA.3` = \"BA.3\", `BA.4` = \"BA.4\", `BA.5` = \"BA.5\", `BA.2.74` = \"BA.2.X\", `BA.2.75` = \"BA.2.75\", `BA.2.76` = \"BA.2.X\", `XBB.*` = \"XBB\", `BQ.1` = \"BQ.1+\", `BQ.1.*` = \"BQ.1+\" ) gisaid_india <- gisaid_india %>% filter(pangolin_lineage != \"None\") %>% filter(pangolin_lineage != \"Unassigned\") gisaid_india$District <- stringr::str_to_title(gisaid_india$District) gisaid_india$City <- stringr::str_to_title(gisaid_india$City) gisaid_india$custom_city <- gisaid_india$City gisaid_india$custom_city[gisaid_india$custom_city == \"\"] <- gisaid_india$District[gisaid_india$custom_city == \"\"] gisaid_india$custom_city <- stringr::str_to_title(gisaid_india$custom_city) gisaid_india <- CollapseLineageToVOCs( variant_df = gisaid_india, vocs = vocs, custom_voc_mapping = custom_voc_mapping, summarize = FALSE )"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"top-10-cities-with-most-number-of-sequenced-samples","dir":"Articles","previous_headings":"","what":"Top 10 cities with most number of sequenced samples","title":"Animation of projected weekly cases - Kolkata (India)","text":"","code":"city_counts <- as.data.frame(table(gisaid_india$custom_city)) %>% rename(City = Var1, `Total sequences` = Freq) DT::datatable(city_counts %>% arrange(desc(`Total sequences`)))"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"get-monthly-cases-for-kolkata","dir":"Articles","previous_headings":"","what":"Get monthly cases for Kolkata","title":"Animation of projected weekly cases - Kolkata (India)","text":"","code":"chennai_monthly_cases <- GetIndiaConfirmedCasesMonthlyLong(level = \"district\") %>% filter(District == \"Kolkata\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. head(chennai_monthly_cases) ## # A tibble: 6 × 4 ## # Groups: MonthYear, State [6] ## MonthYear State District value ## ## 1 Apr 2020 West Bengal Kolkata 184 ## 2 May 2020 West Bengal Kolkata 1941 ## 3 Jun 2020 West Bengal Kolkata 3859 ## 4 Jul 2020 West Bengal Kolkata 15655 ## 5 Aug 2020 West Bengal Kolkata 18518 ## 6 Sep 2020 West Bengal Kolkata 16255"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"plot-monthly-cases-for-kolkata","dir":"Articles","previous_headings":"Get monthly cases for Kolkata","what":"Plot monthly cases for Kolkata","title":"Animation of projected weekly cases - Kolkata (India)","text":"","code":"p1 <- BarPlot(chennai_monthly_cases, ylabel = \"Cases per month\", label_si = TRUE, title = \"Total cases per month - Kolkata (India)\", caption = \"**Source: covid19bharat.org**
\") p1"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"get-weekly-cases-for-kolkata","dir":"Articles","previous_headings":"","what":"Get weekly cases for Kolkata","title":"Animation of projected weekly cases - Kolkata (India)","text":"","code":"chennai_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india %>% filter(custom_city == \"Kolkata\"), rename_country_as_state = TRUE) p2 <- BarPlot(chennai_seq_stats, ylabel = \"Sequenced per month\", color = \"slateblue1\", label_si = TRUE, title = \"Total sequences deposited to GISAID from Kolkata (India)\", caption = \"**Source: gisaid.org **
\") p2"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"overall-how-much-has-kolkata-sequenced-over-months","dir":"Articles","previous_headings":"Get weekly cases for Kolkata","what":"Overall, how much has Kolkata sequenced over months?","title":"Animation of projected weekly cases - Kolkata (India)","text":"absolute numbers informative, useful metric proportion cases (cases sequenced total cases) getting sequenced. look proportion cases sequenced India course pandemic:","code":"chennai_monthly_cases_tmp <- chennai_monthly_cases %>% select(MonthYear, value) chennai_monthly_cases_tmp$State <- \"India\" chennai_monthly_cases_tmp$type <- \"Confirmed\" chennai_monthly_cases_tmp <- chennai_monthly_cases_tmp %>% select(MonthYear, State, value, type) sequencing_proportion <- CombineSequencedCases( cases_sequenced = chennai_seq_stats, confirmed_long = chennai_monthly_cases_tmp ) p3 <- BarPlot(sequencing_proportion, yaxis = \"percent_sequenced_collected\", ylabel = \"% deposited to GISAID\", color = \"yellowgreen\", title = \"Proportion of cases deposited to GISAID from Kolkata (India)\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") p3 p1 / p2 / p3"},{"path":"http://saket-choudhary.me/covmuller/articles/VarinatAnimation-Kolkata.html","id":"project-weekly-cases-to-variant-prevalence-data-from-gisaid","dir":"Articles","previous_headings":"","what":"Project weekly cases to variant prevalence data from GISAID","title":"Animation of projected weekly cases - Kolkata (India)","text":"Look cases January, 2022 : Look cases last weeks:","code":"confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") gisaid_dist_weekwise <- SummarizeVariantsWeekwise(gisaid_india %>% filter(custom_city == \"Kolkata\") %>% arrange(WeekYearCollected)) confirmed_subset_dateweekwise_long_dist <- confirmed_subset_dateweekwise_long %>% filter(District %in% c(\"Kolkata\")) %>% rename(n = value) %>% rename(WeekYearCollected = WeekYear) %>% dplyr::select(-contains(\"type\")) %>% filter(WeekYearCollected >= min(gisaid_dist_weekwise$WeekYearCollected)) confirmed_subset_dateweekwise_long_dist$State <- NULL voc_to_keep <- gisaid_dist_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_dist_weekwise <- gisaid_dist_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) india_cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_dist_weekwise, confirmed_subset_dateweekwise_long_dist) ## # weights: 52 (36 variable) ## initial value 19798.844090 ## iter 10 value 11435.635166 ## iter 20 value 9057.108989 ## iter 30 value 8157.246773 ## iter 40 value 7975.159693 ## iter 50 value 7858.708901 ## iter 60 value 7668.444190 ## iter 70 value 7580.672625 ## iter 80 value 7528.451751 ## iter 90 value 7513.272444 ## iter 100 value 7474.103534 ## iter 110 value 7445.218172 ## iter 120 value 7436.097829 ## iter 130 value 7434.641300 ## iter 140 value 7427.176775 ## iter 150 value 7420.804551 ## iter 160 value 7420.661086 ## iter 170 value 7416.507209 ## iter 180 value 7414.348054 ## iter 190 value 7411.764260 ## iter 200 value 7407.259358 ## iter 210 value 7399.943830 ## iter 220 value 7385.067901 ## iter 230 value 7384.795201 ## iter 240 value 7383.401682 ## iter 250 value 7382.550291 ## iter 260 value 7382.092938 ## iter 270 value 7381.786055 ## iter 280 value 7381.431294 ## iter 290 value 7381.101862 ## final value 7380.868859 ## converged the_anim <- PlotVariantPrevalenceAnimated(india_cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Kolkata (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**\", date_breaks = \"28 days\") gganimate::anim_save(filename = here::here(\"docs/articles/Kolkata_animated.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2021 W35\")) %>% filter(District %in% c(\"Kolkata\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Kolkata\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 9583.359157 ## iter 10 value 5728.384893 ## iter 20 value 4972.850542 ## iter 30 value 4897.274384 ## iter 40 value 4863.449275 ## iter 50 value 4846.053188 ## iter 60 value 4843.406679 ## iter 70 value 4842.740416 ## iter 80 value 4834.636500 ## iter 90 value 4833.226017 ## iter 100 value 4832.262214 ## iter 110 value 4831.508361 ## iter 120 value 4831.250002 ## iter 130 value 4831.025131 ## iter 140 value 4830.942138 ## iter 150 value 4830.802627 ## iter 160 value 4830.678303 ## iter 170 value 4830.004841 ## iter 180 value 4829.978702 ## iter 190 value 4829.841942 ## iter 200 value 4829.711621 ## iter 210 value 4829.608746 ## iter 220 value 4829.532697 ## final value 4829.520347 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Kolkata (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Kolkata_animated_2021.gif\"), animation = the_anim) confirmed_subset_dateweekwise_long <- GetIndiaConfirmedCasesWeeklyLong(level = \"district\") ## Rows: 661869 Columns: 8 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: \",\" ## chr (2): State, District ## dbl (5): Confirmed, Recovered, Deceased, Other, Tested ## date (1): Date ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. confirmed_subset_dateweekwise_long <- confirmed_subset_dateweekwise_long %>% filter(WeekYear >= tsibble::yearweek(\"2022 W12\")) %>% filter(District %in% c(\"Kolkata\")) %>% group_by(WeekYear) %>% summarise(n = sum(value)) %>% arrange(WeekYear) %>% rename(WeekYearCollected = WeekYear) gisaid_dist <- gisaid_india %>% filter(MonthYearCollected > \"Dec 2021\") %>% filter(custom_city == \"Kolkata\") %>% arrange(WeekYearCollected) gisaid_weekwise <- SummarizeVariantsWeekwise(gisaid_dist) voc_to_keep <- gisaid_weekwise %>% group_by(lineage_collapsed) %>% summarise(n_sum = sum(n)) %>% filter(n_sum > 1) %>% pull(lineage_collapsed) %>% unique() gisaid_weekwise <- gisaid_weekwise %>% filter(lineage_collapsed %in% voc_to_keep) cases_pred_prob_sel_long <- FitMultinomWeekly(gisaid_weekwise, confirmed_subset_dateweekwise_long) ## # weights: 40 (27 variable) ## initial value 9583.359157 ## iter 10 value 5728.384893 ## iter 20 value 4972.850542 ## iter 30 value 4897.274384 ## iter 40 value 4863.449275 ## iter 50 value 4846.053188 ## iter 60 value 4843.406679 ## iter 70 value 4842.740416 ## iter 80 value 4834.636500 ## iter 90 value 4833.226017 ## iter 100 value 4832.262214 ## iter 110 value 4831.508361 ## iter 120 value 4831.250002 ## iter 130 value 4831.025131 ## iter 140 value 4830.942138 ## iter 150 value 4830.802627 ## iter 160 value 4830.678303 ## iter 170 value 4830.004841 ## iter 180 value 4829.978702 ## iter 190 value 4829.841942 ## iter 200 value 4829.711621 ## iter 210 value 4829.608746 ## iter 220 value 4829.532697 ## final value 4829.520347 ## converged the_anim <- PlotVariantPrevalenceAnimated(cases_pred_prob_sel_long, title = \"Estimated cases (weekly average) in Kolkata (India) by variant\", caption = \"**Source: gisaid.org and covid19bharat.org**
\") ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? ## `geom_line()`: Each group consists of only one observation. ## ℹ Do you need to adjust the group aesthetic? gganimate::anim_save(filename = here::here(\"docs/articles/Kolkata_animated_2022.gif\"), animation = the_anim)"},{"path":"http://saket-choudhary.me/covmuller/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Saket Choudhary. Maintainer.","code":""},{"path":"http://saket-choudhary.me/covmuller/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Choudhary S (2024). covmuller: tool model COVID19 variant prevalence using data GISAID. R package version 0.1.2.0001, https://saketkc.github.io/covmuller.","code":"@Manual{, title = {covmuller: A tool to model COVID19 variant prevalence using data from GISAID}, author = {Saket Choudhary}, year = {2024}, note = {R package version 0.1.2.0001}, url = {https://saketkc.github.io/covmuller}, }"},{"path":"http://saket-choudhary.me/covmuller/index.html","id":"covmuller","dir":"","previous_headings":"","what":"A tool to model COVID19 variant prevalence using data from GISAID","title":"A tool to model COVID19 variant prevalence using data from GISAID","text":"Covmuller R-package designed analysis sequencing metadata deposited GISAID.","code":""},{"path":"http://saket-choudhary.me/covmuller/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"A tool to model COVID19 variant prevalence using data from GISAID","text":"Covmuller currently supports following features: Read preprocess metadata file downloaded GISAID: Vignette Plot variant prevalence: Vignette India USA Canada UK Australia SouthAfrica India New York state South Africa United Kingdom USA New York City (USA) Delhi (India) Mumbai (India) Maharashtra (India) Pune (India)","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanAmericanStates.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean states from the USA — CleanAmericanStates","title":"Clean states from the USA — CleanAmericanStates","text":"Clean states USA","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanAmericanStates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean states from the USA — CleanAmericanStates","text":"","code":"CleanAmericanStates(states)"},{"path":"http://saket-choudhary.me/covmuller/reference/CleanAmericanStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean states from the USA — CleanAmericanStates","text":"state vector state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanAmericanStates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean states from the USA — CleanAmericanStates","text":"vector cleaned state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanCanadaStates.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean states from Canada — CleanCanadaStates","title":"Clean states from Canada — CleanCanadaStates","text":"Clean states Canada","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanCanadaStates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean states from Canada — CleanCanadaStates","text":"","code":"CleanCanadaStates(states)"},{"path":"http://saket-choudhary.me/covmuller/reference/CleanCanadaStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean states from Canada — CleanCanadaStates","text":"state vector state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanCanadaStates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean states from Canada — CleanCanadaStates","text":"vector cleaned state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanIndianStates.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean Indian States — CleanIndianStates","title":"Clean Indian States — CleanIndianStates","text":"Clean Indian States","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanIndianStates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean Indian States — CleanIndianStates","text":"","code":"CleanIndianStates(states)"},{"path":"http://saket-choudhary.me/covmuller/reference/CleanIndianStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean Indian States — CleanIndianStates","text":"state vector state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanIndianStates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean Indian States — CleanIndianStates","text":"vector cleaned state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanSouthAfricanStates.html","id":null,"dir":"Reference","previous_headings":"","what":"Clean states from South Africa — CleanSouthAfricanStates","title":"Clean states from South Africa — CleanSouthAfricanStates","text":"Clean states South Africa","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanSouthAfricanStates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clean states from South Africa — CleanSouthAfricanStates","text":"","code":"CleanSouthAfricanStates(states)"},{"path":"http://saket-choudhary.me/covmuller/reference/CleanSouthAfricanStates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clean states from South Africa — CleanSouthAfricanStates","text":"state vector state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CleanSouthAfricanStates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clean states from South Africa — CleanSouthAfricanStates","text":"vector cleaned state names","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CollapseLineageToVOCs.html","id":null,"dir":"Reference","previous_headings":"","what":"Collpase pangolin lineage a list of VOCs — CollapseLineageToVOCs","title":"Collpase pangolin lineage a list of VOCs — CollapseLineageToVOCs","text":"Collpase pangolin lineage list VOCs","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CollapseLineageToVOCs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Collpase pangolin lineage a list of VOCs — CollapseLineageToVOCs","text":"","code":"CollapseLineageToVOCs( variant_df, vocs = GetVOCs(), custom_voc_mapping = NULL, summarize = TRUE )"},{"path":"http://saket-choudhary.me/covmuller/reference/CollapseLineageToVOCs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Collpase pangolin lineage a list of VOCs — CollapseLineageToVOCs","text":"variant_df dataframe \"pangolin_lineage\" column vocs named list VOC (variant concernt) name key list lineages VOC. method replace lineages VOC name. custom_voc_mapping named vector custom mapping naming lineages. See example.","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CollapseLineageToVOCs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Collpase pangolin lineage a list of VOCs — CollapseLineageToVOCs","text":"dataframe new column \"lineage_collpased\".","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CombineSequencedCases.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a combined dataframe of sequenced cases and confirmed cases — CombineSequencedCases","title":"Create a combined dataframe of sequenced cases and confirmed cases — CombineSequencedCases","text":"Create combined dataframe sequenced cases confirmed cases","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CombineSequencedCases.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a combined dataframe of sequenced cases and confirmed cases — CombineSequencedCases","text":"","code":"CombineSequencedCases( cases_sequenced, confirmed_long, prune_oversequenced = TRUE, month.min = NULL, month.max = NULL, max.percent = 100 )"},{"path":"http://saket-choudhary.me/covmuller/reference/CombineSequencedCases.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a combined dataframe of sequenced cases and confirmed cases — CombineSequencedCases","text":"cases_sequenced long dataframe per state sequenced cases prune_oversequenced Whether round percentages 100 100. Default TRUE cases_total long dataframe total monthly cases","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CombineSequencedCases.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a combined dataframe of sequenced cases and confirmed cases — CombineSequencedCases","text":"combined dataframe case load sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CountsToPrevalence.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert monthwise counts to prevalence — CountsToPrevalence","title":"Convert monthwise counts to prevalence — CountsToPrevalence","text":"Convert monthwise counts prevalence","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CountsToPrevalence.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert monthwise counts to prevalence — CountsToPrevalence","text":"","code":"CountsToPrevalence(variant_df)"},{"path":"http://saket-choudhary.me/covmuller/reference/CountsToPrevalence.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert monthwise counts to prevalence — CountsToPrevalence","text":"variant_df dataframe","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CountsToPrevalence.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert monthwise counts to prevalence — CountsToPrevalence","text":"dataframe monthwise prevalence variants","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CovmullerTheme.html","id":null,"dir":"Reference","previous_headings":"","what":"Set them — CovmullerTheme","title":"Set them — CovmullerTheme","text":"Set ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/CovmullerTheme.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set them — CovmullerTheme","text":"","code":"CovmullerTheme()"},{"path":"http://saket-choudhary.me/covmuller/reference/FilterGISAIDIndia.html","id":null,"dir":"Reference","previous_headings":"","what":"Filter GISAID India Metadata for India — FilterGISAIDIndia","title":"Filter GISAID India Metadata for India — FilterGISAIDIndia","text":"Filter GISAID India Metadata India","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/FilterGISAIDIndia.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Filter GISAID India Metadata for India — FilterGISAIDIndia","text":"","code":"FilterGISAIDIndia(gisaid_metadata_all)"},{"path":"http://saket-choudhary.me/covmuller/reference/FilterGISAIDIndia.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Filter GISAID India Metadata for India — FilterGISAIDIndia","text":"gisaid_metadata_all dataframe GISAID metadata","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/FilterGISAIDIndia.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Filter GISAID India Metadata for India — FilterGISAIDIndia","text":"dataframe Indian entries Human date known","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/FormatGISAIDMetadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Format metadata.tar.x file downloaded from GISAID with some missing columns — FormatGISAIDMetadata","title":"Format metadata.tar.x file downloaded from GISAID with some missing columns — FormatGISAIDMetadata","text":"Format metadata.tar.x file downloaded GISAID missing columns","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/FormatGISAIDMetadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Format metadata.tar.x file downloaded from GISAID with some missing columns — FormatGISAIDMetadata","text":"","code":"FormatGISAIDMetadata( df, collection_col = \"Collection date\", submission_col = \"Submission date\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/FormatGISAIDMetadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Format metadata.tar.x file downloaded from GISAID with some missing columns — FormatGISAIDMetadata","text":"df GISAID metadata dataframe collection_col Name column representing date collection (Collection date) submission_col Name column representing date submission (Submission date)","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/FormatGISAIDMetadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Format metadata.tar.x file downloaded from GISAID with some missing columns — FormatGISAIDMetadata","text":"data frame following extra columns: DateCollected, MonthYearCollected, YearCollected, MonthCollected, WeekCollected DateCollectedNumeric, MonthYearCollectedNumeric DateSubmitted, MonthYearSubmitted, YearSubmitted, MonthSubmitted, WeekSubmitted DateSubmittedNumeric, MonthYearSubmittedNumeric","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GeocodeAddress.html","id":null,"dir":"Reference","previous_headings":"","what":"Geocode a given address to get its latitude, longitude from Gooogle — GeocodeAddress","title":"Geocode a given address to get its latitude, longitude from Gooogle — GeocodeAddress","text":"Geocode given address get latitude, longitude Gooogle","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GeocodeAddress.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Geocode a given address to get its latitude, longitude from Gooogle — GeocodeAddress","text":"","code":"GeocodeAddress(address, api.key = NULL, restrict.to = NULL)"},{"path":"http://saket-choudhary.me/covmuller/reference/GeocodeAddress.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Geocode a given address to get its latitude, longitude from Gooogle — GeocodeAddress","text":"address String address geocode api.key API key Google Maps restrict.Country name search restricted , Currently supports 'India'","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GeocodeAddress.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Geocode a given address to get its latitude, longitude from Gooogle — GeocodeAddress","text":"dataframe geocoded address","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetFiletype.html","id":null,"dir":"Reference","previous_headings":"","what":"Determine filetype — GetFiletype","title":"Determine filetype — GetFiletype","text":"Determine filetype","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetFiletype.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Determine filetype — GetFiletype","text":"","code":"GetFiletype(path)"},{"path":"http://saket-choudhary.me/covmuller/reference/GetFiletype.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Determine filetype — GetFiletype","text":"path Path file","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetFiletype.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Determine filetype — GetFiletype","text":"Extension file","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesCumulative.html","id":null,"dir":"Reference","previous_headings":"","what":"Get daily confirmed cases for India — GetIndiaConfirmedCasesCumulative","title":"Get daily confirmed cases for India — GetIndiaConfirmedCasesCumulative","text":"Get daily confirmed cases India","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesCumulative.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get daily confirmed cases for India — GetIndiaConfirmedCasesCumulative","text":"","code":"GetIndiaConfirmedCasesCumulative( url = \"https://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesCumulative.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get daily confirmed cases for India — GetIndiaConfirmedCasesCumulative","text":"url URL fetch data ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesCumulative.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get daily confirmed cases for India — GetIndiaConfirmedCasesCumulative","text":"data frame containing daily cases state","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesMonthlyLong.html","id":null,"dir":"Reference","previous_headings":"","what":"Get India monthwose cases long — GetIndiaConfirmedCasesMonthlyLong","title":"Get India monthwose cases long — GetIndiaConfirmedCasesMonthlyLong","text":"Get India monthwose cases long","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesMonthlyLong.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get India monthwose cases long — GetIndiaConfirmedCasesMonthlyLong","text":"","code":"GetIndiaConfirmedCasesMonthlyLong( url = \"http://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\", level = \"State\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesMonthlyLong.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get India monthwose cases long — GetIndiaConfirmedCasesMonthlyLong","text":"url URL fetch data ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesMonthlyLong.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get India monthwose cases long — GetIndiaConfirmedCasesMonthlyLong","text":"data frame containing monthly cases state long form","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesWeeklyLong.html","id":null,"dir":"Reference","previous_headings":"","what":"Get India weekwise cases long — GetIndiaConfirmedCasesWeeklyLong","title":"Get India weekwise cases long — GetIndiaConfirmedCasesWeeklyLong","text":"Get India weekwise cases long","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesWeeklyLong.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get India weekwise cases long — GetIndiaConfirmedCasesWeeklyLong","text":"","code":"GetIndiaConfirmedCasesWeeklyLong( url = \"https://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\", level = \"State\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesWeeklyLong.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get India weekwise cases long — GetIndiaConfirmedCasesWeeklyLong","text":"url URL fetch data ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaConfirmedCasesWeeklyLong.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get India weekwise cases long — GetIndiaConfirmedCasesWeeklyLong","text":"data frame containing monthly cases state long form","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyCasesCumulative.html","id":null,"dir":"Reference","previous_headings":"","what":"Get daily cases for India for a given status type — GetIndiaDailyCasesCumulative","title":"Get daily cases for India for a given status type — GetIndiaDailyCasesCumulative","text":"Get daily cases India given status type","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyCasesCumulative.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get daily cases for India for a given status type — GetIndiaDailyCasesCumulative","text":"","code":"GetIndiaDailyCasesCumulative( url = \"https://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\", status = \"Confirmed\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyCasesCumulative.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get daily cases for India for a given status type — GetIndiaDailyCasesCumulative","text":"url URL fetch data status One \"Confirmed\", \"Recovered\", \"Deceased\"","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyCasesCumulative.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get daily cases for India for a given status type — GetIndiaDailyCasesCumulative","text":"data frame containing daily cases state","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyData.html","id":null,"dir":"Reference","previous_headings":"","what":"Get daily statewise data for India — GetIndiaDailyData","title":"Get daily statewise data for India — GetIndiaDailyData","text":"'Status' column one 'Confirmed', 'Deceased' 'Recovered'","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get daily statewise data for India — GetIndiaDailyData","text":"","code":"GetIndiaDailyData( url = \"https://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get daily statewise data for India — GetIndiaDailyData","text":"url URL fetch data ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDailyData.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get daily statewise data for India — GetIndiaDailyData","text":"data frame containing daily cases state","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDeceasedCasesCumulative.html","id":null,"dir":"Reference","previous_headings":"","what":"Get daily deceased cases for India — GetIndiaDeceasedCasesCumulative","title":"Get daily deceased cases for India — GetIndiaDeceasedCasesCumulative","text":"Get daily deceased cases India","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDeceasedCasesCumulative.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get daily deceased cases for India — GetIndiaDeceasedCasesCumulative","text":"","code":"GetIndiaDeceasedCasesCumulative( url = \"https://saketkc.github.io/covid19bharat_data//csv/latest/state_wise_daily.csv\" )"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDeceasedCasesCumulative.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get daily deceased cases for India — GetIndiaDeceasedCasesCumulative","text":"url URL fetch data ","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaDeceasedCasesCumulative.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get daily deceased cases for India — GetIndiaDeceasedCasesCumulative","text":"data frame containing daily cases state","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaHospitalization.html","id":null,"dir":"Reference","previous_headings":"","what":"Get hospitalization data for India — GetIndiaHospitalization","title":"Get hospitalization data for India — GetIndiaHospitalization","text":"Get hospitalization data India","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndiaHospitalization.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get hospitalization data for India — GetIndiaHospitalization","text":"","code":"GetIndiaHospitalization(url = \"\")"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndianStates.html","id":null,"dir":"Reference","previous_headings":"","what":"Get a list of Indian name states — GetIndianStates","title":"Get a list of Indian name states — GetIndianStates","text":"Get list Indian name states","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndianStates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get a list of Indian name states — GetIndianStates","text":"","code":"GetIndianStates()"},{"path":"http://saket-choudhary.me/covmuller/reference/GetIndianStates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get a list of Indian name states — GetIndianStates","text":"list state abbreviation key full name value","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetMonthYear.html","id":null,"dir":"Reference","previous_headings":"","what":"Get MonthYear (zoo) from a dataframe string formatted data column — GetMonthYear","title":"Get MonthYear (zoo) from a dataframe string formatted data column — GetMonthYear","text":"Get MonthYear (zoo) dataframe string formatted data column","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetMonthYear.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get MonthYear (zoo) from a dataframe string formatted data column — GetMonthYear","text":"","code":"GetMonthYear(datecol, datefmt = \"%Y-%m-%d\")"},{"path":"http://saket-choudhary.me/covmuller/reference/GetMonthYear.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get MonthYear (zoo) from a dataframe string formatted data column — GetMonthYear","text":"datecol vector string formatted dates datefmt Format date (default Y-m-d)","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetMonthYear.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get MonthYear (zoo) from a dataframe string formatted data column — GetMonthYear","text":"vector dates converted MonthYear format (zoo::.yearmon)","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetVOCs.html","id":null,"dir":"Reference","previous_headings":"","what":"Get variants of concern — GetVOCs","title":"Get variants of concern — GetVOCs","text":"Get variants concern","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/GetVOCs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get variants of concern — GetVOCs","text":"","code":"GetVOCs()"},{"path":"http://saket-choudhary.me/covmuller/reference/GetVOCs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get variants of concern — GetVOCs","text":"list variants concern pangolin lineage","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotSequencedPropHeatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot heatmap of cases sequenced — PlotSequencedPropHeatmap","title":"Plot heatmap of cases sequenced — PlotSequencedPropHeatmap","text":"Plot heatmap cases sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotSequencedPropHeatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot heatmap of cases sequenced — PlotSequencedPropHeatmap","text":"","code":"PlotSequencedPropHeatmap(df)"},{"path":"http://saket-choudhary.me/covmuller/reference/PlotSequencedPropHeatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot heatmap of cases sequenced — PlotSequencedPropHeatmap","text":"cases_and_shared dataframe containing counts confirmed cases sequenced cases","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotSequencedPropHeatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot heatmap of cases sequenced — PlotSequencedPropHeatmap","text":"heatmap total percentage cases sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotTotalHeatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot heatmap of total cases/sequences — PlotTotalHeatmap","title":"Plot heatmap of total cases/sequences — PlotTotalHeatmap","text":"Plot heatmap total cases/sequences","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotTotalHeatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot heatmap of total cases/sequences — PlotTotalHeatmap","text":"","code":"PlotTotalHeatmap(df, color_legend = \"Total cases\")"},{"path":"http://saket-choudhary.me/covmuller/reference/PlotTotalHeatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot heatmap of total cases/sequences — PlotTotalHeatmap","text":"cases_and_shared dataframe containing counts confirmed cases sequenced cases (column named 'value')","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/PlotTotalHeatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot heatmap of total cases/sequences — PlotTotalHeatmap","text":"heatmap total cases/sequences","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceInstrument.html","id":null,"dir":"Reference","previous_headings":"","what":"Read instrument metadata from GISAID batch downloads — ReadAuspiceInstrument","title":"Read instrument metadata from GISAID batch downloads — ReadAuspiceInstrument","text":"Read instrument metadata GISAID batch downloads","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceInstrument.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read instrument metadata from GISAID batch downloads — ReadAuspiceInstrument","text":"","code":"ReadAuspiceInstrument(path)"},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceInstrument.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read instrument metadata from GISAID batch downloads — ReadAuspiceInstrument","text":"path Path list directories \"sequence.tsv\" inside subdirector","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceInstrument.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read instrument metadata from GISAID batch downloads — ReadAuspiceInstrument","text":"dataframe instrument related metadata","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceMetadata.html","id":null,"dir":"Reference","previous_headings":"","what":"Read all metadata from GISAID batch downloads — ReadAuspiceMetadata","title":"Read all metadata from GISAID batch downloads — ReadAuspiceMetadata","text":"Read metadata GISAID batch downloads","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceMetadata.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read all metadata from GISAID batch downloads — ReadAuspiceMetadata","text":"","code":"ReadAuspiceMetadata(path)"},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceMetadata.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read all metadata from GISAID batch downloads — ReadAuspiceMetadata","text":"path Path list directories \"sequence.tsv\" inside subdirector","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadAuspiceMetadata.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read all metadata from GISAID batch downloads — ReadAuspiceMetadata","text":"dataframe collated metadata","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadGISAIDMetada.html","id":null,"dir":"Reference","previous_headings":"","what":"Read metadata downloaded from GISAID — ReadGISAIDMetada","title":"Read metadata downloaded from GISAID — ReadGISAIDMetada","text":"Read metadata downloaded GISAID","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadGISAIDMetada.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read metadata downloaded from GISAID — ReadGISAIDMetada","text":"","code":"ReadGISAIDMetada(path, showProgress = FALSE, ...)"},{"path":"http://saket-choudhary.me/covmuller/reference/ReadGISAIDMetada.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read metadata downloaded from GISAID — ReadGISAIDMetada","text":"path Path tar.xz metadata.txt downloaded GISAID showProgress Whether print progress bars fread ... parameters data.table::fread","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/ReadGISAIDMetada.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read metadata downloaded from GISAID — ReadGISAIDMetada","text":"data frame parsed metadata extra columns","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SanitizeColumn.html","id":null,"dir":"Reference","previous_headings":"","what":"Sanitize a vector to remove special characters and convert it to tile — SanitizeColumn","title":"Sanitize a vector to remove special characters and convert it to tile — SanitizeColumn","text":"function removes: 1. Commas space 2. Hyphen space 3. Multiple dots single space 4. Multiple spacies single space 5. NA \"UNKNOWN\"","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SanitizeColumn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sanitize a vector to remove special characters and convert it to tile — SanitizeColumn","text":"","code":"SanitizeColumn(col)"},{"path":"http://saket-choudhary.me/covmuller/reference/SanitizeColumn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sanitize a vector to remove special characters and convert it to tile — SanitizeColumn","text":"col String vector","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SanitizeColumn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sanitize a vector to remove special characters and convert it to tile — SanitizeColumn","text":"string vector sanitized entries","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsDatewise.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the total number of variants per week — SummarizeVariantsDatewise","title":"Summarize the total number of variants per week — SummarizeVariantsDatewise","text":"Summarize total number variants per week","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsDatewise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the total number of variants per week — SummarizeVariantsDatewise","text":"","code":"SummarizeVariantsDatewise(variant_df, by_state = FALSE)"},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsDatewise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the total number of variants per week — SummarizeVariantsDatewise","text":"variant_df dataframe","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsDatewise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize the total number of variants per week — SummarizeVariantsDatewise","text":"dataframe monthwise counts variant sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsMonthwise.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the total number of variants per month — SummarizeVariantsMonthwise","title":"Summarize the total number of variants per month — SummarizeVariantsMonthwise","text":"Summarize total number variants per month","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsMonthwise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the total number of variants per month — SummarizeVariantsMonthwise","text":"","code":"SummarizeVariantsMonthwise(variant_df, by_state = FALSE)"},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsMonthwise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the total number of variants per month — SummarizeVariantsMonthwise","text":"variant_df dataframe","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsMonthwise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize the total number of variants per month — SummarizeVariantsMonthwise","text":"dataframe monthwise counts variant sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsWeekwise.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize the total number of variants per week — SummarizeVariantsWeekwise","title":"Summarize the total number of variants per week — SummarizeVariantsWeekwise","text":"Summarize total number variants per week","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsWeekwise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize the total number of variants per week — SummarizeVariantsWeekwise","text":"","code":"SummarizeVariantsWeekwise(variant_df, by_state = FALSE)"},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsWeekwise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize the total number of variants per week — SummarizeVariantsWeekwise","text":"variant_df dataframe","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/SummarizeVariantsWeekwise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize the total number of variants per week — SummarizeVariantsWeekwise","text":"dataframe monthwise counts variant sequenced","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthCountrywise.html","id":null,"dir":"Reference","previous_headings":"","what":"Get total sequenced samples per country — TotalSequencesPerMonthCountrywise","title":"Get total sequenced samples per country — TotalSequencesPerMonthCountrywise","text":"Get total sequenced samples per country","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthCountrywise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get total sequenced samples per country — TotalSequencesPerMonthCountrywise","text":"","code":"TotalSequencesPerMonthCountrywise(variant_df, rename_country_as_state = TRUE)"},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthCountrywise.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get total sequenced samples per country — TotalSequencesPerMonthCountrywise","text":"variant_df dataframe","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthCountrywise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get total sequenced samples per country — TotalSequencesPerMonthCountrywise","text":"dataframe sequencing statistics per country","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthStatewise.html","id":null,"dir":"Reference","previous_headings":"","what":"Get total number of sequenced samples per month in a Country — TotalSequencesPerMonthStatewise","title":"Get total number of sequenced samples per month in a Country — TotalSequencesPerMonthStatewise","text":"Get total number sequenced samples per month Country","code":""},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthStatewise.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get total number of sequenced samples per month in a Country — TotalSequencesPerMonthStatewise","text":"","code":"TotalSequencesPerMonthStatewise(variant_df, drop_country = FALSE)"},{"path":"http://saket-choudhary.me/covmuller/reference/TotalSequencesPerMonthStatewise.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get total number of sequenced samples per month in a Country — TotalSequencesPerMonthStatewise","text":"dataframe sequencing statistics per state per country","code":""}]
diff --git a/vignettes/Introduction.Rmd b/vignettes/Introduction.Rmd
index b2e56211..c84392d3 100644
--- a/vignettes/Introduction.Rmd
+++ b/vignettes/Introduction.Rmd
@@ -40,7 +40,7 @@ p1
We utilize [GISAID](https://www.gisaid.org/) data to look at prevalence of variants. To access this data, GISAID requires registration.
```{r}
-current_date <- "2024_01_08"
+current_date <- "2024_01_11"
fpath.tar <- paste0("~/data/epicov/metadata_tsv_", current_date, ".tar.xz")
fpath.qs <- paste0("~/data/epicov/metadata_tsv_", current_date, ".qs")
diff --git a/vignettes/MultinomialModeling-Germany.Rmd b/vignettes/MultinomialModeling-Germany.Rmd
deleted file mode 100644
index faabffa6..00000000
--- a/vignettes/MultinomialModeling-Germany.Rmd
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: "Multinomial modeling - Germany"
-output:
- html_document:
- df_print: paged
----
-
-
-```{r}
-suppressPackageStartupMessages({
- library(covmuller)
- library(tidyverse)
-})
-theme_set(CovmullerTheme())
-```
-
-```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread(file = "~/data/epicov/metadata_tsv_2024_01_08.qs")
-gisaid_germany <- gisaid_metadata %>%
- filter(Country == "Germany") %>%
- filter(Host == "Human")
-gisaid_germany <- FormatGISAIDMetadata(gisaid_germany) %>%
- filter(State != "") %>%
- filter(pangolin_lineage != "Unassigned")
-```
-
-## Plot total sequenced cases
-
-
-```{r, fig.width=8, fig.height=5, warning=FALSE}
-country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_germany, rename_country_as_state = TRUE)
-p0 <- BarPlot(country_seq_stats, ylabel = "Sequenced per month", color = "slateblue1", label_si = TRUE, xangle = 90, title = "Germany")
-p0
-```
-
-# Plot stateswise sequenced cases
-
-```{r, fig.width=8, fig.height=5, warning=FALSE}
-state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_germany)
-state_seq_stats_summary <- state_seq_stats %>%
- group_by(State) %>%
- summarise(value = sum(value))
-p1 <- BarPlot(state_seq_stats_summary, xaxis = "State", ylabel = "Sequenced per month", color = "slateblue1", label_si = TRUE, xangle = 90, title = "Germany")
-p1
-```
-
-## Get VOCs
-
-```{r}
-vocs <- GetVOCs()
-omicron <- vocs[["omicron"]]
-vocs[["omicron"]] <- NULL
-custom_voc_mapping <- list(
- `BA.1.1` = "BA.1",
- `BA.1` = "BA.1",
- `BA.2` = "BA.2",
- `BA.2.10` = "BA.2.X",
- `BA.2.10.1` = "BA.2.X",
- `BA.2.12` = "BA.2.X",
- `BA.2.12.1` = "BA.2.X",
- `BA.3` = "BA.3",
- `BA.4` = "BA.4",
- `BA.5` = "BA.5",
- `BA.2.74` = "BA.2.X",
- `BA.2.75` = "BA.2.75",
- `BA.2.76` = "BA.2.X",
- `XBB.*` = "XBB",
- `BQ.1` = "BQ.1+",
- `BQ.1.*` = "BQ.1+"
-)
-```
-
-```{r}
-gisaid_germany_collapsed <- CollapseLineageToVOCs(
- variant_df = gisaid_germany,
- vocs = vocs,
- custom_voc_mapping = custom_voc_mapping,
- summarize = FALSE
-)
-
-gisaid_germany_collapsed_sel <- gisaid_germany_collapsed %>%
- filter(MonthYearCollected >= "Oct 2022") %>%
- filter(lineage_collapsed != "Unassigned") %>%
- filter(State != "Unknown")
-
-vocs_to_keep <- table(gisaid_germany_collapsed_sel$lineage_collapsed)
-vocs_to_keep <- vocs_to_keep[vocs_to_keep > 50]
-
-gisaid_germany_collapsed_sel <- gisaid_germany_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep))
-
-gisaid_germany_shared_dateweek <- SummarizeVariantsDatewise(gisaid_germany_collapsed_sel, by_state = TRUE)
-head(gisaid_germany_shared_dateweek)
-```
-
-```{r}
-fit_germany_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_germany_shared_dateweek)
-head(fit_germany_multi_predsbystate)
-```
-
-# Plot Smooth Muller Plots
-
-```{r, fig.width=13, fig.height=13}
-muller_germanybystate_mfit <- PlotMullerDailyPrevalence(fit_germany_multi_predsbystate, ncol = 3)
-muller_germanybystate_mfit
-```
diff --git a/vignettes/MultinomialModeling_Australia.Rmd b/vignettes/MultinomialModeling_Australia.Rmd
deleted file mode 100644
index 7e119b0f..00000000
--- a/vignettes/MultinomialModeling_Australia.Rmd
+++ /dev/null
@@ -1,97 +0,0 @@
----
-title: "Multinomial modeling - Australia"
-output:
- html_document:
- df_print: paged
----
-
-
-```{r}
-suppressPackageStartupMessages({
- library(covmuller)
- library(tidyverse)
-})
-theme_set(CovmullerTheme())
-```
-
-```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread(file = "~/data/epicov/metadata_tsv_2024_01_08.qs")
-gisaid_australia <- gisaid_metadata %>%
- filter(Country == "Australia") %>%
- filter(Host == "Human")
-gisaid_australia <- FormatGISAIDMetadata(gisaid_australia)
-gisaid_australia$State <- gsub(pattern = "?", replacement = "", x = gisaid_australia$State)
-
-gisaid_australia <- gisaid_australia %>%
- filter(State != "") %>%
- arrange(State, MonthYearCollected)
-gisaid_australia <- gisaid_australia %>% filter(State != "Unknown")
-```
-
-## Plot total sequenced cases
-
-
-```{r, fig.width=8, fig.height=5, warning=FALSE}
-country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_australia, rename_country_as_state = TRUE)
-p0 <- BarPlot(country_seq_stats, ylabel = "Sequenced per month", color = "slateblue1", label_si = TRUE, xangle = 90, title = "Australia")
-p0
-```
-
-## Get VOCs
-
-```{r}
-vocs <- GetVOCs()
-omicron <- vocs[["omicron"]]
-vocs[["omicron"]] <- NULL
-custom_voc_mapping <- list(
- `BA.1.1` = "BA.1",
- `BA.1` = "BA.1",
- `BA.2` = "BA.2",
- `BA.2.10` = "BA.2.X",
- `BA.2.10.1` = "BA.2.X",
- `BA.2.12` = "BA.2.X",
- `BA.2.12.1` = "BA.2.X",
- `BA.3` = "BA.3",
- `BA.4` = "BA.4",
- `BA.5` = "BA.5",
- `BA.2.74` = "BA.2.X",
- `BA.2.75` = "BA.2.75",
- `BA.2.76` = "BA.2.X",
- `XBB.*` = "XBB",
- `BQ.1` = "BQ.1+",
- `BQ.1.*` = "BQ.1+"
-)
-```
-
-
-```{r}
-gisaid_australia_collapsed <- CollapseLineageToVOCs(
- variant_df = gisaid_australia,
- vocs = vocs,
- custom_voc_mapping = custom_voc_mapping,
- summarize = FALSE
-)
-
-gisaid_australia_collapsed_sel <- gisaid_australia_collapsed %>%
- filter(MonthYearCollected >= "Oct 2022") %>%
- filter(lineage_collapsed != "Unassigned")
-
-vocs_to_keep <- table(gisaid_australia_collapsed_sel$lineage_collapsed)
-vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100]
-
-gisaid_australia_collapsed_sel <- gisaid_australia_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep))
-gisaid_australia_shared_dateweek <- SummarizeVariantsDatewise(gisaid_australia_collapsed_sel, by_state = TRUE)
-head(gisaid_australia_shared_dateweek)
-```
-
-```{r}
-fit_australia_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_australia_shared_dateweek)
-head(fit_australia_multi_predsbystate)
-```
-
-# Plot Smooth Muller Plots
-
-```{r, fig.width=12, fig.height=9}
-muller_australiabystate_mfit <- PlotMullerDailyPrevalence(fit_australia_multi_predsbystate, ncol = 3)
-muller_australiabystate_mfit
-```
diff --git a/vignettes/MultinomialModeling_Canada.Rmd b/vignettes/MultinomialModeling_Canada.Rmd
deleted file mode 100644
index 19b4ae39..00000000
--- a/vignettes/MultinomialModeling_Canada.Rmd
+++ /dev/null
@@ -1,92 +0,0 @@
----
-title: "Multinomial modeling - Canada"
-output:
- html_document:
- df_print: paged
----
-
-
-```{r}
-suppressPackageStartupMessages({
- library(covmuller)
- library(tidyverse)
-})
-theme_set(CovmullerTheme())
-```
-
-```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread(file = "~/data/epicov/metadata_tsv_2024_01_08.qs")
-gisaid_canada <- gisaid_metadata %>%
- filter(Country == "Canada") %>%
- filter(Host == "Human")
-gisaid_canada <- FormatGISAIDMetadata(gisaid_canada)
-gisaid_canada <- gisaid_canada %>%
- arrange(State, MonthYearCollected)
-gisaid_canada$State <- CleanCanadaStates(gisaid_canada$State)
-gisaid_canada <- gisaid_canada %>% filter(State != "Unknown")
-```
-## Plot total sequenced cases
-
-
-```{r, fig.width=8, fig.height=5, warning=FALSE}
-country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_canada, rename_country_as_state = TRUE)
-p0 <- BarPlot(country_seq_stats, ylabel = "Sequenced per month", color = "slateblue1", label_si = TRUE, xangle = 90, title = "Canada")
-p0
-```
-
-## Get VOCs
-
-```{r}
-vocs <- GetVOCs()
-omicron <- vocs[["omicron"]]
-vocs[["omicron"]] <- NULL
-custom_voc_mapping <- list(
- `BA.1.1` = "BA.1",
- `BA.1` = "BA.1",
- `BA.2` = "BA.2",
- `BA.2.10` = "BA.2.X",
- `BA.2.10.1` = "BA.2.X",
- `BA.2.12` = "BA.2.X",
- `BA.2.12.1` = "BA.2.X",
- `BA.3` = "BA.3",
- `BA.4` = "BA.4",
- `BA.5` = "BA.5",
- `BA.2.74` = "BA.2.X",
- `BA.2.75` = "BA.2.75",
- `BA.2.76` = "BA.2.X",
- `XBB.*` = "XBB",
- `BQ.1` = "BQ.1+",
- `BQ.1.*` = "BQ.1+"
-)
-```
-
-
-```{r}
-gisaid_canada_collapsed <- CollapseLineageToVOCs(
- variant_df = gisaid_canada,
- vocs = vocs,
- custom_voc_mapping = custom_voc_mapping,
- summarize = FALSE
-)
-
-gisaid_canada_collapsed_sel <- gisaid_canada_collapsed %>% filter(MonthYearCollected >= "Oct 2022")
-
-vocs_to_keep <- table(gisaid_canada_collapsed_sel$lineage_collapsed)
-vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100]
-
-gisaid_canada_collapsed_sel <- gisaid_canada_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep))
-gisaid_canada_shared_dateweek <- SummarizeVariantsDatewise(gisaid_canada_collapsed_sel, by_state = TRUE)
-head(gisaid_canada_shared_dateweek)
-```
-
-```{r}
-fit_canada_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_canada_shared_dateweek)
-head(fit_canada_multi_predsbystate)
-```
-
-# Plot Smooth Muller Plots
-
-```{r, fig.width=12, fig.height=9}
-muller_canadabystate_mfit <- PlotMullerDailyPrevalence(fit_canada_multi_predsbystate, ncol = 3)
-muller_canadabystate_mfit
-```
diff --git a/vignettes/MultinomialModeling_India.Rmd b/vignettes/MultinomialModeling_India.Rmd
deleted file mode 100644
index 587fd739..00000000
--- a/vignettes/MultinomialModeling_India.Rmd
+++ /dev/null
@@ -1,99 +0,0 @@
----
-title: "Multinomial modeling - India"
-output:
- html_document:
- df_print: paged
----
-
-
-```{r}
-suppressPackageStartupMessages({
- library(covmuller)
- library(tidyverse)
-})
-theme_set(CovmullerTheme())
-```
-
-```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread(file = "~/data/epicov/metadata_tsv_2024_01_08.qs")
-gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
-```
-
-## Plot total sequenced cases
-
-
-```{r, fig.width=8, fig.height=5, warning=FALSE}
-country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_india, rename_country_as_state = TRUE)
-p0 <- BarPlot(country_seq_stats, ylabel = "Sequenced per month", color = "slateblue1", label_si = TRUE, xangle = 90, title = "India")
-p0
-```
-
-# Plot stateswise sequenced cases
-
-```{r, fig.width=8, fig.height=5, warning=FALSE}
-state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_india)
-state_seq_stats_summary <- state_seq_stats %>%
- group_by(State) %>%
- summarise(value = sum(value))
-state_seq_stats_summary$State[state_seq_stats_summary$State == "Dadra and Nagar Haveli and Daman and Diu"] <- "Dadra/N Haveli/Daman/Diu"
-p1 <- BarPlot(state_seq_stats_summary, xaxis = "State", ylabel = "Total sequences deposited", color = "slateblue1", label_si = TRUE, xangle = 90, title = "India")
-p1
-```
-
-## Get VOCs
-
-```{r}
-vocs <- GetVOCs()
-omicron <- vocs[["omicron"]]
-vocs[["omicron"]] <- NULL
-custom_voc_mapping <- list(
- `BA.1.1` = "BA.1",
- `BA.1` = "BA.1",
- `BA.2` = "BA.2",
- `BA.2.10` = "BA.2.X",
- `BA.2.10.1` = "BA.2.X",
- `BA.2.12` = "BA.2.X",
- `BA.2.12.1` = "BA.2.X",
- `BA.3` = "BA.3",
- `BA.4` = "BA.4",
- `BA.5` = "BA.5",
- `BA.2.74` = "BA.2.X",
- `BA.2.75` = "BA.2.75",
- `BA.2.76` = "BA.2.X",
- `XBB.*` = "XBB",
- `BQ.1` = "BQ.1+",
- `BQ.1.*` = "BQ.1+"
-)
-```
-
-```{r}
-gisaid_india_collapsed <- CollapseLineageToVOCs(
- variant_df = gisaid_india,
- vocs = vocs,
- custom_voc_mapping = custom_voc_mapping,
- summarize = FALSE
-)
-
-gisaid_india_collapsed_sel <- gisaid_india_collapsed %>%
- filter(MonthYearCollected >= "Oct 2022") %>%
- filter(lineage_collapsed != "Unassigned")
-vocs_to_keep <- table(gisaid_india_collapsed_sel$lineage_collapsed)
-vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100]
-
-gisaid_india_collapsed_sel <- gisaid_india_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep))
-
-gisaid_india_shared_dateweek <- SummarizeVariantsDatewise(gisaid_india_collapsed_sel, by_state = TRUE)
-head(gisaid_india_shared_dateweek)
-```
-
-```{r}
-fit_india_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_india_shared_dateweek)
-head(fit_india_multi_predsbystate)
-```
-
-# Plot Smooth Muller Plots
-
-```{r, fig.width=13, fig.height=13}
-muller_indiabystate_mfit <- PlotMullerDailyPrevalence(fit_india_multi_predsbystate)
-muller_indiabystate_mfit
-```
diff --git a/vignettes/MultinomialModeling_SouthAfrica.Rmd b/vignettes/MultinomialModeling_SouthAfrica.Rmd
deleted file mode 100644
index 70de933b..00000000
--- a/vignettes/MultinomialModeling_SouthAfrica.Rmd
+++ /dev/null
@@ -1,106 +0,0 @@
----
-title: "Multinomial modeling - South Africa"
-output:
- html_document:
- df_print: paged
----
-
-
-```{r}
-suppressPackageStartupMessages({
- library(covmuller)
- library(tidyverse)
-})
-theme_set(CovmullerTheme())
-```
-
-```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread(file = "~/data/epicov/metadata_tsv_2024_01_08.qs")
-gisaid_southafrica <- gisaid_metadata %>%
- filter(Country == "South Africa") %>%
- filter(Host == "Human")
-gisaid_southafrica <- FormatGISAIDMetadata(gisaid_southafrica)
-gisaid_southafrica <- gisaid_southafrica %>%
- arrange(State, MonthYearCollected)
-gisaid_southafrica$State <- CleanSouthAfricanStates(gisaid_southafrica$State)
-```
-
-## Plot total sequenced cases
-
-
-```{r, fig.width=8, fig.height=5, warning=FALSE}
-country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_southafrica, rename_country_as_state = TRUE)
-p0 <- BarPlot(country_seq_stats, ylabel = "Sequenced per month", color = "slateblue1", label_si = TRUE, xangle = 90, title = "South Africa")
-p0
-```
-
-# Plot stateswise sequenced cases
-
-```{r, fig.width=8, fig.height=5, warning=FALSE}
-state_seq_stats <- TotalSequencesPerMonthStatewise(gisaid_southafrica)
-state_seq_stats_summary <- state_seq_stats %>%
- group_by(State) %>%
- summarise(value = sum(value))
-p1 <- BarPlot(state_seq_stats_summary, xaxis = "State", ylabel = "Sequenced per month", color = "slateblue1", label_si = TRUE, xangle = 90, title = "South Africa")
-p1
-```
-
-## Get VOCs
-
-```{r}
-vocs <- GetVOCs()
-omicron <- vocs[["omicron"]]
-vocs[["omicron"]] <- NULL
-custom_voc_mapping <- list(
- `BA.1.1` = "BA.1",
- `BA.1` = "BA.1",
- `BA.2` = "BA.2",
- `BA.2.10` = "BA.2.X",
- `BA.2.10.1` = "BA.2.X",
- `BA.2.12` = "BA.2.X",
- `BA.2.12.1` = "BA.2.X",
- `BA.3` = "BA.3",
- `BA.4` = "BA.4",
- `BA.5` = "BA.5",
- `BA.2.74` = "BA.2.X",
- `BA.2.75` = "BA.2.75",
- `BA.2.76` = "BA.2.X",
- `XBB.*` = "XBB",
- `BQ.1` = "BQ.1+",
- `BQ.1.*` = "BQ.1+"
-)
-```
-
-```{r}
-gisaid_southafrica_collapsed <- CollapseLineageToVOCs(
- variant_df = gisaid_southafrica,
- vocs = vocs,
- custom_voc_mapping = custom_voc_mapping,
- summarize = FALSE
-)
-
-gisaid_southafrica_collapsed_sel <- gisaid_southafrica_collapsed %>%
- filter(MonthYearCollected >= "Oct 2022") %>%
- filter(lineage_collapsed != "Unassigned") %>%
- filter(State != "Unknown")
-
-vocs_to_keep <- table(gisaid_southafrica_collapsed_sel$lineage_collapsed)
-vocs_to_keep <- vocs_to_keep[vocs_to_keep > 50]
-
-gisaid_southafrica_collapsed_sel <- gisaid_southafrica_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep))
-
-gisaid_southafrica_shared_dateweek <- SummarizeVariantsDatewise(gisaid_southafrica_collapsed_sel, by_state = TRUE)
-head(gisaid_southafrica_shared_dateweek)
-```
-
-```{r}
-fit_southafrica_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_southafrica_shared_dateweek)
-head(fit_southafrica_multi_predsbystate)
-```
-
-# Plot Smooth Muller Plots
-
-```{r, fig.width=13, fig.height=13}
-muller_southafricabystate_mfit <- PlotMullerDailyPrevalence(fit_southafrica_multi_predsbystate, ncol = 3)
-muller_southafricabystate_mfit
-```
diff --git a/vignettes/MultinomialModeling_UK.Rmd b/vignettes/MultinomialModeling_UK.Rmd
deleted file mode 100644
index 294b1db6..00000000
--- a/vignettes/MultinomialModeling_UK.Rmd
+++ /dev/null
@@ -1,93 +0,0 @@
----
-title: "Multinomial modeling - United Kingdom"
-output:
- html_document:
- df_print: paged
----
-
-
-```{r}
-suppressPackageStartupMessages({
- library(covmuller)
- library(tidyverse)
-})
-theme_set(CovmullerTheme())
-```
-
-```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread(file = "~/data/epicov/metadata_tsv_2024_01_08.qs")
-gisaid_uk <- gisaid_metadata %>%
- filter(Country == "United Kingdom") %>%
- filter(Host == "Human")
-gisaid_uk <- FormatGISAIDMetadata(gisaid_uk)
-gisaid_uk <- gisaid_uk %>%
- filter(State != "") %>%
- arrange(State, MonthYearCollected)
-```
-
-## Plot total sequenced cases
-
-```{r, fig.width=8, fig.height=5, warning=FALSE}
-country_seq_stats <- TotalSequencesPerMonthCountrywise(gisaid_uk, rename_country_as_state = TRUE)
-p0 <- BarPlot(country_seq_stats, ylabel = "Sequenced per month", color = "slateblue1", label_si = TRUE, xangle = 90, title = "United Kingdom")
-p0
-```
-
-## Get VOCs
-
-```{r}
-vocs <- GetVOCs()
-omicron <- vocs[["omicron"]]
-vocs[["omicron"]] <- NULL
-custom_voc_mapping <- list(
- `BA.1.1` = "BA.1",
- `BA.1` = "BA.1",
- `BA.2` = "BA.2",
- `BA.2.10` = "BA.2.X",
- `BA.2.10.1` = "BA.2.X",
- `BA.2.12` = "BA.2.X",
- `BA.2.12.1` = "BA.2.X",
- `BA.3` = "BA.3",
- `BA.4` = "BA.4",
- `BA.5` = "BA.5",
- `BA.2.74` = "BA.2.X",
- `BA.2.75` = "BA.2.75",
- `BA.2.76` = "BA.2.X",
- `XBB.*` = "XBB",
- `BQ.1` = "BQ.1+",
- `BQ.1.*` = "BQ.1+"
-)
-```
-
-
-```{r}
-gisaid_uk_collapsed <- CollapseLineageToVOCs(
- variant_df = gisaid_uk,
- vocs = vocs,
- custom_voc_mapping = custom_voc_mapping,
- summarize = FALSE
-)
-
-gisaid_uk_collapsed_sel <- gisaid_uk_collapsed %>%
- filter(MonthYearCollected >= "Oct 2022") %>%
- filter(lineage_collapsed != "Unassigned")
-
-vocs_to_keep <- table(gisaid_uk_collapsed_sel$lineage_collapsed)
-vocs_to_keep <- vocs_to_keep[vocs_to_keep > 100]
-
-gisaid_uk_collapsed_sel <- gisaid_uk_collapsed_sel %>% filter(lineage_collapsed %in% names(vocs_to_keep))
-gisaid_uk_shared_dateweek <- SummarizeVariantsDatewise(gisaid_uk_collapsed_sel, by_state = TRUE)
-head(gisaid_uk_shared_dateweek)
-```
-
-```{r}
-fit_uk_multi_predsbystate <- FitMultinomStatewiseDaily(gisaid_uk_shared_dateweek)
-head(fit_uk_multi_predsbystate)
-```
-
-# Plot Smooth Muller Plots
-
-```{r, fig.width=12, fig.height=9}
-muller_ukbystate_mfit <- PlotMullerDailyPrevalence(fit_uk_multi_predsbystate, ncol = 3)
-muller_ukbystate_mfit
-```
diff --git a/vignettes/VariantAnimation-Bengaluru.Rmd b/vignettes/VariantAnimation-Bengaluru.Rmd
index 25f0fd0d..40e25060 100644
--- a/vignettes/VariantAnimation-Bengaluru.Rmd
+++ b/vignettes/VariantAnimation-Bengaluru.Rmd
@@ -19,7 +19,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-Chennai.Rmd b/vignettes/VariantAnimation-Chennai.Rmd
index be0c0769..7e214b1d 100644
--- a/vignettes/VariantAnimation-Chennai.Rmd
+++ b/vignettes/VariantAnimation-Chennai.Rmd
@@ -19,7 +19,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-Delhi.Rmd b/vignettes/VariantAnimation-Delhi.Rmd
index 74d0f4d6..c0d4b6af 100644
--- a/vignettes/VariantAnimation-Delhi.Rmd
+++ b/vignettes/VariantAnimation-Delhi.Rmd
@@ -19,7 +19,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-Germany.Rmd b/vignettes/VariantAnimation-Germany.Rmd
index f5b2e661..0fe37a62 100644
--- a/vignettes/VariantAnimation-Germany.Rmd
+++ b/vignettes/VariantAnimation-Germany.Rmd
@@ -15,7 +15,7 @@ theme_set(CovmullerTheme())
# Get variants data for Germany
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_germany <- gisaid_metadata %>%
filter(Country == "Germany") %>%
filter(Host == "Human")
diff --git a/vignettes/VariantAnimation-Gujarat.Rmd b/vignettes/VariantAnimation-Gujarat.Rmd
index 335c7244..443af046 100644
--- a/vignettes/VariantAnimation-Gujarat.Rmd
+++ b/vignettes/VariantAnimation-Gujarat.Rmd
@@ -20,7 +20,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-India.Rmd b/vignettes/VariantAnimation-India.Rmd
index 52345d1a..2718b844 100644
--- a/vignettes/VariantAnimation-India.Rmd
+++ b/vignettes/VariantAnimation-India.Rmd
@@ -19,7 +19,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-Jaipur.Rmd b/vignettes/VariantAnimation-Jaipur.Rmd
index 5d530731..c796a628 100644
--- a/vignettes/VariantAnimation-Jaipur.Rmd
+++ b/vignettes/VariantAnimation-Jaipur.Rmd
@@ -19,7 +19,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-Maharashtra.Rmd b/vignettes/VariantAnimation-Maharashtra.Rmd
index 03523bec..955e8bf9 100644
--- a/vignettes/VariantAnimation-Maharashtra.Rmd
+++ b/vignettes/VariantAnimation-Maharashtra.Rmd
@@ -20,7 +20,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-Mumbai.Rmd b/vignettes/VariantAnimation-Mumbai.Rmd
index a8b44a69..a7cc777d 100644
--- a/vignettes/VariantAnimation-Mumbai.Rmd
+++ b/vignettes/VariantAnimation-Mumbai.Rmd
@@ -20,7 +20,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-NYC.Rmd b/vignettes/VariantAnimation-NYC.Rmd
index dbad83f9..e0874008 100644
--- a/vignettes/VariantAnimation-NYC.Rmd
+++ b/vignettes/VariantAnimation-NYC.Rmd
@@ -16,7 +16,7 @@ theme_set(CovmullerTheme())
```{r, warning=FALSE, message=FALSE}
counties <- c("New York", "New York City", "New York County", "Queens County", "Bronx County", "Bronx", "Brooklyn", "Manhattan", "Queens", "Richmond County")
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_usa <- gisaid_metadata %>%
filter(Country == "USA") %>%
filter(Host == "Human")
diff --git a/vignettes/VariantAnimation-NewYork.Rmd b/vignettes/VariantAnimation-NewYork.Rmd
index 8ecd5ded..d4330bd5 100644
--- a/vignettes/VariantAnimation-NewYork.Rmd
+++ b/vignettes/VariantAnimation-NewYork.Rmd
@@ -17,7 +17,7 @@ theme_set(CovmullerTheme())
# Get variants data for NY state
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_usa <- gisaid_metadata %>%
filter(Country == "USA") %>%
filter(Host == "Human")
diff --git a/vignettes/VariantAnimation-Pune.Rmd b/vignettes/VariantAnimation-Pune.Rmd
index fecd0ee8..a5a453b3 100644
--- a/vignettes/VariantAnimation-Pune.Rmd
+++ b/vignettes/VariantAnimation-Pune.Rmd
@@ -19,7 +19,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-Singapore.Rmd b/vignettes/VariantAnimation-Singapore.Rmd
index f1843ae3..b8c882d1 100644
--- a/vignettes/VariantAnimation-Singapore.Rmd
+++ b/vignettes/VariantAnimation-Singapore.Rmd
@@ -15,7 +15,7 @@ theme_set(CovmullerTheme())
# Get variants data for Singapore
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_singapore <- gisaid_metadata %>%
filter(Country == "Singapore") %>%
filter(Host == "Human")
diff --git a/vignettes/VariantAnimation-SouthAfrica.Rmd b/vignettes/VariantAnimation-SouthAfrica.Rmd
index ef9c472a..32b2c105 100644
--- a/vignettes/VariantAnimation-SouthAfrica.Rmd
+++ b/vignettes/VariantAnimation-SouthAfrica.Rmd
@@ -15,7 +15,7 @@ theme_set(CovmullerTheme())
# Get variants data for South Africa
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_sa <- gisaid_metadata %>%
filter(Country == "South Africa") %>%
filter(Host == "Human")
diff --git a/vignettes/VariantAnimation-Tamilnadu.Rmd b/vignettes/VariantAnimation-Tamilnadu.Rmd
index 527e951f..b6255320 100644
--- a/vignettes/VariantAnimation-Tamilnadu.Rmd
+++ b/vignettes/VariantAnimation-Tamilnadu.Rmd
@@ -20,7 +20,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-Telangana.Rmd b/vignettes/VariantAnimation-Telangana.Rmd
index 7b26e152..4604b88c 100644
--- a/vignettes/VariantAnimation-Telangana.Rmd
+++ b/vignettes/VariantAnimation-Telangana.Rmd
@@ -20,7 +20,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/VariantAnimation-UK.Rmd b/vignettes/VariantAnimation-UK.Rmd
index 54663e89..4d0e81c6 100644
--- a/vignettes/VariantAnimation-UK.Rmd
+++ b/vignettes/VariantAnimation-UK.Rmd
@@ -18,7 +18,7 @@ theme_set(CovmullerTheme())
# Get variants data for UK
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_uk <- gisaid_metadata %>%
filter(Country == "United Kingdom") %>%
filter(Host == "Human")
diff --git a/vignettes/VariantAnimation-USA.Rmd b/vignettes/VariantAnimation-USA.Rmd
index 0feda475..2866c825 100644
--- a/vignettes/VariantAnimation-USA.Rmd
+++ b/vignettes/VariantAnimation-USA.Rmd
@@ -31,7 +31,7 @@ theme_set(CovmullerTheme())
# Get variants data for USA
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_usa <- gisaid_metadata %>%
filter(Country == "USA") %>%
filter(Host == "Human")
diff --git a/vignettes/VarinatAnimation-Kolkata.Rmd b/vignettes/VarinatAnimation-Kolkata.Rmd
index 5229942c..52b4f862 100644
--- a/vignettes/VarinatAnimation-Kolkata.Rmd
+++ b/vignettes/VarinatAnimation-Kolkata.Rmd
@@ -19,7 +19,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/_SouthAfrica_contrast_India.Rmd b/vignettes/_SouthAfrica_contrast_India.Rmd
index dddc5671..ddd507be 100644
--- a/vignettes/_SouthAfrica_contrast_India.Rmd
+++ b/vignettes/_SouthAfrica_contrast_India.Rmd
@@ -16,7 +16,7 @@ theme_set(CovmullerTheme())
# Get data
```{r}
-current_date <- "2024_01_08"
+current_date <- "2024_01_11"
fpath.tar <- paste0("~/data/epicov/metadata_tsv_", current_date, ".tar.xz")
fpath.qs <- paste0("~/data/epicov/metadata_tsv_", current_date, ".qs")
gisaid_metadata <- qs::qread(file = fpath.qs)
diff --git a/vignettes/_VariantAnimation-Hyderabad.Rmd b/vignettes/_VariantAnimation-Hyderabad.Rmd
index 20623462..7af3ed3c 100644
--- a/vignettes/_VariantAnimation-Hyderabad.Rmd
+++ b/vignettes/_VariantAnimation-Hyderabad.Rmd
@@ -19,7 +19,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/_VariantAnimation-Kerala.Rmd b/vignettes/_VariantAnimation-Kerala.Rmd
index 08ec4568..c4081adf 100644
--- a/vignettes/_VariantAnimation-Kerala.Rmd
+++ b/vignettes/_VariantAnimation-Kerala.Rmd
@@ -20,7 +20,7 @@ theme_set(CovmullerTheme())
# Get variants data for India
```{r, warning=FALSE, message=FALSE}
-gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_08.qs")
+gisaid_metadata <- qs::qread("~/data/epicov/metadata_tsv_2024_01_11.qs")
gisaid_india <- FilterGISAIDIndia(gisaid_metadata_all = gisaid_metadata)
vocs <- GetVOCs()
diff --git a/vignettes/replace_date.sh b/vignettes/replace_date.sh
index b672f2bf..cf26d7f8 100644
--- a/vignettes/replace_date.sh
+++ b/vignettes/replace_date.sh
@@ -1,3 +1,3 @@
for file in *; do
- sed -i "s/$1/$2/g" "$file"
+ gsed -i "s/$1/$2/g" "$file"
done