biobakery / MetaPhlAn

MetaPhlAn is a computational tool for profiling the composition of microbial communities from metagenomic shotgun sequencing data
http://segatalab.cibio.unitn.it/tools/metaphlan/index.html
MIT License
304 stars 86 forks source link

Location of mpa_v20_m200.pkl #13

Closed fbeghini closed 6 years ago

fbeghini commented 6 years ago

Original report by Clifford Beall (Bitbucket: cliffbeall, GitHub: cliffbeall).


I installed metaphlan/strainphlan from source and was running the tutorial. With the strainphlan command as in the tutorial I get:

#!python

$ strainphlan.py --ifn_samples *.markers --output_dir . --print_clades_only --nprocs_main 8 > clades.txt
2018-05-15 15:27:51,184 | INFO | __main__ | strainer | 1330 | Load mpa_pkl
Traceback (most recent call last):
  File "/home/leyslab/biobakery-metaphlan2-f27c42a7fbf1/strainphlan.py", line 1541, in <module>
    strainphlan()
  File "/home/leyslab/biobakery-metaphlan2-f27c42a7fbf1/strainphlan.py", line 1537, in strainphlan
    strainer(args)
  File "/home/leyslab/biobakery-metaphlan2-f27c42a7fbf1/strainphlan.py", line 1331, in strainer
    db = pickle.load(bz2.BZ2File(args['mpa_pkl']))
IOError: [Errno 2] No such file or directory: '/home/leyslab/biobakery-metaphlan2-f27c42a7fbf1/db_v20/mpa_v20_m200.pkl'

If I run the following, it works as expected:

#!python

strainphlan.py --ifn_samples *.markers --output_dir . --print_clades_only --nprocs_main 8 --mpa_pkl /home/leyslab/biobakery-metaphlan2-f27c42a7fbf1/databases/mpa_v20_m200.pkl > clades.txt

So the location of the mpa_v20_m200.pkl file is in a subdirectory (databases) different from where strainphlan is looking due to it's default argument (db_v20). It seems like this is something that got changed in metaphlan and needs to be updated in strainphlan?

fbeghini commented 6 years ago

Original comment by Clifford Beall (Bitbucket: cliffbeall, GitHub: cliffbeall).


Sorry, after posting this, I realized there are two versions of the tutorial - the one I was following here:

https://bitbucket.org/biobakery/biobakery/wiki/strainphlan

and a correct one here:

https://bitbucket.org/biobakery/metaphlan2#markdown-header-metagenomic-strain-level-population-genomics

fbeghini commented 6 years ago

Original comment by Francesco Asnicar (Bitbucket: francesco-asnicar, ).


Hi Clifford,

We recently also fixed few things in StrainPhlAn so that we should have solved the problem you encountered. We will update the tutorials soon to make them consistent with the latest addition in MetaPhlAn/StrainPhlAn.

Many thanks, Francesco