Skip to content

blab/phylo-kernel-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fine-scale spatial and social patterns of SARS-CoV-2 transmission from identical pathogen sequences

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

Install

The code is written in R and relies on some packages, which can be installed using:

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

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.

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 . 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=100 \
    --prop-subsample=0.8

Overview

This repository contains code and data associated with the above manuscript.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published