-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcall_mutability_api.py
More file actions
39 lines (31 loc) · 1011 Bytes
/
Copy pathcall_mutability_api.py
File metadata and controls
39 lines (31 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#import requests
#MUTAGENE_URL = "http://localhost:5000"
#MUTAGENE_URL = "https://www.ncbi.nlm.nih.gov/research/mutagene"
import requests
import sys
MUTAGENE_URL = "https://dev.ncbi.nlm.nih.gov/research/mutagene"
#MUTAGENE_URL = "https://www.ncbi.nlm.nih.gov/research/mutagene"
def retrieve_mutability(gene, model,download):
"""
"""
url = MUTAGENE_URL + '/api/gene'
r = requests.post(url, data={
'gene': gene,
'signature': str(model),
'download': str(download),
'mutations': 'profile',
'mutation_rate': '0',
# 'mutation_rate_value': 120,
})
if r.status_code == 200:
if download == "4":
muts = r.json()
for entry in muts['data']:
print("{}\t{}".format(entry['mutation'], entry['impact']))
else:
return(r.text)
if __name__ == '__main__':
gene = sys.argv[1]
model = sys.argv[2]
download = sys.argv[3]
print(retrieve_mutability(gene, model,download))