Can't download Chocophlan

Hi,

I’m trying to run metaphlan3 for the first time on a computer (I’ve run it successfully on other computers), and am getting this error message:

Downloading 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
Traceback (most recent call last):
File “/apps/metaphlan2/3.0.3/bin/metaphlan”, line 10, in
sys.exit(main())
File “/apps/metaphlan2/3.0.3/lib/python3.8/site-packages/metaphlan/metaphlan.py”, line 913, in main
pars[‘index’] = check_and_install_database(pars[‘index’], pars[‘bowtie2db’], pars[‘bowtie2_build’], pars[‘nproc’], pars[‘force_download’])
File “/apps/metaphlan2/3.0.3/lib/python3.8/site-packages/metaphlan/init.py”, line 281, in check_and_install_database
index = resolve_latest_database(bowtie2_db, ls_f[‘mpa_latest’], force_redownload_latest)
UnboundLocalError: local variable ‘ls_f’ referenced before assignment
[dianataft@c24a-s23 seqkit_nosruber]$ metaphlan cat_trimmed/3000828988.R1.fastq,cat_trimmed/3000828988.R2.fastq --bowtie2out metaphlan_bowtie/3000828988.bowtie2.bz2 --input_type fastq -o 3000828988.metagenome.txt --bowtie2db /blue/dianataft/databases2/

Downloading 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
Traceback (most recent call last):
File “/apps/metaphlan2/3.0.3/bin/metaphlan”, line 10, in
sys.exit(main())
File “/apps/metaphlan2/3.0.3/lib/python3.8/site-packages/metaphlan/metaphlan.py”, line 913, in main
pars[‘index’] = check_and_install_database(pars[‘index’], pars[‘bowtie2db’], pars[‘bowtie2_build’], pars[‘nproc’], pars[‘force_download’])
File “/apps/metaphlan2/3.0.3/lib/python3.8/site-packages/metaphlan/init.py”, line 281, in check_and_install_database
index = resolve_latest_database(bowtie2_db, ls_f[‘mpa_latest’], force_redownload_latest)
UnboundLocalError: local variable ‘ls_f’ referenced before assignment

I also went to the metaphlan github page, as I remembered there was a link to the database there, and thought I could just download it directly myself. Unfortunately, I got a file not found error message following the link from the github page. Where can I access the database?

Thanks!

Hello! I think I am getting an error that could be related to the same issue. I am running metaphlan3 on a big server, and never had issues before, but since this week I keep on getting errors that the directory for the databases isn’t writeable (it never was, and was never an issue before). I tried getting around this by creating a conda env and having my own version of metaphlan3 run there, but here I get the same error as the original poster

Warning: Unable to download https://www.dropbox.com/sh/7qze7m7g9fe2xjg/AAA4XDP85WHon_eHvztxkamTa/file_list.txt?dl=1
Traceback (most recent call last):
File “/home/naomi/.conda/envs/metaphlan-3.0/bin/metaphlan”, line 10, in
sys.exit(main())
File “/home/naomi/.conda/envs/metaphlan-3.0/lib/python3.7/site-packages/metaphlan/metaphlan.py”, line 913, in main
pars[‘index’] = check_and_install_database(pars[‘index’], pars[‘bowtie2db’], pars[‘bowtie2_build’], pars[‘nproc’], pars[‘force_download’])
File “/home/naomi/.conda/envs/metaphlan-3.0/lib/python3.7/site-packages/metaphlan/init.py”, line 281, in check_and_install_database
index = resolve_latest_database(bowtie2_db, ls_f[‘mpa_latest’], force_redownload_latest)
UnboundLocalError: local variable ‘ls_f’ referenced before assignment

Any suggestions on how to get metaphlan running?

Hi @naomiomics and @willowblade
Thanks for getting in touch. The Dropbox download is not available anymore, instead, in the last version of the tool (available in conda), MetaPhlAn will download the database from the following link: http://cmprod1.cibio.unitn.it/biobakery3/metaphlan_databases/mpa_latest

Thank you for this! What should we do if we are using a shared computational cluster and must individual download the database prior to running metaphlan? I tried following this link, but there didn’t seem to be a way to download the database from the link.

Upgrading the version of MetaPhlAn in the shared cluster will fix the error. Which is the version you are currently using (you can check it by executing metaphlan --version)

No, I understand that, but at least in the older versions the download would try and happen automatically and would throw an error because the default directory was for a location that users could not access. The cluster does not allow for installation of shared databases, it’s the responsibility of users to download and maintain databases. With the old version, I’d download the file directly from the dropbox, put it in a known location and call the database by full filepath when running metaphlan. I’ve checked the tutorial and the user manual, but both are still sending me to the old dropbox.

I see. In that case, you can find the files here:
https://cmprod1.cibio.unitn.it/biobakery3/metaphlan_databases/mpa_v30_CHOCOPhlAn_201901.tar
https://cmprod1.cibio.unitn.it/biobakery3/metaphlan_databases/mpa_v30_CHOCOPhlAn_201901.md5

Thank you! This is exactly what I was looking for!

Hi, Turns out even with the directly downloaded database, metaphlan3 keeps trying to download a new version from the website. Is there a way to force metaphlan3 not to check for updates? I even got the cluster to install the database in a folder for us to use, and update it with the last version of metaphlan3, but it’s still trying to install a new version everytime and we don’t have read/write permission to the folder where the cluster support placed the database. Thanks again.

Hi @willowblade
MetaPhlAn will try to download the database if it doesn’t find the 6 bowtie2db files (*.bt2) and the .pkl file in the --bowtie2db folder. After download the database, have you uncompressed the tar file, then uncompressed the fna file, and finally built the bowtie2 database with the bowtie2-build command?

Best,
Aitor

Yes, I had all of those files. But it keeps deciding that what I’ve got isn’t the latest version (even when I just downloaded it) and trying to redownload.

Hi @willowblade
Sorry, but there is not an option for metaphlan3 in order not to check for updates. However, if metaphlan is retrying to download the database is because it has no access to the database files. If you are pointing the script with the --bowtie2db parameter to the correct folder containing the database and adding the --index mpa_v30_CHOCOPhlAn_201901 and it is still not working, it might be that it metaphlan has no permission to read the files. Could this be the problem?