comparison query.py @ 16:ba9d0fc8657f draft

Uploaded 20190118
author fabio
date Fri, 18 Jan 2019 10:12:19 -0500
parents 9ec4acef30ed
children
comparison
equal deleted inserted replaced
15:9d2b9e65d73e 16:ba9d0fc8657f
40 headers = {'Content-type': 'application/json'}; 40 headers = {'Content-type': 'application/json'};
41 41
42 # create a session 42 # create a session
43 session = requests.Session(); 43 session = requests.Session();
44 # make a synchronous post request to the query route 44 # make a synchronous post request to the query route
45 QUERY_URL.replace("<tree_id>", str(options.treeid));
46 req = session.post(QUERY_URL.replace("<tree_id>", str(options.treeid)), headers=headers, json=payload); 45 req = session.post(QUERY_URL.replace("<tree_id>", str(options.treeid)), headers=headers, json=payload);
47 resp_code = req.status_code; 46 resp_code = req.status_code;
48 #print(str(req.content)+"\n\n"); 47 #print(str(req.content)+"\n\n");
49 if resp_code == requests.codes.ok: 48 if resp_code == requests.codes.ok:
50 resp_content = str(req.content); 49 resp_content = str(req.content);
191 action="store", dest="fasta", help="contains the content of a fasta file"); 190 action="store", dest="fasta", help="contains the content of a fasta file");
192 parser.add_option("-x", "--search", type="string", default="rrr", 191 parser.add_option("-x", "--search", type="string", default="rrr",
193 action="store", dest="search", help="search mode"); 192 action="store", dest="search", help="search mode");
194 parser.add_option("-e", "--exact", type="int", default=0, 193 parser.add_option("-e", "--exact", type="int", default=0,
195 action="store", dest="exact", help="exact algorithm (required if search is 1 only)"); 194 action="store", dest="exact", help="exact algorithm (required if search is 1 only)");
196 parser.add_option("-k", "--tree", type="int", default=0, 195 parser.add_option("-k", "--tree", type="string", default=0,
197 action="store", dest="treeid", help="the id of the tree that will be queried"); 196 action="store", dest="treeid", help="the id of the tree that will be queried");
198 parser.add_option("-t", "--sthreshold", type="float", 197 parser.add_option("-t", "--sthreshold", type="float",
199 action="store", dest="sthreshold", help="threshold applied to the search algrithm"); 198 action="store", dest="sthreshold", help="threshold applied to the search algrithm");
200 parser.add_option("-z", "--sort", type="int", default=1, 199 parser.add_option("-z", "--sort", type="int", default=1,
201 action="store", dest="sortcontrol", help="boolean required to sort the result"); 200 action="store", dest="sortcontrol", help="boolean required to sort the result");