Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
snip_warehouse/run.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19 lines (16 sloc)
634 Bytes
This file contains 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
import os | |
from snip_warehouse import SnipLoader | |
from snip_warehouse.schema import init_db | |
DB_NAME = os.environ["SNIP_DB_NAME"] | |
input("Are you sure you want to re-init DB?" | |
"This takes 2-3 hrs per chromosome") | |
init_db(DB_NAME) | |
snip_loader = SnipLoader(DB_NAME) | |
chr_suffixes = [i for i in range(1, 23)] | |
chr_suffixes += ["X", "Y", "MT"] | |
for chr_suffix in chr_suffixes: | |
snip_loader.download_dbsnp_file(f"refsnp-chr{chr_suffix}.json.gz", | |
chr_suffix) | |
snip_loader.load_ref_snps( | |
f"refsnp-chr{chr_suffix}.json.gz", str(chr_suffix)) | |
os.system(f"rm refsnp-chr{chr_suffix}.json") |