# Issue with Unable to download metaphlan\_debases

**URL:** <https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929>\
**Category:** MetaPhlAn\
**Created:** [August 28, 2020, 7:14am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929 "2020-08-28T07:14:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [August 28, 2020, 7:14am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/1 "2020-08-28T07:14:16Z")

</div>

hi  
I’m trying to use Metaphlan2 to look at the microbiome abundance in several samples, but when I try to run them I get the following error ,at first ,I use command: metaphlan2.py /pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_1.fastq,/pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_2.fastq --bowtie2out SRR7828865.bowtie2.bz2 --nproc 4 --input\_type fastq \> profiled\_SRR7828865.txt

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

Downloading [https://www.dropbox.com/sh/7qze7m7g9fe2xjg/AAA4XDP85WHon\_eHvztxkamTa/file\_list.txt?dl=1](https://www.dropbox.com/sh/7qze7m7g9fe2xjg/AAA4XDP85WHon_eHvztxkamTa/file_list.txt?dl=1)  
Warning: Unable to download [https://www.dropbox.com/sh/7qze7m7g9fe2xjg/AAA4XDP85WHon\_eHvztxkamTa/file\_list.txt?dl=1](https://www.dropbox.com/sh/7qze7m7g9fe2xjg/AAA4XDP85WHon_eHvztxkamTa/file_list.txt?dl=1)  
Traceback (most recent call last):  
File “/pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan2.py”, line 1580, in   
metaphlan2()  
File “/pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan2.py”, line 1373, in metaphlan2  
check\_and\_install\_database(pars[‘index’], pars[‘bowtie2db’], pars[‘bowtie2\_build’], pars[‘nproc’], pars[‘offline’])  
File “/pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan2.py”, line 842, in check\_and\_install\_database  
download\_unpack\_tar(FILE\_LIST, index, bowtie2\_db, bowtie2\_build, nproc)  
File “/pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan2.py”, line 749, in download\_unpack\_tar  
url\_tar\_file = ls\_f[“mpa\_” + download\_file\_name + “.tar”]  
UnboundLocalError: local variable ‘ls\_f’ referenced before assignment

it may cannot access to dropbox,then I have downloaded databases manually,and use caommand:  
metaphlan2.py /pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_1.fastq,/pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_2.fastq --bowtie2\_exe /pub/yuanjian/lsd/Biosoft/bowtie -x /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/mpa\_v20\_m200 --bowtie2db /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/ --bowtie2out SRR7828865.bowtie2.bz2 --nproc 4 --input\_type fastq \> profiled\_SRR7828865.txt  
then:  
Downloading MetaPhlAn2 database  
Please note due to the size this might take a few minutes  
File /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/file\_list.txt already present!  
Traceback (most recent call last):  
File “/pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan2.py”, line 1580, in   
metaphlan2()  
File “/pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan2.py”, line 1373, in metaphlan2  
check\_and\_install\_database(pars[‘index’], pars[‘bowtie2db’], pars[‘bowtie2\_build’], pars[‘nproc’], pars[‘offline’])  
File “/pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan2.py”, line 842, in check\_and\_install\_database  
download\_unpack\_tar(FILE\_LIST, index, bowtie2\_db, bowtie2\_build, nproc)  
File “/pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan2.py”, line 749, in download\_unpack\_tar  
url\_tar\_file = ls\_f[“mpa\_” + download\_file\_name + “.tar”]  
KeyError: ‘mpa\_/pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/mpa\_v20\_m200.tar’  
Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 28, 2020, 7:43am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/2 "2020-08-28T07:43:18Z")

</div>

Have you built the bowtie2 indexes from mpa\_v20\_m200.fna?

---

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [August 28, 2020, 8:20am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/3 "2020-08-28T08:20:26Z")

</div>

hi, fbeghini,  
I have built the bowtie2 indexes from mpa\_v20\_m200.fna：  
yuanjian@localhost:/pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases$ bowtie2-build --threads 4 mpa\_v20\_m200.fna mpa\_v20\_m200

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 28, 2020, 8:34am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/4 "2020-08-28T08:34:59Z")

</div>

I’ve added the `--offline` flag in order to avoid downloading the database, also if you specify `-x mpa_v20_m200` it should not download anything and just use the manually built database. Have you tried using these parameters?

---

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [August 28, 2020, 9:09am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/5 "2020-08-28T09:09:35Z")

</div>

I add the parameters --offline and the command is metaphlan2.py /pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_1.fastq,/pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_2.fastq --offline --bowtie2\_exe /pub/yuanjian/lsd/Biosoft/bowtie -x /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/mpa\_v20\_m200 --bowtie2db /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/ --bowtie2out SRR7828865.bowtie2.bz2 --nproc 4 --input\_type fastq \> profiled\_SRR7828865.txt  
then ,it shows as following:  
Warning! Biom python library not detected!  
Exporting to biom format will not work!  
No database files found in /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/. Exiting.

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 28, 2020, 9:29am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/6 "2020-08-28T09:29:05Z")

</div>

Can you post the output of `ls -l /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan_databases/MetaPhlAn_databases` ?

---

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [August 28, 2020, 9:34am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/7 "2020-08-28T09:34:04Z")

</div>

![2184721983bceb79a6d239924701a28](https://canada1.discourse-cdn.com/flex027/uploads/biobakery/original/1X/39f7f7a29d07c397816c0b0a33a2111dab7484e1.png)

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 28, 2020, 2:28pm UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/8 "2020-08-28T14:28:12Z")

</div>

> [@suedan](#):
>
> -x /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/mpa\_v20\_m200

You should use only `-x mpa_v20_m200`, `-x` specifies the name of the database located under `--bowtie2db`

---

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [August 28, 2020, 2:36pm UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/9 "2020-08-28T14:36:02Z")

</div>

hi，fbeghini  
I have tried what you adviced,and the command is metaphlan2.py /pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_1.fastq,/pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_2.fastq --offline --bowtie2\_exe /pub/yuanjian/lsd/Biosoft/bowtie -x mpa\_v20\_m200 --bowtie2db /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/ --bowtie2out SRR7828865.bowtie2.bz2 --nproc 4 --input\_type fastq \> profiled\_SRR7828865.txt ,but it shows the same error:  
Warning! Biom python library not detected!  
Exporting to biom format will not work!  
No database files found in /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/. Exiting.  
😭

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 28, 2020, 3:01pm UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/10 "2020-08-28T15:01:55Z")

</div>

My bad, sorry, I thought you were using MetaPhlan3. You need to specify just `v20_m200` with `-x`

---

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [August 29, 2020, 3:48am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/11 "2020-08-29T03:48:27Z")

</div>

yeah,I am using MetaPhlan2,version 2.8.1,and I do specify just just `v20_m200` with `-x`:metaphlan2.py /pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_1.fastq,/pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_2.fastq --offline --bowtie2\_exe /pub/yuanjian/lsd/Biosoft/bowtie -x /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/mpa\_v20\_m200 --bowtie2out SRR7828865.bowtie2.bz2 --nproc 4 --input\_type fastq \> profiled\_SRR7828865.txt  
And it still shows like this :  
Warning! Biom python library not detected!  
Exporting to biom format will not work!  
No database files found in /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases. Exiting.  
I do not know what is wrong with it.

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 31, 2020, 7:35am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/12 "2020-08-31T07:35:59Z")

</div>

The command you used is wrong, as I mentioned you in the previous post, `-x` stores **only** the database name and not the path of the directory containing it. The correct command line is

```auto
metaphlan2.py 
/pub/yuanjian/lsd/Biosoft/bowtie/alignment_out/unaligned_fq/SRR7828865_unaligned_R_1.fastq,/pub/yuanjian/lsd/Biosoft/bowtie/alignment_out/unaligned_fq/SRR7828865_unaligned_R_2.fastq 
--offline --bowtie2_exe /pub/yuanjian/lsd/Biosoft/bowtie 
-x v20_m200 
--bowtie2db /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan_databases/MetaPhlAn_databases 
--bowtie2out SRR7828865.bowtie2.bz2 
--nproc 4 --input_type fastq > profiled_SRR7828865.txt

```

---

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [August 31, 2020, 7:55am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/13 "2020-08-31T07:55:26Z")

</div>

hi,fbeghini  
Sorry to bother you again ,I have tried the command you suggested, then it shows the new error:

Traceback (most recent call last):  
File “/pub/yuanjian/lsd/Biosoft/metaphlan/utils/read\_fastx.py”, line 9, in   
from Bio import SeqIO  
ModuleNotFoundError: No module named ‘Bio’  
OSError: fatal error running ‘/pub/yuanjian/lsd/Biosoft/metaphlan/utils/read\_fastx.py’. Is it in the system path?  
The error showed before when used command line:  
metaphlan2.py /pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_1.fastq,/pub/yuanjian/lsd/Biosoft/bowtie/alignment\_out/unaligned\_fq/SRR7828865\_unaligned\_R\_2.fastq --bowtie2\_exe /pub/yuanjian/lsd/Biosoft/bowtie --bowtie2db /pub/yuanjian/lsd/Biosoft/metaphlan/metaphlan\_databases/MetaPhlAn\_databases/ --bowtie2out SRR7828865.bowtie2.bz2 --nproc 4 --input\_type fastq \> profiled\_SRR7828865.txt

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 31, 2020, 8:12am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/14 "2020-08-31T08:12:52Z")

</div>

How MetaPhlAn was installed? Have you installed all the dependencies?  
The command line used is correct but the program fails to run since biopython is missing and `read_fastx.py` (an utility script used to parse the metagenome) is not found in the path.

---

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [August 31, 2020, 9:13am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/15 "2020-08-31T09:13:41Z")

</div>

Sorry,I forgot the way that installed MetaPhlAn2,maybe by **cloning the repository** using the following command:`$ git clone https://github.com/biobakery/metaphlan`  
I have installed biopython just now and rerun the command ,but go wrong with bowtie2,like this:OSError: “[Errno 13] Permission denied: ‘/pub/yuanjian/lsd/Biosoft/bowtie’”  
Fatal error running BowTie2. Is BowTie2 in the system path?  
Bowtie2 is already in the path:bowtie2: /pub/yuanjian/lsd/Biosoft/bowtie/bowtie2-2.4.1-linux-x86\_64/bowtie2

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [August 31, 2020, 9:39am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/16 "2020-08-31T09:39:21Z")

</div>

If the folder is not present in `echo $PATH` you can tell MetaPhlAn to use that executable by using the `--bowtie2_exe` parameter.

---

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [August 31, 2020, 10:46am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/17 "2020-08-31T10:46:45Z")

</div>

Thank you so much!!! The problem has been solved.It works!!!

---

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [September 28, 2020, 2:56am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/18 "2020-09-28T02:56:29Z")

</div>

hi fbeghini  
Sorry to bother you again.  
Now I meet a new problem,and how can I solve the problem above when I used humann2 to analyse metagenome functional profile.Beacause I see it would run metaphlan2.py automatically first !  
Looking forward to your reply!  
[813dfa28ad6493fbcbc24cc817df40b|690x166](https://forum.biobakery.org/uploads/short-url/qsHx4r0mDjPYn0S3SW3tLgCwsBu.png)

---

<div class="post-metadata">

**Author:** ![fbeghini](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/fbeghini/32/81_2.png) [@fbeghini](https://forum.biobakery.org/u/fbeghini)\
**Post date:** [September 28, 2020, 8:09am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/19 "2020-09-28T08:09:06Z")

</div>

The first step run by HUMAnN2 is MetaPhlAn2 in order to detect the species profilable. In order to use it from HUMAnN ou need to update your MetaPhlAn2 install and install the latest build (2.8.1) from GitHub and run HUMAnN2 with the option `--metaphlan-options "--offline"`. If you already have the MetaPhlAn2 profile for the sample, you can use the HUMAnN2’s `--taxonomic-profile <path to MetaPhlAn2 profile>` option.

---

<div class="post-metadata">

**Author:** ![suedan](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@suedan](https://forum.biobakery.org/u/suedan)\
**Post date:** [September 29, 2020, 1:41am UTC](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929/20 "2020-09-29T01:41:13Z")

</div>

Thank you so much ,I will have a try!

[Next page](https://forum.biobakery.org/t/issue-with-unable-to-download-metaphlan-debases/929.md?page=2)
