Skip to content

Instantly share code, notes, and snippets.

@Juke34
Last active November 19, 2024 10:05
Show Gist options
  • Save Juke34/b24f39013b54d7037f81a24f65fcd87e to your computer and use it in GitHub Desktop.
Save Juke34/b24f39013b54d7037f81a24f65fcd87e to your computer and use it in GitHub Desktop.
Anvio8 docker image for M1/M2/M3...

Create Dockerfile

Create a file called anvio_dockerfile and copy paste the following in it and save:

FROM condaforge/miniforge3:24.7.1-2

RUN conda create -y --name anvio-dev python=3.10

RUN conda install -y -c conda-forge -c bioconda python=3.10 \
        sqlite prodigal idba mcl muscle=3.8.1551 famsa hmmer diamond \
        blast megahit spades bowtie2 bwa graphviz "samtools>=1.9" \
        trimal iqtree trnascan-se fasttree vmatch r-base r-tidyverse \
        r-optparse r-stringi r-magrittr bioconductor-qvalue meme ghostscript \
        nodejs

RUN conda install -y -c bioconda fastani

RUN conda install -y -c conda-forge -c bioconda datrie

RUN curl -L https://github.com/merenlab/anvio/releases/download/v8/anvio-8.tar.gz \
        --output anvio-8.tar.gz

RUN pip install anvio-8.tar.gz

# --- To setup db ---
# to setup SCG taxonomy data using GTDB genomes.
RUN anvi-setup-scg-taxonomy 
# to setup NCBI’s COG database for quick annotation of genes with functions,
RUN anvi-setup-ncbi-cogs 
# find the database of KEGG orthologs ready when you need it.
RUN anvi-setup-kegg-data
RUN anvi-estimate-metabolism
RUN anvi-reaction-network 

EXPOSE 8080

Build compatible container

docker buildx build --platform linux/amd64 -t anvio8 -f anvio_dockerfile .

run container

check the id of your container with docker image ls then use this ID to run:

docker run -p 8080:8080 -it idContainer

execute the test:

anvi-self-test --suite mini

At the end of the test you should be able to access the server at http://localhost:8080/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment