Search by ptm & peptide sequence

Swagger

We recommend not to use browser for this as the amount of data could be really huge

Sample request payloads

sample1

{
 "peptideSequenceRegex": "AQLG*",
 "positions": [9, 16],
 "ptmKey": "name",
 "ptmValue": "iTRAQ4plex",
 "proteinAccessions": ["P40227", "ENSP00000352019.2"],
 "geneAccessions": ["ENST00000335503.3", "CCT6A"]
}

sample2

{
 "peptideSequenceRegex": "AQLG*",
 "positions": [9, 16],
 "ptmKey": "accession",
 "ptmValue": "UNIMOD:214",
 "proteinAccessions": ["P40227", "ENSP00000352019.2"],
 "geneAccessions": ["ENST00000335503.3", "CCT6A"]
}

sample3

 {
  "peptideSequenceRegex": "AQLG*",
  "positions": [9, 16],
  "ptmKey": "mass",
  "ptmValue": "144.102063",
  "proteinAccessions": ["P40227", "ENSP00000352019.2"],
  "geneAccessions": ["ENST00000335503.3", "CCT6A"]
}

Note

‘proteinAccessions’ & ‘geneAccessions’ are optional filters.

Warning

‘peptideSequenceRegex’ parameter should contain at-least 4 valid characters

valid: AS*DF, ASDF* etc.,

invalid: AS*F, ASF* etc.,

Warning

‘ptmKey’ should be one of these: ‘name, accession, mass’ and ‘ptmValue’ should be it’s corresponding value

Curl

curl -X POST "https://www.ebi.ac.uk/pride/multiomics/ws/spectra/sse/findByPtm" -H "accept: */*" -H "Content-Type: application/json" -d '{"peptideSequenceRegex":"AQLG*","positions":[9,16],"ptmKey":"mass","ptmValue":"144.102063"}'

OR

curl -X POST "https://www.ebi.ac.uk/pride/multiomics/ws/spectra/stream/findByPtm" -H "accept: */*" -H "Content-Type: application/json" -d '{"peptideSequenceRegex":"AQLG*","positions":[9,16],"ptmKey":"mass","ptmValue":"144.102063"}'

Python sample code

Using SSEs

Note

pip install sseclient-py

from sseclient import SSEClient   #pip install sseclient-py
import requests

url = 'https://www.ebi.ac.uk/pride/multiomics/ws/spectra/sse/findByPtm'
headers = {"Content-Type": "application/json"}
data = '{"peptideSequenceRegex":"AQLG*","positions":[9,16],"ptmKey":"mass","ptmValue":"144.102063"}'

def main():
    response = requests.post(url, data=data, headers=headers, stream=True)
    if response.status_code != 200:
        text = str(response.status_code) + ': ' + response.text
        raise Exception(text)
    client = SSEClient(response)
    for event in client.events():
        if event.event.lower() == "spectrum":
            print(event.data)
        elif event.event.lower() == "done":
            client.close()
            break


if __name__ == "__main__":
    main()

Using Stream

import requests

url = 'https://www.ebi.ac.uk/pride/multiomics/ws/spectra/stream/findByPtm'
headers = {"Content-Type": "application/json"}
data = '{"peptideSequenceRegex":"AQLG*","positions":[9,16],"ptmKey":"mass","ptmValue":"144.102063"}'

def main1():
    response = requests.post(url, data=data, headers=headers, stream=True)
    if response.status_code != 200:
        text = str(response.status_code) + ': ' + response.text
        raise Exception(text)
    for line in response.iter_lines():
        if line:
            print(line)


if __name__ == "__main__":
    main1()