-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathming_massive_library.py
34 lines (28 loc) · 1.76 KB
/
ming_massive_library.py
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
#!/usr/bin/python
import requests
import json
def massivesearch_get_peptides_list(offset, page_size, total_rows=0):
url = "http://massive.ucsd.edu/ProteoSAFe/QueryPROXI"
payload = {'pageSize': page_size, "offset": offset, "query" : '#{"searched_button":"peptides"}', "query_type" : "peptide", "totalRows" : total_rows}
r = requests.get(url, params=payload)
return json.loads(r.text)
def massivesearch_get_psms_per_peptide(offset, page_size, peptide):
url = "http://massive.ucsd.edu/ProteoSAFe/QueryPROXI"
payload = {'pageSize': page_size, "offset": offset, "query" : '#{"searched_button":"psms","peptide":"%s"}' % (peptide), "query_type" : "psm"}
r = requests.get(url, params=payload)
return json.loads(r.text)
def massivesearch_get_variants_per_peptide(offset, page_size, peptide):
url = "http://massive.ucsd.edu/ProteoSAFe/QueryPROXI"
payload = {'pageSize': page_size, "offset": offset, "query" : '#{"searched_button":"psms","peptide":"%s"}' % (peptide), "query_type" : "variant"}
r = requests.get(url, params=payload)
return json.loads(r.text)
def massivesearch_get_proteins_per_peptide(offset, page_size, peptide):
url = "http://massive.ucsd.edu/ProteoSAFe/QueryPROXI"
payload = {'pageSize': page_size, "offset": offset, "query" : '#{"searched_button":"psms","peptide":"%s"}' % (peptide), "query_type" : "protein"}
r = requests.get(url, params=payload)
return json.loads(r.text)
def massivesearch_get_datasets_per_peptide(offset, page_size, peptide):
url = "http://massive.ucsd.edu/ProteoSAFe/QueryPROXI"
payload = {'pageSize': page_size, "offset": offset, "query" : '#{"searched_button":"psms","peptide":"%s"}' % (peptide), "query_type" : "dataset"}
r = requests.get(url, params=payload)
return json.loads(r.text)