#!/usr/bin/python import requests, json, hmac, hashlib, datetime #Create an input parameter dictionary params['pre_aptamer_seq'] = '' params['post_aptamer_seq'] = '' params['aptamer_sequence'] = '' params['aptamer_structure'] = '' params['CDS'] = '' params['dG_ligand_aptamer'] = params['V_ligand'] = params['V_mRNA'] = params['16S_rRNA'] = 'undefined' params['organism'] = 'undefined' params['algorithm'] = 'RiboswitchCalculator_EvaluateMode' params['algorithm_version'] = 'undefined' #Send it to https://api.denovodna.com/ using a HTTPS POST params['publicConsumerToken'] = 'test' params['timestamp'] = datetime.datetime.utcnow().isoformat() message = params[publicConsumerToken'] + params['timestamp'] + 'RiboswitchCalculator_EvaluateMode' params['signature'] = hmac.new('private key', message, hashlib.sha1).hexdigest() headers = {'Content-type': u'application/json', 'Accept': u'application/json'} r = requests.post('https://api.denovodna.com/RiboswitchCalculator_EvaluateMode', data=json.dumps(params), headers=headers) output = r.json() #Retrieve the result after the calculation has completed. id = output['JobInfo']['id'] result = sendGet('Result',{'id' : id})