Hello when I was trying to follow the installation tutorial and I realized that I couldn’t install the database properly.
(metaphlan-3.0) Cheng.Clay.Li@ChengdeMacBook-Pro decon % metaphlan --install --index mpa_v30_CHOCOPhlAn_201901 --bowtie2db /Users/Cheng.Clay.Li/Metatools/bowtie2db
Downloading MetaPhlAn database
Please note due to the size this might take a few minutes
Downloading http://cmprod1.cibio.unitn.it/biobakery3/metaphlan_databases/mpa_v30_CHOCOPhlAn_201901.tar
Downloading file of size: 366.62 MB
366.62 MB 100.00 % 4.35 MB/sec 0 min -0 sec
Downloading http://cmprod1.cibio.unitn.it/biobakery3/metaphlan_databases/mpa_v30_CHOCOPhlAn_201901.md5
Downloading file of size: 0.00 MB
0.01 MB 12800.00 % 32.80 MB/sec 0 min -0 sec
Decompressing /Users/Cheng.Clay.Li/Metatools/bowtie2db/mpa_v30_CHOCOPhlAn_201901.fna.bz2 into /Users/Cheng.Clay.Li/Metatools/bowtie2db/mpa_v30_CHOCOPhlAn_201901.fna
Traceback (most recent call last):
File “/Users/Cheng.Clay.Li/opt/anaconda3/envs/metaphlan-3.0/bin/metaphlan”, line 10, in
sys.exit(main())
File “/Users/Cheng.Clay.Li/opt/anaconda3/envs/metaphlan-3.0/lib/python3.7/site-packages/metaphlan/metaphlan.py”, line 985, in main
pars[‘index’] = check_and_install_database(pars[‘index’], pars[‘bowtie2db’], pars[‘bowtie2_build’], pars[‘nproc’], pars[‘force_download’])
File “/Users/Cheng.Clay.Li/opt/anaconda3/envs/metaphlan-3.0/lib/python3.7/site-packages/metaphlan/init .py”, line 304, in check_and_install_database
download_unpack_tar(index, bowtie2_db, bowtie2_build, nproc, use_zenodo)
File “/Users/Cheng.Clay.Li/opt/anaconda3/envs/metaphlan-3.0/lib/python3.7/site-packages/metaphlan/init .py”, line 180, in download_unpack_tar
bt2_build_output = subp.check_output([bowtie2_build, ‘–usage’], stderr=subp.STDOUT)
File “/Users/Cheng.Clay.Li/opt/anaconda3/envs/metaphlan-3.0/lib/python3.7/subprocess.py”, line 411, in check_output
**kwargs).stdout
File “/Users/Cheng.Clay.Li/opt/anaconda3/envs/metaphlan-3.0/lib/python3.7/subprocess.py”, line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘bowtie2-build’, ‘–usage’]’ returned non-zero exit status 250.
appear to be similar with the problem in an older thread.
opened 08:42PM - 17 Jun 20 UTC
closed 03:45PM - 10 Dec 20 UTC
After installing metaphlan 3.0, and activating its conda environment, I ran:
… `
metaphlan --install
`
This produces the following error:
```
File /tigress/MOLBIO/local/pythonenv/metaphlan3/lib/python3.6/site-packages/metaphlan/metaphlan_databases/file_list.txt already present!
Traceback (most recent call last):
File "/tigress/MOLBIO/local/pythonenv/metaphlan3/bin/metaphlan", line 10, in <module>
sys.exit(main())
File "/tigress/MOLBIO/local/pythonenv/metaphlan3/lib/python3.6/site-packages/metaphlan/metaphlan.py", line 1187, in main
pars['index'] = check_and_install_database(pars['index'], pars['bowtie2db'], pars['bowtie2_build'], pars['nproc'], pars['force_download'])
File "/tigress/MOLBIO/local/pythonenv/metaphlan3/lib/python3.6/site-packages/metaphlan/metaphlan.py", line 610, in check_and_install_database
download_unpack_tar(FILE_LIST, index, bowtie2_db, bowtie2_build, nproc)
File "/tigress/MOLBIO/local/pythonenv/metaphlan3/lib/python3.6/site-packages/metaphlan/metaphlan.py", line 463, in download_unpack_tar
url_tar_file = ls_f["mpa_" + download_file_name + ".tar"]
KeyError: 'mpa_mpa_v30_CHOCOPhlAn_201901.tar'
```
Metaphlan was installed like this:
```
conda create -p /path/to/our/conda/envs/metaphlan3 -c bioconda metaphlan
```
The problem appears to be that in metaphlan.py, "mpa_" is getting prepended to the database names when they are used as keys in the ls_f dictionary. Removing these extra "mpa_" strings seems to solve the problem, like so:
```
diff metaphlan.py-orig metaphlan.py
462,463c462,463
< tar_file = os.path.join(folder, "mpa_" + download_file_name + ".tar")
< url_tar_file = ls_f["mpa_" + download_file_name + ".tar"]
---
> tar_file = os.path.join(folder, download_file_name + ".tar")
> url_tar_file = ls_f[download_file_name + ".tar"]
467,468c467,468
< md5_file = os.path.join(folder, "mpa_" + download_file_name + ".md5")
< url_md5_file = ls_f["mpa_" + download_file_name + ".md5"]
---
> md5_file = os.path.join(folder, download_file_name + ".md5")
> url_md5_file = ls_f[download_file_name + ".md5"]
```
The "file_list.txt already present" message appears not to be the real problem.
Best,
Matthew Cahn
I reinstalled my mpa according to
opened 04:26PM - 24 Jun 20 UTC
closed 01:34PM - 25 Jun 20 UTC
Hello
I'm trying to install metaphlan2 with the following commands
conda cre… ate --name mpa -c bioconda metaphlan
conda activate mpa
metaphlan --install
Then, I got the following errors
Downloading https://www.dropbox.com/sh/7qze7m7g9fe2xjg/AAA4XDP85WHon_eHvztxkamTa/file_list.txt?dl=1
Downloading file of size: 0.00 MB
0.01 MB 232.33 % 11.95 MB/sec 0 min -0 sec
Downloading https://www.dropbox.com/sh/7qze7m7g9fe2xjg/AAAyoJpOgcjop41VIHAGWIVLa/mpa_latest?dl=1
Downloading file of size: 0.00 MB
0.01 MB 31507.69 % 16.79 MB/sec 0 min -0 sec
Downloading MetaPhlAn database
Please note due to the size this might take a few minutes
File /nv/hp10/kim45/.conda/envs/mpa/lib/python3.6/site-packages/metaphlan/metaphlan_databases/file_list.txt already present!
Traceback (most recent call last):
File "/nv/hp10/kim45/.conda/envs/mpa/bin/metaphlan", line 10, in <module>
sys.exit(main())
File "/nv/hp10/kim45/.conda/envs/mpa/lib/python3.6/site-packages/metaphlan/metaphlan.py", line 1187, in main
pars['index'] = check_and_install_database(pars['index'], pars['bowtie2db'], pars['bowtie2_build'], pars['nproc'], pars['force_download'])
File "/nv/hp10/kim45/.conda/envs/mpa/lib/python3.6/site-packages/metaphlan/metaphlan.py", line 610, in check_and_install_database
download_unpack_tar(FILE_LIST, index, bowtie2_db, bowtie2_build, nproc)
File "/nv/hp10/kim45/.conda/envs/mpa/lib/python3.6/site-packages/metaphlan/metaphlan.py", line 463, in download_unpack_tar
url_tar_file = ls_f["mpa_" + download_file_name + ".tar"]
KeyError: 'mpa_mpa_v30_CHOCOPhlAn_201901.tar'
Please help me with this
Thanks
Minjae
but the problem still exists.
Many thanks.
Cheng