Skip to content

Commit

Permalink
Update VOCs
Browse files Browse the repository at this point in the history
  • Loading branch information
saketkc committed Jan 13, 2024
1 parent 5e762ac commit e39bf9b
Show file tree
Hide file tree
Showing 27 changed files with 512 additions and 206 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: covmuller
Type: Package
Title: A tool to model COVID19 variant prevalence using data from GISAID
Version: 0.1.2.0002
Date: 2024-01-12
Version: 0.1.2.0003
Date: 2024-01-13
Author: Saket Choudhary
Maintainer: Saket Choudhary <[email protected]>
Description: covmuller can be used to process data from GISAID and
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export(CovmullerTheme)
export(FilterGISAIDIndia)
export(FitMultinomStatewiseDaily)
export(FitMultinomWeekly)
export(FixDate)
export(FormatGISAIDMetadata)
export(GeocodeAddress)
export(GetIndiaConfirmedCasesCumulative)
Expand Down
2 changes: 2 additions & 0 deletions R/gisaid.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ ReadGISAIDMetada <- function(path, showProgress = FALSE, ...) {
#' @export
FormatGISAIDMetadata <- function(df, collection_col = "Collection date", submission_col = "Submission date") {
datecol_sel <- pull(df, as.name(collection_col))
datecol_sel <- FixDate(datecol = datecol_sel)
Date <- as.Date(datecol_sel, format = "%Y-%m-%d")
df$DateCollected <- Date
df$YearCollected <- year(df$DateCollected)
Expand All @@ -67,6 +68,7 @@ FormatGISAIDMetadata <- function(df, collection_col = "Collection date", submiss
df$MonthYearCollectedNumeric <- as.numeric(df$MonthYearCollected)

datecol_sel <- pull(df, as.name(submission_col))
datecol_sel <- FixDate(datecol = datecol_sel)
Date <- as.Date(datecol_sel, format = "%Y-%m-%d")
df$DateSubmitted <- Date
df$MonthYearSubmitted <- GetMonthYear(datecol = datecol_sel, datefmt = "%Y-%m-%d")
Expand Down
134 changes: 94 additions & 40 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@
#' @returns A vector with dates converted to MonthYear format (zoo::as.yearmon)
#' @importFrom dplyr pull
#' @importFrom zoo as.yearmon
#' @importFrom stringr str_count
#' @export
GetMonthYear <- function(datecol, datefmt = "%Y-%m-%d") {
number_dashes <- str_count(string = datecol, pattern = "-")
if (datefmt == "%Y-%m-%d"){
datecol[number_dashes == 1] <- paste0(datecol[number_dashes == 1], "-01")
} else if (datefmt == "%d-%m-%Y"){
datecol[number_dashes == 1] <- paste0("01-", datecol[number_dashes == 1])
}
Date <- as.Date(datecol, format = datefmt)
Month <- strftime(Date, "%m")
Year <- strftime(Date, "%Y")
Expand All @@ -22,6 +15,22 @@ GetMonthYear <- function(datecol, datefmt = "%Y-%m-%d") {
return(MonthYear)
}


#' Fix date format
#' @importFrom stringr str_count
#' @export
FixDate <- function(datecol, datefmt = "%Y-%m-%d") {
datecol <- as.character(x = datecol)
datecol[datecol == "-"] <- ""
number_dashes <- str_count(string = datecol, pattern = "-")
if (datefmt == "%Y-%m-%d") {
datecol[number_dashes == 1] <- paste0(datecol[number_dashes == 1], "-01")
} else if (datefmt == "%d-%m-%Y") {
datecol[number_dashes == 1] <- paste0("01-", datecol[number_dashes == 1])
}
return(datecol)
}

#' Determine filetype
#' @param path Path to file
#' @returns Extension of file
Expand All @@ -43,23 +52,67 @@ GetVOCs <- function() {
"P.1.12.1", "P.1.13", "P.1.14", "P.1.15", "P.1.16", "P.1.17", "P.1.17.1"
)
delta_voc <- c(
"B.1.617.2", "AY.1", "AY.2", "AY.3", "AY.3.1", "AY.3.2", "AY.3.3", "AY.3.4", "AY.4", "AY.4.1", "AY.4.2", "AY.4.2.1", "AY.4.2.2", "AY.4.2.3", "AY.4.2.4", "AY.4.3", "AY.4.4", "AY.4.5", "AY.4.6", "AY.4.7", "AY.4.8", "AY.4.9", "AY.4.10", "AY.4.11", "AY.4.12", "AY.4.13", "AY.4.14", "AY.4.15", "AY.4.16", "AY.4.17", "AY.5", "AY.5.1", "AY.5.2", "AY.5.3", "AY.5.4", "AY.5.5", "AY.5.6", "AY.6", "AY.7", "AY.7.1", "AY.7.2", "AY.8", "AY.9", "AY.9.1", "AY.9.2", "AY.9.2.1", "AY.9.2.2", "AY.10", "AY.11", "AY.12", "AY.13", "AY.14", "AY.15", "AY.16", "AY.16.1", "AY.17", "AY.18", "AY.19", "AY.20", "AY.20.1", "AY.21", "AY.22", "AY.23", "AY.23.1", "AY.23.2", "AY.24", "AY.24.1", "AY.25", "AY.25.1", "AY.25.1.1", "AY.25.1.2", "AY.25.2", "AY.25.3", "AY.26", "AY.26.1", "AY.27", "AY.28", "AY.29", "AY.29.1", "AY.30", "AY.31", "AY.32", "AY.33", "AY.33.1", "AY.34", "AY.34.1", "AY.34.1.1", "AY.34.2", "AY.35", "AY.36", "AY.37", "AY.38", "AY.39", "AY.39.1", "AY.39.1.1", "AY.39.1.2", "AY.39.1.3", "AY.39.2", "AY.39.3", "AY.40", "AY.41", "AY.42", "AY.42.1", "AY.43", "AY.43.1", "AY.43.2", "AY.43.3", "AY.43.4", "AY.43.5", "AY.43.6", "AY.43.7", "AY.43.8", "AY.43.9", "AY.44", "AY.45", "AY.46", "AY.46.1", "AY.46.2", "AY.46.3", "AY.46.4", "AY.46.5", "AY.46.6", "AY.46.6.1", "AY.47", "AY.48", "AY.49", "AY.50", "AY.51", "AY.52", "AY.53", "AY.54", "AY.55", "AY.56", "AY.57", "AY.58", "AY.59", "AY.60", "AY.61", "AY.62", "AY.63", "AY.64", "AY.65", "AY.66", "AY.67", "AY.68", "AY.69", "AY.70", "AY.71", "AY.72", "AY.73", "AY.74", "AY.75", "AY.75.1", "AY.75.2", "AY.75.3", "AY.76", "AY.77", "AY.78", "AY.79", "AY.80", "AY.81", "AY.82", "AY.83", "AY.84", "AY.85", "AY.86", "AY.87", "AY.88", "AY.89", "AY.90", "AY.91", "AY.91.1", "AY.92", "AY.93", "AY.94", "AY.95", "AY.96", "AY.97", "AY.98", "AY.98.1", "AY.99", "AY.99.1", "AY.99.2", "AY.100", "AY.101", "AY.102", "AY.102.1", "AY.102.2", "AY.103", "AY.103.1", "AY.103.2", "AY.104", "AY.105", "AY.106", "AY.107", "AY.108", "AY.109", "AY.110", "AY.111", "AY.112", "AY.112.1", "AY.112.2",
"AY.113", "AY.114", "AY.115", "AY.116", "AY.116.1", "AY.117", "AY.118", "AY.119", "AY.119.1", "AY.119.2", "AY.120", "AY.120.1", "AY.120.2", "AY.120.2.1", "AY.121", "AY.121.1", "AY.122", "AY.122.1", "AY.122.2", "AY.122.3", "AY.122.4", "AY.122.5", "AY.123", "AY.123.1", "AY.124", "AY.124.1", "AY.124.1.1", "AY.125", "AY.125.1", "AY.126", "AY.127", "AY.127.1", "AY.127.2", "AY.128", "AY.129", "AY.130", "AY.131", "AY.132", "AY.133"
"AY.1", "AY.10", "AY.100", "AY.101", "AY.102", "AY.102.1", "AY.102.2", "AY.103",
"AY.103.1", "AY.103.2", "AY.104", "AY.105", "AY.106", "AY.107", "AY.108", "AY.109",
"AY.11", "AY.110", "AY.111", "AY.112", "AY.112.1", "AY.112.2", "AY.113", "AY.114",
"AY.115", "AY.116", "AY.116.1", "AY.117", "AY.118", "AY.119", "AY.119.1", "AY.119.2",
"AY.12", "AY.120", "AY.120.1", "AY.120.2", "AY.120.2.1", "AY.121", "AY.121.1", "AY.122",
"AY.122.1", "AY.122.2", "AY.122.3", "AY.122.4", "AY.122.5", "AY.123", "AY.123.1", "AY.124",
"AY.124.1", "AY.124.1.1", "AY.125", "AY.125.1", "AY.126", "AY.127", "AY.127.1", "AY.127.2",
"AY.128", "AY.129", "AY.13", "AY.130", "AY.131", "AY.132", "AY.133", "AY.14", "AY.15", "AY.16",
"AY.16.1", "AY.17", "AY.18", "AY.19", "AY.2", "AY.20", "AY.20.1", "AY.21", "AY.22", "AY.23",
"AY.23.1", "AY.23.2", "AY.24", "AY.24.1", "AY.25", "AY.25.1", "AY.25.1.1", "AY.25.1.2", "AY.25.2",
"AY.25.3", "AY.26", "AY.26.1", "AY.27", "AY.28", "AY.29", "AY.29.1", "AY.3", "AY.3.1", "AY.3.2",
"AY.3.3", "AY.3.4", "AY.30", "AY.31", "AY.32", "AY.33", "AY.33.1", "AY.34", "AY.34.1", "AY.34.1.1",
"AY.34.2", "AY.35", "AY.36", "AY.37", "AY.38", "AY.39", "AY.39.1", "AY.39.1.1", "AY.39.1.2", "AY.39.1.3",
"AY.39.2", "AY.39.3", "AY.4", "AY.4.1", "AY.4.10", "AY.4.11", "AY.4.12", "AY.4.13", "AY.4.14", "AY.4.15",
"AY.4.16", "AY.4.17", "AY.4.2", "AY.4.2.1", "AY.4.2.2", "AY.4.2.3", "AY.4.2.4", "AY.4.3", "AY.4.4", "AY.4.5",
"AY.4.6", "AY.4.7", "AY.4.8", "AY.4.9", "AY.40", "AY.41", "AY.42", "AY.42.1", "AY.43", "AY.43.1", "AY.43.2",
"AY.43.3", "AY.43.4", "AY.43.5", "AY.43.6", "AY.43.7", "AY.43.8", "AY.43.9", "AY.44", "AY.45", "AY.46",
"AY.46.1", "AY.46.2", "AY.46.3", "AY.46.4", "AY.46.5", "AY.46.6", "AY.46.6.1", "AY.47", "AY.48", "AY.49",
"AY.5", "AY.5.1", "AY.5.2", "AY.5.3", "AY.5.4", "AY.5.5", "AY.5.6", "AY.50", "AY.51", "AY.52", "AY.53",
"AY.54", "AY.55", "AY.56", "AY.57", "AY.58", "AY.59", "AY.6", "AY.60", "AY.61", "AY.62", "AY.63", "AY.64",
"AY.65", "AY.66", "AY.67", "AY.68", "AY.69", "AY.7", "AY.7.1", "AY.7.2", "AY.70", "AY.71", "AY.72", "AY.73",
"AY.74", "AY.75", "AY.75.1", "AY.75.2", "AY.75.3", "AY.76", "AY.77", "AY.78", "AY.79", "AY.8", "AY.80", "AY.81",
"AY.82", "AY.83", "AY.84", "AY.85", "AY.86", "AY.87", "AY.88", "AY.89", "AY.9", "AY.9.1", "AY.9.2", "AY.9.2.1",
"AY.9.2.2", "AY.90", "AY.91", "AY.91.1", "AY.92", "AY.93", "AY.94", "AY.95", "AY.96", "AY.97", "AY.98", "AY.98.1",
"AY.99", "AY.99.1", "AY.99.2", "B.1.617.2"
)
omicron_voc <- c(
"B.1.1.529", "BA.1", "BA.1.1", "BA.1.1.1", "BA.1.1.10", "BA.1.1.11", "BA.1.1.12", "BA.1.1.13",
"BA.1.1.14", "BA.1.1.15", "BA.1.1.16", "BA.1.1.17", "BA.1.1.2", "BA.1.1.3", "BA.1.1.4", "BA.1.1.5",
"BA.1.1.6", "BA.1.1.7", "BA.1.1.8", "BA.1.1.9", "BA.1.10", "BA.1.11", "BA.1.12", "BA.1.13", "BA.1.13.1",
"BA.1.14", "BA.1.14.1", "BA.1.14.2", "BA.1.15", "BA.1.15.1", "BA.1.15.2", "BA.1.16", "BA.1.16.1", "BA.1.16.2",
"BA.1.17", "BA.1.17.1", "BA.1.17.2", "BA.1.18", "BA.1.19", "BA.1.2", "BA.1.20", "BA.1.21", "BA.1.21.1",
"BA.1.3", "BA.1.4", "BA.1.5", "BA.1.6", "BA.1.7", "BA.1.8", "BA.1.9", "BA.2", "BA.2.1", "BA.2.10", "BA.2.10.1",
"BA.2.11", "BA.2.12", "BA.2.12.1", "BA.2.13", "BA.2.14", "BA.2.15", "BA.2.16", "BA.2.2", "BA.2.3", "BA.2.3.1",
"BA.2.3.2", "BA.2.4", "BA.2.5", "BA.2.6", "BA.2.7", "BA.2.75", "BA.2.75.2", "BA.2.8", "BA.2.9", "BA.2.9.1",
"BA.3", "BA.4", "BA.4", "BA.4.*", "BA.4.6", "BA.5", "BA.5", "BA.5.*", "BA.5.2.1", "BF.7", "BF.7",
"BQ.1", "BQ.1.*", "CH.1.1.*", "EG.5", "EG.5.*",
"XBB", "XBB.1", "XBB.1.16", "XBB.1.16.*", "XBB.1.5", "XBB.1.5.*", "XBB.1.9.1", "XBB.1.9.1.*", "XBB.1.9.2",
"XBB.1.9.2.*"
)
omicron_voc <- c("BA.1.1", "BA.2", "BA.1", "BA.1.17.2", "BA.1.15", "BA.2.9", "BA.1.17", "BA.1.1.1", "BA.1.18", "BA.1.1.2", "BA.2.10", "BA.2.3", "BA.1.15.1", "BA.1.20", "BA.1.1.14", "BA.1.1.15", "BA.1.16", "BA.2.1", "BA.1.14", "BA.1.1.13", "BA.2.12.1", "BA.1.21", "BA.2.8", "BA.1.1.12", "BA.2.10.1", "BA.1.1.11", "BA.1.1.16", "BA.2.12", "BA.1.19", "BA.1.13.1", "BA.1.13", "BA.1.1.10", "BA.1.14.1", "BA.3", "BA.1.12", "BA.2.7", "BA.1.10", "BA.1.15.2", "BA.1.1.4", "BA.2.5", "BA.1.1.9", "BA.2.2", "BA.2.14", "BA.2.6", "BA.1.1.7", "BA.1.1.8", "BA.1.21.1", "BA.2.3.2", "BA.1.8", "BA.1.1.6", "BA.1.7", "BA.1.9", "BA.1.17.1", "BA.1.14.2", "BA.2.3.1", "BA.1.5", "BA.1.1.17", "BA.1.6", "BA.2.16", "BA.1.3", "BA.4", "BA.1.1.3", "BA.1.4", "BA.1.1.5", "BA.2.13", "BA.2.4", "BA.2.9.1", "BA.2.11", "BA.2.15", "BA.5", "BA.1.16.1", "BA.1.2", "BA.1.16.2", "B.1.1.529", "BA.1.11")
lambda_voc <- c("C.37", "C.37.1")
mu_voc <- c("B.1.621", "B.1.621.1", "B.1.621.2", "BB.1", "BB.2")
epsilon_voc <- c("B.1.429", "B.1.427", "B.1.429.1")

eta_voc <- c("B.1.525")
iota_voc <- c("B.1.526")
theta_voc <- c("P.3")
zeta_voc <- c("P.2")

vocs <- list(
alpha = alpha_voc, beta = beta_voc,
gamma = gamma_voc, delta = delta_voc,
omicron = omicron_voc, lambda = lambda_voc,
mu = mu_voc, epsilon = epsilon_voc,
eta = eta_voc, iota = iota_voc
alpha = alpha_voc,
beta = beta_voc,
gamma = gamma_voc,
delta = delta_voc,
omicron = omicron_voc,
B.1 = c("B.1")
# lambda = lambda_voc,
# mu = mu_voc,
# epsilon = epsilon_voc,
# eta = eta_voc,
# iota = iota_voc
)
return(vocs)
}
Expand Down Expand Up @@ -100,27 +153,27 @@ CleanIndianStates <- function(states) {
states <- str_to_title(states)
states <- recode(
.x = states,
`Maharastra` = "Maharashtra",
`Andhra pradesh` = "Andhra Pradesh", Pondicherry = "Puducherry",
`Jammu and Kashmīr` = "Jammu and Kashmir", `Andaman & Nicobar` = "Andaman & Nicobar",
Chhatisgarh = "Chhattisgarh", Jaipur = "Rajasthan", `Dadra and Nagar Haveli` = "Dadra and Nagar Haveli and Daman and Diu",
Harayana = "Haryana", Jammu = "Jammu and Kashmir", `Jammu and kashmir` = "Jammu and Kashmir",
`Jammu & Kashmir` = "Jammu and Kashmir", Maharasthra = "Maharashtra",
`Andaman and Nicobar Islands` = "Andaman & Nicobar",
`Andaman And Nicobar Islands` = "Andaman & Nicobar",
`Dadra And Nagar Haveli` = "Dadra and Nagar Haveli and Daman and Diu",
`Dadra and Nagar Haveli and Daman and Diu` = "Dadra and Nagar Haveli and Daman and Diu",
`Dadra And Nagar Haveli And Daman And Diu` = "Dadra and Nagar Haveli and Daman and Diu",
`Dadra and Nagar Haveli and Daman and Diui` = "Dadra and Nagar Haveli and Daman and Diu",
"Maharastra" = "Maharashtra",
"Andhra pradesh" = "Andhra Pradesh", Pondicherry = "Puducherry",
"Jammu and Kashmīr" = "Jammu and Kashmir", "Andaman & Nicobar" = "Andaman & Nicobar",
Chhatisgarh = "Chhattisgarh", Jaipur = "Rajasthan", "Dadra and Nagar Haveli" = "Dadra and Nagar Haveli and Daman and Diu",
Harayana = "Haryana", Jammu = "Jammu and Kashmir", "Jammu and kashmir" = "Jammu and Kashmir",
"Jammu & Kashmir" = "Jammu and Kashmir", Maharasthra = "Maharashtra",
"Andaman and Nicobar Islands" = "Andaman & Nicobar",
"Andaman And Nicobar Islands" = "Andaman & Nicobar",
"Dadra And Nagar Haveli" = "Dadra and Nagar Haveli and Daman and Diu",
"Dadra and Nagar Haveli and Daman and Diu" = "Dadra and Nagar Haveli and Daman and Diu",
"Dadra And Nagar Haveli And Daman And Diu" = "Dadra and Nagar Haveli and Daman and Diu",
"Dadra and Nagar Haveli and Daman and Diui" = "Dadra and Nagar Haveli and Daman and Diu",
Tamilnadu = "Tamil Nadu",
Maharshtra = "Maharashtra",
`Jammu & kashmīr` = "Jammu and Kashmir",
`Gujrat` = "Gujarat",
`Gujart` = "Gujarat",
`Chandighar` = "Chandigarh",
`Jammu And Kashmir` = "Jammu and Kashmir",
`Jammu And Kashmīr` = "Jammu and Kashmir",
`New Delhi` = "Delhi"
"Jammu & kashmīr" = "Jammu and Kashmir",
"Gujrat" = "Gujarat",
"Gujart" = "Gujarat",
"Chandighar" = "Chandigarh",
"Jammu And Kashmir" = "Jammu and Kashmir",
"Jammu And Kashmīr" = "Jammu and Kashmir",
"New Delhi" = "Delhi"
)
states[states == "Undefined"] <- "Unknown"
states[is.na(states)] <- "Unknown"
Expand All @@ -140,8 +193,8 @@ CleanSouthAfricanStates <- function(states) {
states <- gsub(pattern = " Province", replacement = "", x = states)
states <- recode(
.x = states,
`Kwazulu Natal` = "Kwazulu-Natal",
`Kzn` = "Kwazulu-Natal"
"Kwazulu Natal" = "Kwazulu-Natal",
"Kzn" = "Kwazulu-Natal"
)
states[states == "Undefined"] <- "Unknown"
states[is.na(states)] <- "Unknown"
Expand All @@ -161,8 +214,8 @@ CleanAmericanStates <- function(states) {
states <- str_split_fixed(string = states, pattern = ",", n = 2)[, 1]
states <- recode(
.x = states,
`Virgin Islands Of The U.s.` = "US Virgin Islands",
`Us Virgin Islands` = "US Virgin Islands",
"Virgin Islands Of The U.s." = "US Virgin Islands",
"Us Virgin Islands" = "US Virgin Islands",
)
states[states == "Undefined"] <- "Unknown"
states[is.na(states)] <- "Unknown"
Expand All @@ -181,7 +234,7 @@ CleanCanadaStates <- function(states) {
states <- str_squish(states)
states <- recode(
.x = states,
`Newfoundland` = "Newfoundland and Labrador"
"Newfoundland" = "Newfoundland and Labrador"
)
states[states == "Undefined"] <- "Unknown"
states[is.na(states)] <- "Unknown"
Expand Down Expand Up @@ -276,7 +329,8 @@ CollapseLineageToVOCs <- function(variant_df, vocs = GetVOCs(), custom_voc_mappi
variant_df$lineage_collapsed <- "Others"
for (name in names(vocs)) {
variant_df <- variant_df %>% mutate(lineage_collapsed = case_when(
pangolin_lineage %in% vocs[[!!name]] ~ str_to_title(!!name),
# pangolin_lineage %in% vocs[[!!name]] ~ str_to_title(!!name),
grepl(pattern = vocs[[!!name]], x = pangolin_lineage) ~ str_to_title(!!name),
TRUE ~ lineage_collapsed
))
}
Expand Down
42 changes: 1 addition & 41 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,7 @@ navbar:
left:
- text: "Introduction"
href: articles/Introduction.html
- text: "Variant prevalence"
menu:
- text: "Australia"
href: articles/MultinomialModeling_Australia.html
- text: "Canada"
href: articles/MultinomialModeling_Canada.html
- text: "Germany"
href: articles/MultinomialModeling_Germany.html
- text: "India"
href: articles/MultinomialModeling_India.html
- text: "South Africa"
href: articles/MultinomialModeling_SouthAfrica.html
- text: "United Kingdom"
href: articles/MultinomialModeling_UK.html
- text: "USA"
href: articles/MultinomialModeling_USA.html
- text: "Variantwise cases - Countries"
- text: "Projected varaint-wise cases"
menu:
- text: "Animated prevalence in Germany"
href: articles/VariantAnimation-Germany.html
Expand All @@ -50,30 +34,6 @@ navbar:
href: articles/VariantAnimation-UK.html
- text: "Animated prevalence in USA"
href: articles/VariantAnimation-USA.html
- text: "Variantwise cases - Indian States/Cities"
menu:
- text: "Animated prevalence in Aizawl"
href: articles/VariantAnimation-Aizawal.html
- text: "Animated prevalence in Bengaluru"
href: articles/VariantAnimation-Bengaluru.html
- text: "Animated prevalence in Chennai"
href: articles/VariantAnimation-Chennai.html
- text: "Animated prevalence in Delhi"
href: articles/VariantAnimation-Delhi.html
- text: "Animated prevalence in Jaipur"
href: articles/VariantAnimation-Jaipur.html
- text: "Animated prevalence in Mumbai"
href: articles/VariantAnimation-Mumbai.html
- text: "Animated prevalence in Pune"
href: articles/VariantAnimation-Pune.html
- text: "Animated prevalence in Gujarat"
href: articles/VariantAnimation-Gujarat.html
- text: "Animated prevalence in Maharashtra"
href: articles/VariantAnimation-Maharashtra.html
- text: "Animated prevalence in Telangana"
href: articles/VariantAnimation-Telangana.html
- text: "Animated prevalence in Tamil Nadu"
href: articles/VariantAnimation-Tamilnadu.html
- text: "Reference"
href: reference/index.html
- text: "News"
Expand Down
11 changes: 11 additions & 0 deletions man/FixDate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions vignettes/Introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ p2
While the absolute numbers are informative, a more useful metric is 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:

```{r, fig.width=8, fig.height=5, warning=FALSE}
#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 <- 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"
Expand Down Expand Up @@ -126,7 +126,7 @@ p4 <- PlotSequencedPropHeatmap(india_sequencing_proportion)


```{r, fig.width=11, fig.height=11, warning=FALSE, message=FALSE, echo=FALSE, eval=FALSE}
#In terms of absolute numbers sequenced:
# In terms of absolute numbers sequenced:
seq_stats2 <- seq_stats
# seq_stats2 <- seq_stats2 %>% filter(MonthYear >= "July 2022")
Expand Down
Loading

0 comments on commit e39bf9b

Please sign in to comment.