############################################################################################################################################# * ### Study: G2 respiratory viruses ### ### Title: Respiratory Virus Shedding in Exhaled Breath and Efficacy of Face Masks ### ### ### Script title: Master script ### ### Institute: School of Public Health, The University of Hong Kong ### ### Author: Nancy Leung ### ### Date: 2020-03-14 ### ### Note: ### ### - These are the scripts to reproduce tables and figures in the article: ### ### -- Leung NHL, Chu DKW, Shiu EYC et al. Respiratory Virus Shedding in Exhaled Breath and Efficacy of Face Masks. Nat Med. (2020) ### ############################################################################################################################################# * # R version ------------------------------------------------------------------------ #### version$version.string # [1] "R version 3.6.0 (2019-04-26)" # Libraries ------------------------------------------------------------------------ #### library(openxlsx) library(lubridate) library(tidyverse) # Data ---------------------------------------------------------------------------- #### sdata <- read.csv('G2resp_data_200324.csv', stringsAsFactors = F) # Data dictionary ---------------------------------------------------------------- #### dict <- read.csv('G2resp_dictionary_200324.csv', stringsAsFactors = F) # Generic functions ------------------------------------------------------------ #### # specify_decimal #### specify_decimal <- function(value, dp){ x <- format(round(value, dp), nsmall = dp) x1 <- gsub(' ', '', x) as.numeric(x1) } # List of objects in the master script ------------------------------------------ #### seed_num.master <- 123 # seed number for jitter etc. master.objects <- c('master.objects', ls()) # to store generic functions applicable to all sub-scripts # Scripts ---------------------------------------------------------------------- #### # Transform viral load data source('G2resp_01_Viral_shedding_transformation_200324.R') # Extended Data Figure 2 source('G2resp_02_Weekly_number_of_respiratory_virus_infections_200324.R') # Extended Data Figure 3 source('G2resp_03_Respiratory_virus_shedding_200324.R') # Table 1a, Supplementary Table 1 source('G2resp_04_Patient_characteristics_200324.R') # Figure 1, Extended Data Figure 4, Extended Data Figure 5, Extended Data Figure 9 # Table 1b, Supplementary Table 2, Supplementary Table 3 source('G2resp_05_Efficacy_of_surgical_face_masks_200324.R') # Extended Data Figure 6, Extended Data Figure 7, Extended Data Figure 8 source('G2resp_06_Correlation_of_respiratory_viral_shedding_between_samples_200324.R') # Supplementary Table 4, Supplementary Table 5, Supplementary Table 6 source('G2resp_07_Factors_associated_with_respiratory_viral_shedding_200324.R') ####### End of script #######