An open API service indexing awesome lists of open source software.

https://github.com/murrellgroup/vocfreq


https://github.com/murrellgroup/vocfreq

Last synced: 26 days ago
JSON representation

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.