Metadata-Version: 2.4
Name: freyja
Version: 2025.post9
Summary: Freyja recovers relative lineage abundances from mixed SARS-CoV-2 samples
Home-page: https://github.com/joshuailevy/freyja
Author: Joshua Levy
Author-email: jolevy@scripps.edu
License: BSD 2-Clause
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: cvxpy
Requires-Dist: seaborn
Requires-Dist: pysam
Requires-Dist: biopython
Requires-Dist: sphinx
Requires-Dist: sphinx_rtd_theme
Requires-Dist: sphinx-click @ git+https://github.com/dylanpilz/sphinx-click.git
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# Freyja
[![freyja CI](https://github.com/andersen-lab/Freyja/actions/workflows/python-package-conda.yml/badge.svg)](https://github.com/andersen-lab/Freyja/actions/workflows/python-package-conda.yml) [![Anaconda-Server Badge](https://anaconda.org/bioconda/freyja/badges/version.svg)](https://anaconda.org/bioconda/freyja) ![docs](https://github.com/andersen-lab/Freyja/actions/workflows/update_docs.yml/badge.svg)

Detailed documentation, including installation, usage, and examples can be found [here](https://andersen-lab.github.io/Freyja/index.html#).

Freyja is a tool to recover relative lineage abundances from mixed SARS-CoV-2 samples from a sequencing dataset (BAM aligned to the Hu-1 reference). The method uses  lineage-determining mutational "barcodes" derived from the UShER global phylogenetic tree as a basis set to solve the constrained (unit sum, non-negative) de-mixing problem. 

Freyja is intended as a post-processing step after primer trimming and variant calling in [iVar (Grubaugh and Gangavaparu et al., 2019)](https://github.com/andersen-lab/ivar). From measurements of SNV freqency and sequencing depth at each position in the genome, Freyja returns an estimate of the true lineage abundances in the sample.

To ensure reproducibility of results, we provide old (timestamped) barcodes and metadata in the separate [Freyja-data](https://github.com/andersen-lab/Freyja-data) repository. Barcode version can be checked using the `freyja demix --version` command.

NOTE: Freyja barcodes are now stored in compressed feather format, as the initial csv barcode file became too large. Specific lineage definitions are now provided in [here](https://github.com/andersen-lab/Freyja/blob/main/freyja/data/lineage_mutations.json). 

## Installation via conda
Freyja is entirely written in Python 3, but requires preprocessing by tools like iVar and [samtools](https://github.com/samtools/samtools) mpileup to generate the required input data. We recommend using python3.11 to take advantage of the Clarabel solver, but Freyja has been tested on python versions from 3.7 to 3.11.  First, create an environment for freyja
```
conda create -n freyja-env
```
then add the following channels
```
conda config --add channels bioconda
conda config --add channels conda-forge
```
and then install freyja
```
conda install freyja
```
