MetaPhlAn2 Database location in docker container

105 views
Skip to first unread message

Andrew Lang

unread,
Nov 21, 2019, 12:51:58 PM11/21/19
to MetaPhlAn-users


Hi all, 

I’m trying to run MetaPhlAn2 from the docker container, though I am having a hard time locating the DB within the container. I cannot install the DB within the container (obviously) using 


metaplhan2.py --install


as that yields


Downloading MetaPhlAn2 database
Please note due to the size this might take a few minutes
ERROR: Unable to create folder for database install: /opt/conda/bin/metaphlan_databases


Is there not a DB already installed within the container? If not, for those using docker/singularity, how are you getting around this? I'm developing a pipeline for deployment on VMs for multiple users, and I would like this to be as lightweight as possible (i.e. only require docker/singularity installed- not conda as well)


Thanks

Andrew Lang

unread,
Nov 21, 2019, 2:04:25 PM11/21/19
to MetaPhlAn-users
I should add that I am using v2.7.7, build from biobakery/metaphlan2:2.7.7

Francesco Beghini

unread,
Nov 26, 2019, 5:51:25 AM11/26/19
to Andrew Lang, MetaPhlAn-users
Hi Andrew,
you can download the v20_m200 database from here(https://bitbucket.org/biobakery/metaphlan2/downloads/mpa_v20_m200.tar) and build the bowtie2 index from the FASTA file. Then you can provide to MetaPhlAn2 using --bowtie2db and --index the location of the database and its name (--index v20_m200).


Francesco Beghini
PhD Student - Laboratory of Computational Metagenomics
Department of Cellular, Computational and Integrative Biology - CIBIO
University of Trento


--
You received this message because you are subscribed to the Google Groups "MetaPhlAn-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metaphlan-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/metaphlan-users/fcc57a87-18fa-4c8a-9b32-c970a15b1985%40googlegroups.com.

Andrew Lang

unread,
Nov 26, 2019, 3:00:43 PM11/26/19
to Francesco Beghini, MetaPhlAn-users
Thanks Francesco, 

I really would like to have a "all in one" container that has both the software and the DB. I'm in the midst of writing a dockerfile for this, but the install step continues to get hung up.  Dockerfile is as follows

RUN apt-get update && apt-get install -y wget python3 bzip2 && \
    wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-4.7.12-Linux-x86_64.sh -O ~/miniconda.sh && \
    /bin/bash ~/miniconda.sh -b -p /opt/conda && \
    rm ~/miniconda.sh && \
    ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
    echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
    echo "conda activate base" >> ~/.bashrc

RUN echo "" && \
    echo "Adding channels to conda" && \
    echo "" && \
    /opt/conda/bin/conda config --add channels defaults && \
    /opt/conda/bin/conda config --add channels bioconda && \
    /opt/conda/bin/conda config --add channels conda-forge && \
    /opt/conda/bin/conda config --add channels biobakery

RUN echo "" && \
    echo "INSTALLING METAPHLAN2" && \
    echo "" && \
    /opt/conda/bin/conda install -c bioconda/label/cf201901 metaphlan2

ENV PATH="/opt/conda/bin:${PATH}"

RUN echo "" && \
    echo "INSTALLING METAPHLAN2 DATABASE" && \
    metaphlan2.py --install

Things run smoothly until the metaphlan2.py --install step and then it continues to get hung here:

Step 7/8 : RUN echo "" &&     echo "INSTALLING METAPHLAN2 DATABASE" &&     metaphlan2.py --install
 ---> Running in f878ede92eae

INSTALLING METAPHLAN2 DATABASE

Downloading https://bitbucket.org/biobakery/metaphlan2/downloads/mpa_latest
Downloading file of size: 0.00 MB
0.01 MB 30340.74 %   5.76 MB/sec  0 min -0 sec

Downloading MetaPhlAn2 database
Please note due to the size this might take a few minutes

Downloading https://bitbucket.org/biobakery/metaphlan2/downloads/mpa_v295_CHOCOPhlAn_201901.tar
Downloading file of size: 371.51 MB
370.66 MB 99.77 %  29.84 MB/sec  0 min  0 sec

Any thoughts as to why the --install method won't complete from within a container? 

-Andrew
Reply all
Reply to author
Forward
0 new messages