-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjetson_check.py
More file actions
22 lines (19 loc) · 860 Bytes
/
Copy pathjetson_check.py
File metadata and controls
22 lines (19 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import requests
from pathlib import Path
from config_template import CLINVAR_DIR, GENCODE_DIR, PHARMGKB_DIR
def download_file(url: str, dest: Path):
if dest.exists():
print(f"[SKIP] {dest.name}")
return
with requests.get(url, stream=True, timeout=120) as r:
r.raise_for_status()
with open(dest, "wb") as f:
for chunk in r.iter_content(chunk_size=1024 * 1024):
if chunk:
f.write(chunk)
print(f"[DONE] {dest}")
def main():
download_file("https://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh38/clinvar.vcf.gz", CLINVAR_DIR / "clinvar_GRCh38.vcf.gz")
download_file("https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_49/gencode.v49.basic.annotation.gtf.gz", GENCODE_DIR / "gencode.v49.basic.annotation.gtf.gz")
if __name__ == "__main__":
main()