saketkc / pysradb

Package for fetching metadata and downloading data from SRA/ENA/GEO
https://saketkc.github.io/pysradb
BSD 3-Clause "New" or "Revised" License
307 stars 50 forks source link

[BUG] keyError: 'RUN' #168

Closed Thanakron1997 closed 1 year ago

Thanakron1997 commented 1 year ago

When I running this command:

pysradb metadata PRJNA186035 --detailed --expand --desc  --assay --saveto <output_path>

and it give this error

Traceback (most recent call last):
  File "/home/va/anaconda3/bin/pysradb", line 10, in <module>
    sys.exit(parse_args())
  File "/home/va/anaconda3/lib/python3.9/site-packages/pysradb/cli.py", line 1202, in parse_args
    metadata(
  File "/home/va/anaconda3/lib/python3.9/site-packages/pysradb/cli.py", line 79, in metadata
    df = sradb.sra_metadata(
  File "/home/va/anaconda3/lib/python3.9/site-packages/pysradb/sraweb.py", line 562, in sra_metadata
    run_sets = record["RUN_SET"]["RUN"]
KeyError: 'RUN

Desktop (please complete the following information):

Try in colab image

saketkc commented 1 year ago

Thanks for the bug report and a heavy case example. I have pushed a fix in https://github.com/saketkc/pysradb/commit/b84aca2390ebc3ccc3f6a47aaffefb8a2f1a6f93. Can you try your example after re-installing pysradb from Github?

pip install git+https://github.com/saketkc/pysradb@develop
Thanakron1997 commented 1 year ago

That work for me. Thank you!