Mercurial > repos > scottx611x > data_manager_fetch_gene_annotation
changeset 16:9002c2f64e2a draft
Uploaded
author | scottx611x |
---|---|
date | Wed, 22 Jun 2016 16:35:28 -0400 |
parents | 6261b513ae1b |
children | 57b716eee99f |
files | data_manager_gene_annotation/data_manager/data_manager.py |
diffstat | 1 files changed, 2 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/data_manager_gene_annotation/data_manager/data_manager.py Wed Jun 22 16:25:38 2016 -0400 +++ b/data_manager_gene_annotation/data_manager/data_manager.py Wed Jun 22 16:35:28 2016 -0400 @@ -30,14 +30,11 @@ def url_download(url, name, workdir): - # Create path if it doesn't exist - if not os.path.exists(workdir): - os.makedirs(workdir) response = requests.get(url=url, stream=True) # Create path that we will write the file to - file_path = os.path.join(workdir, 'download_{}.dat'.format(name)) + file_path = 'download_{}.dat'.format(name) block_size = 10 * 1024 * 1024 # 10MB chunked download with open(file_path, 'w+') as f: @@ -56,7 +53,7 @@ workdir = os.path.join(os.getcwd(), 'gene_annotation') # Attempt to download gene annotation file from given url - gene_annotation_file_path = url_download(args.url, args.name, workdir) + gene_annotation_file_path = url_download("http://www.scott-ouellette.com/gene_annotations/chr1-hg19_genes.gtf", args.name, workdir) # Update Data Manager Json and write out data_manager_entry = { @@ -65,7 +62,6 @@ 'date': str(datetime.datetime.now()), 'dbkey': str(args.name), 'name': str(args.name), - 'path': gene_annotation_file_path, } } }