diff options
author | Pjotr Prins | 2021-01-05 12:29:41 +0000 |
---|---|---|
committer | Pjotr Prins | 2021-01-05 12:29:41 +0000 |
commit | 2ceeccd5e5158362548b868390e9d411f73cd9ff (patch) | |
tree | 09edabf46941ca304c96d95b3b418f78fa649bec /workflows/tools | |
parent | 1187fa716cacde2b50566b67b5d619b8f12894f9 (diff) | |
download | bh20-seq-resource-2ceeccd5e5158362548b868390e9d411f73cd9ff.tar.gz bh20-seq-resource-2ceeccd5e5158362548b868390e9d411f73cd9ff.tar.lz bh20-seq-resource-2ceeccd5e5158362548b868390e9d411f73cd9ff.zip |
fetch: do a straight dump of the original record
Diffstat (limited to 'workflows/tools')
-rwxr-xr-x | workflows/tools/pubseq-fetch-data.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/workflows/tools/pubseq-fetch-data.py b/workflows/tools/pubseq-fetch-data.py index c22d754..3f5e6cf 100755 --- a/workflows/tools/pubseq-fetch-data.py +++ b/workflows/tools/pubseq-fetch-data.py @@ -28,14 +28,13 @@ if (len(ids)==0): with open(args.ids) as f: ids = [ l.strip() for l in f.readlines() ] -for id in ids[0:2]: +for id in ids: print(id) r = requests.get(f"http://covid19.genenetwork.org/api/sample/{id}.json") if r: m_url = r.json()[0]['metadata'] mr = requests.get(m_url) - meta = mr.json() with open(dir+"/"+id+".json","w") as outf: - json.dump(meta, outf, indent=4) + outf.write(mr.text) else: raise Exception(f"Can not find record for {id}") |