EBI-Metagenomics / emg-toolkit

MGnify API toolkit
https://www.ebi.ac.uk/metagenomics
Apache License 2.0
21 stars 4 forks source link

error running example #8

Closed snayfach closed 4 years ago

snayfach commented 4 years ago

Trouble running the listed example:


$ conda create -n py3.6 python=3.6

$ conda activate py3.6

$ pip install -U mg-toolkit

$ mg-toolkit original_metadata -a ERP001736
Traceback (most recent call last):
  File "/anaconda2/envs/py3.6/bin/mg-toolkit", line 8, in <module>
    sys.exit(main())
  File "/anaconda2/envs/py3.6/lib/python3.6/site-packages/mg_toolkit/__init__.py", line 198, in main
    return getattr(mg_toolkit, args.tool)(args)
  File "/anaconda2/envs/py3.6/lib/python3.6/site-packages/mg_toolkit/metadata.py", line 46, in original_metadata
    om.save_to_csv(om.fetch_metadata())
  File "/anaconda2/envs/py3.6/lib/python3.6/site-packages/mg_toolkit/metadata.py", line 106, in fetch_metadata
    _meta = self.get_metadata(sample['sample_accession'])
  File "/anaconda2/envs/py3.6/lib/python3.6/site-packages/mg_toolkit/metadata.py", line 71, in get_metadata
    for m in x['ROOT']['SAMPLE']['SAMPLE_ATTRIBUTES']['SAMPLE_ATTRIBUTE']:
KeyError: 'ROOT'
mberacochea commented 4 years ago

There is a new version available that fixes this problem, v0.7.0. Thank you for reporting the bug.