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: '@url' #161

Closed Maarten-vd-Sande closed 2 years ago

Maarten-vd-Sande commented 2 years ago

executing

import pysradb

sample = "DRR138929"

db_sra = pysradb.SRAweb()
db_sra.sra_metadata([sample], detailed=True)

leads to

Traceback (most recent call last):
  File "/home/sande/Desktop/seq2science/pysradb_script.py", line 6, in <module>
    db_sra.sra_metadata([sample], detailed=True)
  File "/home/sande/anaconda3/envs/pysradb/lib/python3.9/site-packages/pysradb/sraweb.py", line 581, in sra_metadata
    detailed_record["sra_url"] = sra_files["@url"]
KeyError: '@url'

A couple of weeks ago this worked fine for this sample. Not sure if related but it seems like the sample cannot be downloaded on AWS anymore, https://trace.ncbi.nlm.nih.gov/Traces/sra/?run=DRR138929. Other samples from this project don't have this problem.. Idk if the data is being migrated or something?

saketkc commented 2 years ago

Thanks, I can confirm this is a bug, but is arising from upstream changes. Will have a fix soon

Maarten-vd-Sande commented 2 years ago

Any clue what is being changed? Should I be worried that I won't be able to download from url anymore? :stuck_out_tongue:

saketkc commented 2 years ago

This should be fixed in v1.4 - NCBI is moving everything to the cloud (GCP/AWS) so some SRA cloud links are no longer available.

Maarten-vd-Sande commented 2 years ago

:zap: Thanks for the fast replies and fix!!! :zap: Awesome