d6b6234e8be94844c6bea9f7d2ca73226dcd0c70 max Tue Sep 3 11:31:25 2024 -0700 small otto fix for panelapp, no redmine, monthly otto email diff --git src/hg/utils/otto/panelApp/genes.py src/hg/utils/otto/panelApp/genes.py index 003ab9e..b99245d 100755 --- src/hg/utils/otto/panelApp/genes.py +++ src/hg/utils/otto/panelApp/genes.py @@ -88,41 +88,43 @@ repeat19 = list() repeat38 = list() continuous_count = 0 genes_missing_info = list() genes_no_location = list() syms = getGeneSymbols() for sym in syms: url = "https://panelapp.genomicsengland.co.uk/api/v1/genes/{}?format=json".format(sym) count = 0 while True: try: myResponse = requests.get(url) + if myResponse.ok: break + else: + logging.error("Some error on %s, retrying after 1 minute (trial %d)" % (url, count)) + time.sleep(60) + except: logging.error("HTTP error on %s, retrying after 1 minute (trial %d)" % (url, count)) time.sleep(60) count += 1 if count > 10: assert(False) # cannot get URL - if not (myResponse.ok): - assert(False) - jsonData = myResponse.content #jData = myResponse.json() jData = json.loads(jsonData.decode()) jsonFh.write(jsonData) jsonFh.write("\n".encode()) res = jData['results'] num_gene_variant = len(res) count = 0 while count != num_gene_variant: temp_attribute_dictionary = dict() string_dict_key = 'gene_{}'.format(continuous_count) gene_range_37 = None