Mercurial > repos > jjohnson > ensembl_cdna_translate
comparison ensembl_cdna_translate.py @ 2:b7f2f5e3390c draft
Uploaded
author | jjohnson |
---|---|
date | Wed, 29 Nov 2017 16:33:02 -0500 |
parents | a8218b11216f |
children | d59e3ce10e74 |
comparison
equal
deleted
inserted
replaced
1:0f70b1b92161 | 2:b7f2f5e3390c |
---|---|
27 ext = "/info/assembly/homo_sapiens?" | 27 ext = "/info/assembly/homo_sapiens?" |
28 max_region = 5000000 | 28 max_region = 5000000 |
29 | 29 |
30 | 30 |
31 def ensembl_rest(ext, headers): | 31 def ensembl_rest(ext, headers): |
32 if True: print >> sys.stderr, "%s" % ext | 32 # if True: print >> sys.stderr, "%s" % ext |
33 r = requests.get(server+ext, headers=headers) | 33 r = requests.get(server+ext, headers=headers) |
34 if r.status_code == 429: | 34 if r.status_code == 429: |
35 print >> sys.stderr, "response headers: %s\n" % r.headers | 35 print >> sys.stderr, "response headers: %s\n" % r.headers |
36 if 'Retry-After' in r.headers: | 36 if 'Retry-After' in r.headers: |
37 sleep(r.headers['Retry-After']) | 37 sleep(r.headers['Retry-After']) |