helxplatform / dug

Semantic Search
MIT License
32 stars 10 forks source link

Add generic dbGaP downloader #283

Closed gaurav closed 1 year ago

gaurav commented 1 year ago

This PR adds a script, bin/get_dbgap_data_dicts.py, which can be used to download all the dbGaP identifiers from a CSV or TSV file into a specified directory. It is based on bin/get_ncpi_data_dicts.py, but is much more configurable.

There is an unknown bug which you can replicate by trying to download phs000285.v3.p2 or phs000007.v32.p13. Since we need this functionality for BDC ingest, I'm inclined to merge this PR and open an issue for that bug to be debugged later, but I'm happy to try to fix it in this PR first if that is preferable.

You can test this by running:

$ python bin/get_dbgap_data_dicts.py data/ncpi-dataset-catalog-results.tsv --field "Study Accession" --group-by Platform --outdir data/ncpi-dataset-catalog --skip phs000285.v3.p2 --skip phs000007.v32.p1