Skip to content

Code and data for: "Fine-scale patterns of SARS-CoV-2 spread from identical pathogen sequences".

License

Notifications You must be signed in to change notification settings

blab/phylo-kernel-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fine-scale patterns of SARS-CoV-2 spread from identical pathogen sequences

DOI

Cécile Tran-Kiem1, Miguel Paredes1,2, Amanda Perofsky3,4, Lauren Frisbie5, Hong Xie6, Kevin Kong6, Amanda Weixler6, Alexander Geninger1,6, Pavitra Roychoudhury1,6, JohnAric Peterson5, Andrew Delgado5, Holly Halstead5, Drew MacKellar5, Philip Dykema5, Luis Gamboa3, Chris Frazar7, Erica Ryke7, Jeremy Stone3, David Reinhart3, Lea Starita3,7, Allison Thibodeau5, Cory Yun5, Frank Aragona5, Allison Black5, Cécile Viboud4, Trevor Bedford 1,8.

1 Vaccine and Infectious Disease Division, Fred Hutchinson Cancer Center, Seattle, WA, USA
2 Department of Epidemiology, University of Washington, Seattle, WA, USA
3 Brotman Baty Institute, University of Washington, Seattle, WA, USA
4 Fogarty International Center, National Institutes of Health, Bethesda, MD, USA
5 Washington State Department of Health, Shoreline, WA, USA
6 Department of Laboratory Medicine and Pathology, University of Washington, Seattle, WA, USA
7 Department of Genome Sciences, University of Washington, Seattle, WA, USA
8 Howard Hughes Medical Institute, Seattle, WA, USA

Abstract

Pathogen genomics can provide insights into underlying infectious disease transmission patterns, but new methods are needed to handle modern large-scale pathogen genome datasets and realize this full potential. In particular, genetically proximal viruses should be highly informative about transmission events as genetic proximity indicates epidemiological linkage. Here, we leverage pairs of identical sequences to characterise fine-scale transmission patterns using 114,298 SARS-CoV-2 genomes collected through Washington State (USA) genomic sentinel surveillance with associated age and residence location information between March 2021 and December 2022. This corresponds to 59,660 sequences with another identical sequence in the dataset. We find that the location of pairs of identical sequences is highly consistent with expectations from mobility and social contact data. Outliers in the relationship between genetic and mobility data can be explained by SARS-CoV-2 transmission between postal codes with male prisons, consistent with transmission between prison facilities. We find that transmission patterns between age groups vary across spatial scales. Finally, we use the timing of sequence collection to understand the age groups driving transmission. Overall, this work improves our ability to leverage large pathogen genome datasets to understand the determinants of infectious disease spread.

Install

The code is written in R and relies on some packages, which can be installed (a couple hours) using:

Rscript ./scripts/install_requirements.R "scripts/requirements.txt"

The analyses were performed using the following packages versions: ape (5.7-1), broom (1.0.5), colorspace (2.1-0), cowplot (1.1.3), doParallel (1.0.17), foreach (1.5.2), ggpubr (0.6.0), ggrepel (0.9.4), ggsignif (0.6.4), igraph (1.5.1), mgcv (1.9-0), purrr (1.0.2), RColorBrewer (1.1-3), Rcpp (1.0.11), reshape2 (1.4.4), seqinr (4.2-30), sf (1.0-14), spdep (1.2-8), tidyverse (2.0.0), vegan (2.6-4), viridis (0.6.4).

Computing relative risks of observing sequence at a defined genetic distance in two subgroups from user data

To facilitate the application of this method to other datasets, we provide the code developped to compute the relative risk of observing sequences at a defined genetic distance between different subgroups. We illustrate how this may be done starting from an arbitrary FASTA alignment and csv metadata file. The following command takes around 10 seconds to run on an Mac with an M2 Chip.

cd scripts/

## Generate the relative risk of observing sequences at a specified genetic distance. It takes the following arguments:
# --input-fasta: file path to the user-defined FASTA alignment
# --input-metadata: file path to the user-defined metadata file. The metadata should be a csv file with a column "sequence_name" containing the sequence names (matching those found in the alignment) and some associated metadata columns. 
# --name-group: name of the column in the metadata file denoting the groups between which we will generate the relative risk of observing sequences at a given genetic distance.
# --n-mut-away: genetic distance between sequences. 
# --output-file-csv: file path to save the dataframe with the RR of observing sequences

# --compute-subsample-CI: boolean (1 or 0) indicating whether to compute subsampled confidence interval around RR estimates. If not specified, default is 0. 
# --n-subsamples: number of draws used to compute CI. If not specified, default is 1000.
# --prop-subsample: proportion of sequences subsampled in each replicate. If not specified, default is 0.8. 

Rscript ./get_RR_from_fasta.R \
    --input-fasta="../data/synthetic_data/synthetic-fasta.fasta" \
    --input-metadata="../data/synthetic_data/synthetic-metadata.csv" \
    --name-group="group" \
    --n-mut-away=0 \
    --output-file-csv="../results/df_RR.csv" \
    --compute-subsample-CI=1 \
    --n-subsamples=1000 \
    --prop-subsample=0.8

Overview

This repository contains code and data associated with this manuscript. Shapefiles were obtained from the US Census Bureau. To improve readibility and reuse of our code, we have splitted the different analyses in individual scripts with headers indicating which analyses are performed. To facilitate reproduction of our results, here are the relationships between manuscript figures and files used to generated them:

Figure 1

Figure 2

Figure 3

Figure 4

Supplementary figures

Supplementary tables

About

Code and data for: "Fine-scale patterns of SARS-CoV-2 spread from identical pathogen sequences".

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •