Previous changeset 5:5e2877685afc (2018-01-31) Next changeset 7:edc721c9c418 (2018-01-31) |
Commit message:
Uploaded 20180131 |
modified:
query.py |
added:
._.shed.yml ._example.tsv ._query.py ._query.xml |
b |
diff -r 5e2877685afc -r 97dd57f81d77 ._.shed.yml |
b |
Binary file ._.shed.yml has changed |
b |
diff -r 5e2877685afc -r 97dd57f81d77 ._example.tsv |
b |
Binary file ._example.tsv has changed |
b |
diff -r 5e2877685afc -r 97dd57f81d77 ._query.py |
b |
Binary file ._query.py has changed |
b |
diff -r 5e2877685afc -r 97dd57f81d77 ._query.xml |
b |
Binary file ._query.xml has changed |
b |
diff -r 5e2877685afc -r 97dd57f81d77 query.py --- a/query.py Wed Jan 31 11:29:01 2018 -0500 +++ b/query.py Wed Jan 31 15:58:36 2018 -0500 |
[ |
@@ -12,6 +12,9 @@ query_url = service_url+"tree/0/query"; status_url = service_url+"status/<task_id>"; ############## +# query delay in seconds +query_delay = 30; +############## def query_request( options, args, payload ): # add additional parameters to the payload @@ -27,7 +30,7 @@ # make a synchronous post request to the query route req = session.post(query_url, headers=headers, json=payload); resp_code = req.status_code; - #print(str(req.content)+"\n\n"); + print(str(req.content)+"\n\n"); if resp_code == requests.codes.ok: resp_content = str(req.content); # convert out to json @@ -45,7 +48,7 @@ status_query_url = status_url.replace("<task_id>", task_id); status_req = session.get(status_query_url); status_resp_content = str(status_req.content); - #print(status_resp_content+"\n\n"); + print(status_resp_content+"\n\n"); # convert out to json json_status_content = json.loads(status_resp_content); # take a look at the state @@ -56,7 +59,7 @@ elif json_status_content['state'] in ['FAILURE', 'REVOKED']: return "Task status: "+str(json_status_content['state']); else: - time.sleep(60); # in seconds + time.sleep(query_delay); # in seconds # get output dir (collection) path output_dir_path = options.outputdir; @@ -102,7 +105,7 @@ return "Error: the id '"+seq_id+"' is duplicated"; multiple_data[seq_id] = seq_text; if len(multiple_data) > 0: - return async_request( options, args, multiple_data ); + return query_request( options, args, multiple_data ); #return echo( options, args ); else: return "An error has occurred. Please be sure that your input files are valid."; @@ -126,7 +129,7 @@ return "Error: the id '"+seq_id+"' is duplicated"; multiple_data[seq_id] = seq_text; if len(multiple_data) > 0: - return async_request( options, args, multiple_data ); + return query_request( options, args, multiple_data ); #return echo( options, args ); else: return "An error has occurred. Please be sure that your input files are valid."; @@ -164,7 +167,7 @@ #--exact 0 #--sequences 'id0__tc__CAATTAATGATAAATATTTTATAAGGTGCGGAAATAAAGTGAGGAATATCTTTTAAATTCAAGTTCAATTCTGAAAGC' #--outputdir 'collection_content' - #sequences = 'id0__tc__CAATTAATGATAAATATTTTATAAGGTGCGGAAATAAAGTGAGGAATATCTTTTAAATTCAAGTTCAATTCTGAAAGC'; + #sequences = 'NM_001169378.2__tc__atttcggatgctttggagggaggaactctagtgctgcattgattggggcgtgtgttaatgatattcccagttcgcatggcgagcatcgattcctggtacgtatgtgggccccttgactcccacttatcgcacttgtcgttcgcaatttgcatgaattccgcttcgtctgaaacgcacttgcgccagacttctccggctggtctgatctggtctgtgatccggtctggtggggcgccagttgcgtttcgagctcatcaccagtcactccgcagtcgcattctgccagaggtctccgatcaagagcgcttctccattcgagattcaaacgcagcgcggtctgacgccgccacatcgagtgaaatccatatcgatggccacattcacacaggacgagatcgacttcctgcgcagccatggcaacgagctgtgtgccaagacctggctgggattgtgggatccgaagcgggctgtgcaccagcaggagcagcgcgaactgatgatggacaagtatgagcggaagcgatactacctggagccggccagtcctcttaagtcgctggccaatgcggtcaacctgaagtcgtctgctccggcgacgaaccacactcagaatggccaccaaaatgggtatgccagcatccatttgacgcctcctgctgcccagcggacctcggccaatggattgcagaaggtggccaactcgtcgagtaactcttctggaaagacctcatcctcgatcagtaggccacactataatcaccagaacaacagccaaaacaacaatcacgatgcctttggcctgggtggcggattgagcagcctgaacagcgccggttccacatccactggagctctttccgacaccagcagttgtgctagcaatggcttcggtgcggactgcgactttgtggctgactttggctcggccaacattttcgacgccacatcggcgcgttccacaggatcgccggcggtgtcgtccgtgtcctcagtgggttccagcaatggctacgccaaggtgcagcccatccgggcagctcatctccagcagcaacagcagttgcagcagcagctgcatcagcagcagctcctcaatggcaatggtcatcagggcactgagaactttgccgacttcgatcacgctcccatctacaatgcagtggctccaccgacttttaacgattggatcagcgactggagcaggcggggcttccacgatcccttcgacgattgcgatgactcgccaccaggtgcccgccctccagcacctgcgccagctcctgctcaagttcccgcagtatcatcaccattgccaaccgtccgagaagaaccagagcttgcgtggaatttttgggaggacgagatgcgaatagaggcgcaggaaaaggagtcccaaactaaacagccggagttgggctactccttttcgattagtactactacgcccctttccccttcgaatcccttcctgccctaccttgtcagtgaggagcagcatcgaaatcatccagagaagccctccttttcgtattcgttgttcagctccatatcaaatagttcgcaagaagatcaggcggatgatcatgagatgaatgttttaaatgccaatttccatgatttctttacgtggagtgctcccttgcagaacggccatacgaccagtccgcccaagggcggaaatgcagcgatggcgcccagtgaggatcgatatgccgctcttaaggatctcgacgagcagctgcgagaactgaaggccagcgaaagcgccacagagacgcccacgcccaccagtggcaatgttcaggccacagatgcctttggtggagccctcaacaacaatccaaatcccttcaagggccagcaacagcagcagctcagcagccatgtggtgaatccattccagcagcagcaacagcagcagcaccagcagaatctctatggccagttgacgctcataccaaatgcctacggcagcagttcccagcagcagatggggcaccatctcctccagcagcagcagcagcaacagcagagcttcttcaacttcaacaacaacgggttcgccatctcgcagggtctgcccaacggctgcggcttcggcagcatgcaacccgctcctgtgatggccaacaatccctttgcagccagcggcgccatgaacaccaacaatccattcttatgagactcaacccgggagaatccgcctcgcgccacctggcagaggcgctgagccagcgaacaaagagcagacgcggaggaaccgaaccgaaattagtccattttactaacaatagcgttaatctatgtatacataatgcacgccggagagcactctttgtgtacatagcccaaatatgtacacccgaaaggctccacgctgacgctagtcctcgcggatggcggaggcggactggggcgttgatatattcttttacatggtaactctactctaacgtttacggatacggatatttgtatttgccgtttgccctagaactctatacttgtactaagcgcccatgaacacttcatccactaacatagctactaatcctcatcctagtggaggatgcagttggtccagacactctgttatttgttttatccatcctcgtacttgtctttgtcccatttagcactttcgttgcggataagaactttgtcagttattgattgtgtggccttaataagattataaaactaaatattataacgtacgactatacatatacggatacagatacagattcagacacagttagtacagatacagatatacatatacgcttttgtacctaatgaattgcttcttgtttccattgctaatcatctgcttttcgtgtgctaattttatacactagtacgtgcgatatcggccgtgcagatagattgctcagctcgcgagtcaagcctcttttggttgcacccacggcagacatttgtacatatactgtctgattgtaagcctcgtgtaatacctccattaacaccactcccccaccacccatccatcgaaccccgaatccatgactcaattcactgctcacatgtccatgcccatgccttaacgtgtcaaacattatcgaagccttaaagttatttaaaactacgaaatttcaataaaaacaaataagaacgctatc'; #print(sequences); #(options, args) = parser.parse_args(['-x', 'rrr', '-t', 0.5, '-s', sequences, '-o', 'collection_content']); |