Created
May 12, 2020 18:16
-
-
Save collinarnett/2d21fa4cee3262f6114d78d1b73429e7 to your computer and use it in GitHub Desktop.
Download Code for Protein GAN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from urllib import request | |
from tqdm import tqdm | |
test_folder = Path("test") | |
train_folder = Path("train") | |
test_list = Path('test_ids.txt').read_text().splitlines() | |
train_list = Path('train_ids.txt').read_text().splitlines() | |
test_folder.mkdir(exist_ok=True) | |
train_folder.mkdir(exist_ok=True) | |
for ids in tqdm(test_list): | |
p = test_folder / f'{ids}.pdb' | |
if not p.exists(): | |
request.urlretrieve(f"http://files.rcsb.org/download/{ids}.pdb", p) | |
for ids in tqdm(train_list): | |
p = train_folder / f'{ids}.pdb' | |
if not p.exists(): | |
request.urlretrieve(f"http://files.rcsb.org/download/{ids}.pdb", p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment