https://github.com/murrellgroup/vocfreq
https://github.com/murrellgroup/vocfreq
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/murrellgroup/vocfreq
- Owner: MurrellGroup
- License: mit
- Created: 2021-03-28T22:29:03.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-11T18:31:37.000Z (almost 5 years ago)
- Last Synced: 2025-07-26T20:57:20.703Z (12 months ago)
- Language: Jupyter Notebook
- Size: 5.63 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Locally-Weighted Multinomial Regression for SARS-CoV-2 Variant Frequency Estimation
This repository houses two Julia Jupyter notebooks that were used to plot SARS-CoV-2 variant frequency maps in Sheward et al, 2021. To use these notebooks, you'll need a working Julia installation, you'll need to install the packages used at the top of each notebook, and you'll need to download an appropriate metadata file from gisaid.org. The GISAID terms of use prevent us from distributing GISAID data with this code.
The code works by first pre-processing the GISAID data, filtering records with missing information, and collapsing non-VoC lineages up the Pango lineage hierarchy until a minimum lineage size threshold is met. Lineage counts are then aggregated daily for each country, and a multinomial regression is estimated (penalized, using GLMNet) to "nowcast" the variant frequencies for the requested dates. An entirely global multinomial regression fits the data surprisingly well, suggesting that the relative rates of variant replacement are quite stable, but to avoid issues with temporal changes in these parameters we weight the observations around the target date using a radial basis function, so that the fit is local. Note: this is not the same as inferring locally constant frequencies, which would perform very poorly. We find good performance with a relatively large RBF bandwidth, which is especially helpful when data is sparse, as is the case in many countries.