Skip to content

Commit

Permalink
Adds Freyja version 1.5.0 (#923)
Browse files Browse the repository at this point in the history
* updates to 1.5.0 and adds latest tag

* adding freyja version 1.5.0

* added up-to-date database information
  • Loading branch information
erinyoung authored Mar 21, 2024
1 parent 435bdec commit 92bff2f
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 44 deletions.
53 changes: 10 additions & 43 deletions .github/workflows/update_freyja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,14 @@ run-name: Updating Freyja
jobs:
update:
runs-on: ubuntu-latest
steps:

# Keeping here in case we want to use it to keep Freyja's version up-to-date as well
# - name: Get latest release
# uses: rez0n/actions-github-release@main
# id: latest_release
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# repository: andersen-lab/Freyja
# type: "stable"
# - name: Remove V
# id: strip
# run: |
# version=$(echo "${{ steps.latest_release.outputs.release }}" | sed 's/V//g' | sed 's/v//g' )
# echo "The version is $version"
# echo "version=$version" >> $GITHUB_OUTPUT

steps:
- name: pull repo
uses: actions/checkout@v4

# Keeping here in case we want to figure out why this doesn't work
# - name: get latest version of freyja in docker-builds repo
# id: latest_version
# run: |
# file=$(git log -1 --name-only --format=%cd --date=iso freyja/*/Dockerfile | grep Dockerfile | head -n 1 )
# echo "the latest file is $file"
# echo "file=$file" >> $GITHUB_OUTPUT
#
# version=$(echo $file | cut -f 2 -d "/" | cut -f 1 -d "_")
# echo "the latest version is $version"
# echo "version=$version" >> $GITHUB_OUTPUT
uses: actions/checkout@v4

- name: set freyja version
id: latest_version
run: |
version=1.4.9
version=1.5.0
echo "version=$version" >> $GITHUB_OUTPUT
file=freyja/$version/Dockerfile
Expand Down Expand Up @@ -100,23 +72,18 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Build and push user-defined tag to DockerHub
id: docker_build_user_defined_tag
uses: docker/build-push-action@v5
with:
file: ${{ steps.latest_version.outputs.file }}
target: app
push: true
tags: staphb/freyja:${{ steps.latest_version.outputs.version }}-${{ steps.db_version.outputs.version }}-${{ steps.date.outputs.date }}

- name: Build and push to Quay
id: build
- name: Build and push Dockerfile
id: docker_build_and_push
uses: docker/build-push-action@v5
with:
file: ${{ steps.latest_version.outputs.file }}
target: app
push: true
tags: quay.io/staphb/freyja:${{ steps.latest_version.outputs.version }}-${{ steps.db_version.outputs.version }}-${{ steps.date.outputs.date }}
tags: |
staphb/freyja:${{ steps.latest_version.outputs.version }}-${{ steps.db_version.outputs.version }}-${{ steps.date.outputs.date }}
staphb/freyja:latest
quay.io/staphb/freyja:${{ steps.latest_version.outputs.version }}-${{ steps.db_version.outputs.version }}-${{ steps.date.outputs.date }}
quay.io/staphb/freyja:latest
- name: Image digest
run: echo ${{ steps.docker_build_user_defined_tag.outputs.digest }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ To learn more about the docker pull rate limits and the open source software pro
| [Filtlong](https://hub.docker.com/r/staphb/filtlong) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/filtlong)](https://hub.docker.com/r/staphb/filtlong) | <ul><li>0.2.0</li><li>0.2.1</li></ul> | https://github.com/rrwick/filtlong |
| [FLASH](https://hub.docker.com/r/staphb/flash) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/flash)](https://hub.docker.com/r/staphb/flash) | <ul><li>1.2.11</li></ul> | http://ccb.jhu.edu/software/FLASH |
| [Flye](https://hub.docker.com/r/staphb/flye) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/flye)](https://hub.docker.com/r/staphb/flye) | <ul><li>[2.5](flye/2.5/)</li><li>[2.7](flye/2.7/)</li><li>[2.8](flye/2.8/)</li><li>[2.9](flye/2.9/)</li><li>[2.9.1](flye/2.9.1/)</li><li>[2.9.2](flye/2.9.2/)</li><li>[2.9.3](flye/2.9.3/)</li></ul> | https://github.com/fenderglass/Flye |
| [Freyja](https://hub.docker.com/r/staphb/freyja) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/freyja)](https://hub.docker.com/r/staphb/freyja) | <ul><li>1.2</li><li>1.2.1</li><li>1.3.1</li><li>1.3.2</li><li>1.3.4</li><li>1.3.7</li><li>1.3.8</li><li>1.3.9</li><li>1.3.10</li><li>1.3.11</li><li>1.3.12</li><li>1.4.2</li><li>[1.4.3](freyja/1.4.3/)</li><li>[1.4.4](freyja/1.4.4/)</li><li>[1.4.5](freyja/1.4.5/)</li><li>[1.4.7](freyja/1.4.7/)</li><li>[1.4.8](freyja/1.4.8/)</li><li>[1.4.9](freyja/1.4.9/)</li></ul> | https://github.com/andersen-lab/Freyja |
| [Freyja](https://hub.docker.com/r/staphb/freyja) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/freyja)](https://hub.docker.com/r/staphb/freyja) | <ul><li>[1.2](./freyja/1.2/)</li><li>[1.2.1](./freyja/1.2.1/)</li><li>[1.3.1](./freyja/1.3.1/)</li><li>[1.3.2](./freyja/1.3.2/)</li><li>[1.3.4](./freyja/1.3.4/)</li><li>[1.3.7](./freyja/1.3.7/)</li><li>[1.3.8](./freyja/1.3.8/)</li><li>[1.3.9](./freyja/1.3.9/)</li><li>[1.3.10](./freyja/1.3.10/)</li><li>[1.3.11](./freyja/1.3.11/)</li><li>[1.3.12](./freyja/1.3.12/)</li><li>[1.4.2](./freyja/1.4.2/)</li><li>[1.4.3](freyja/1.4.3/)</li><li>[1.4.4](freyja/1.4.4/)</li><li>[1.4.5](freyja/1.4.5/)</li><li>[1.4.7](freyja/1.4.7/)</li><li>[1.4.8](freyja/1.4.8/)</li><li>[1.4.9](freyja/1.4.9/)</li><li>[1.5.0](freyja/1.5.0/)</li></ul> | https://github.com/andersen-lab/Freyja |
| [GAMBIT](https://hub.docker.com/r/staphb/gambit) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/gambit)](https://hub.docker.com/r/staphb/gambit) | <ul><li>0.3.0</li><li>0.4.0</li><li>0.5.0</li><li>1.0.0</li></ul> | https://github.com/jlumpe/gambit |
| [GAMMA](https://hub.docker.com/r/staphb/gamma) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/gamma)](https://hub.docker.com/r/staphb/gamma) | <ul><li>1.4</li><li>2.1</li><li>2.2</li></ul> | https://github.com/rastanton/GAMMA/ |
| [geNomad](https://hub.docker.com/r/staphb/genomad) <br/> [![docker pulls](https://badgen.net/docker/pulls/staphb/genomad)](https://hub.docker.com/r/staphb/genomad) | <ul><li>[1.7.4](./genomad/1.7.4/)</li></ul> | https://github.com/apcamargo/genomad |
Expand Down
74 changes: 74 additions & 0 deletions freyja/1.5.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
FROM mambaorg/micromamba:1.5.6 as app

# Version arguments
# ARG variables only persist during build time
ARG FREYJA_SOFTWARE_VERSION="1.5.0"

# build and run as root users since micromamba image has 'mambauser' set as the $USER
USER root
# set workdir to default for building; set to /data at the end
WORKDIR /

LABEL base.image="mambaorg/micromamba:1.5.6"
LABEL dockerfile.version="1"
LABEL software="Freyja"
LABEL software.version=${FREYJA_SOFTWARE_VERSION}
LABEL description="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)"
LABEL website="https://github.com/andersen-lab/Freyja"
LABEL license="https://github.com/andersen-lab/Freyja/blob/main/LICENSE"
LABEL maintainer="Kevin Libuit"
LABEL maintainer.email="[email protected]"
LABEL maintainer2="Curtis Kapsak"
LABEL maintainer2.email="[email protected]"
LABEL maintainer3="Erin Young"
LABEL maintainer3.email="[email protected]"

# install dependencies; cleanup apt garbage
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
ca-certificates \
procps && \
apt-get autoclean && rm -rf /var/lib/apt/lists/*

# Create Freyja conda environment called freyja-env from bioconda recipe
# clean up conda garbage
RUN micromamba create -n freyja-env -c conda-forge -c bioconda -c defaults freyja=${FREYJA_SOFTWARE_VERSION} && \
micromamba clean -a -y

# set the environment, put new conda env in PATH by default
ENV PATH="/opt/conda/envs/freyja-env/bin:/opt/conda/envs/env/bin:${PATH}" \
LC_ALL=C.UTF-8

# update barcodes
# NOTE: this will download the latest version of the `freyja/data/usher_barcodes.csv` file from GitHub
RUN freyja update

# set working directory to /data
WORKDIR /data

# default command is to pull up help options
CMD [ "freyja", "--help" ]

# new base for testing
FROM app as test

RUN freyja --help && freyja --version

# Grab test data from Freyja version 1.3.4
RUN wget -O /data/Freyja_WWSC2.bam https://github.com/StaPH-B/docker-builds/blob/master/freyja/1.3.4/tests/Freyja_WWSC2.bam?raw=true && \
wget -P /data https://raw.githubusercontent.com/StaPH-B/docker-builds/master/freyja/1.3.4/tests/Freyja_depths.tsv && \
wget -P /data https://raw.githubusercontent.com/StaPH-B/docker-builds/master/freyja/1.3.4/tests/Freyja_variants.tsv && \
wget -P /data https://raw.githubusercontent.com/StaPH-B/docker-builds/master/freyja/1.3.4/tests/nCoV-2019.reference.fasta

# Run Freyja
RUN freyja variants /data/Freyja_WWSC2.bam --variants /data/test_variants.tsv --depths /data/test_depths.tsv --ref /data/nCoV-2019.reference.fasta && \
freyja demix /data/test_variants.tsv /data/test_depths.tsv --output /data/test_demix.tsv

# Check validity of outputs
RUN head /data/test_variants.tsv && \
head /data/test_depths.tsv && \
head /data/test_demix.tsv && \
grep "Omicron" /data/test_demix.tsv

# print barcode version and freyja version
RUN freyja demix --version
36 changes: 36 additions & 0 deletions freyja/1.5.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# freyja container

Main tool & documentation: [freyja](https://github.com/andersen-lab/Freyja)

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.

## Additional tools

- biopython 1.82
- ivar 1.4.2
- mafft 7.520
- matplotlib-base 3.8.2
- pandas 2.1.4
- samtools 1.19
- scipy 1.11.4
- seaborn 0.12.2
- ucsc-fatovcf 448
- usher 0.6.3

## freyja barcodes

This docker image was built on **2024-03-20** and the command `freyja update` is run as part of the build to retrieve the most up-to-date barcode file `freyja/data/usher_barcodes.csv` file from Freyja's GitHub repo. The barcode version included in this docker image is **`03_20_2024-00-43`** as reported by `freyja demix --version`

This image is rebuilt every day on Dockerhub and Quay.io with the tag ${freyja version}-${freyja database version}-${data image was deployed}.

## Example Usage

```bash
# run freyja variants to call variants from an aligned SC2 bam file
freyja variants [bamfile] --variants [variant outfile name] --depths [depths outfile name] --ref [reference.fa]

# run freyja demix to identify lineages based on called variants
freyja demix [variants-file] [depth-file] --output [output-file]
```

Warning: `freyja update` does not work under all conditions. You may need to specify an output directory (`freyja update --outdir /path/to/outdir`) for which your user has write privileges, such as a mounted volume.

0 comments on commit 92bff2f

Please sign in to comment.