Skip to content

Commit

Permalink
make zenodo ID more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstenwagner committed Oct 13, 2023
1 parent 161bb72 commit e5ace7f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions missense/missense.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,17 @@ def download_missense_data():
'''
alphafile=os.path.join(tempfile.gettempdir(), "alpha.tsv")
if not os.path.exists(alphafile):
url = "https://zenodo.org/record/8208688/files/AlphaMissense_aa_substitutions.tsv.gz?download=1/"
print("Find zenodo record ID ...", end=" ", flush=True)
url_doi = "https://doi.org/10.5281/zenodo.8360242"
r = requests.get(url_doi)
record_id = r.url.split('/')[-1]
print(f"{record_id}")
url = f"https://zenodo.org/records/{record_id}/files/AlphaMissense_aa_substitutions.tsv.gz?download=1"
filename = os.path.join(tempfile.gettempdir(), "alpha.tsv.gz")
print("Download to", filename, " ...")
print(f"Download {url} to {filename} ...", end=" ", flush=True)
urlretrieve(url, filename)
print("Download done!")
print("Decompress...")
print("done!")
print("Decompress...", end=" ", flush=True)
with gzip.open(filename,'r') as f_in, open(alphafile, 'wb') as f_out:
shutil.copyfileobj(f_in,f_out)
print("Done: ", alphafile)
Expand Down

0 comments on commit e5ace7f

Please sign in to comment.