We have created an API using REST with a partial implementation of this website functionality.
The REST API can be accessed in this url: https://www.cancergenomeinterpreter.org/api/v1
To be able to use this feature you need to register in our website and request an authentication token as well as accept our terms of use.
import requests
headers = {'Authorization': 'example@email.com your_token'}
payload = {'cancer_type': 'CANCER TYPE', 'title': 'Title of the run', 'reference': 'hg38 or hg19'}
r = requests.post('https://www.cancergenomeinterpreter.org/api/v1',
headers=headers,
files={
'mutations': open('/paht/to/your/mutations.ext', 'rb'),
'cnas': open('/paht/to/another/file.ext', 'rb'),
'translocations': open('/paht/to/yet/another/file.ext', 'rb')
},
data=payload)
r.json()
curl --request POST \
--url https://www.cancergenomeinterpreter.org/api/v1 \
--header 'Authorization: example@email.com your_token' \
-F "mutations=@/paht/to/your/file.ext" \
-F "cnas=@/paht/to/another/file.ext" \
-F "translocations=@/paht/to/yst/another/file.ext" \
-F "cancer_type=CANCER TYPE" \
-F "reference=hg19 \
-F "title=Title of the run"
import requests
headers = {'Authorization': 'example@email.com your_token'}
r = requests.get('https://www.cancergenomeinterpreter.org/api/v1', headers=headers)
r.json()
curl --request GET \
--url https://www.cancergenomeinterpreter.org/api/v1 \
--header 'Authorization: example@email.com your_token'
import requests
headers = {'Authorization': 'example@email.com your_token'}
r = requests.get('https://www.cancergenomeinterpreter.org/api/v1/job_id', headers=headers)
r.json()
curl --request GET \
--url https://www.cancergenomeinterpreter.org/api/v1/job_id \
--header 'Authorization: example@email.com your_token'
import requests
headers = {'Authorization': 'example@email.com your_token'}
payload={'action':'logs'}
r = requests.get('https://www.cancergenomeinterpreter.org/api/v1/job_id', headers=headers, params=payload)
r.json()
curl --request GET \
--url https://www.cancergenomeinterpreter.org/api/v1/job_id \
--header 'Authorization: example@email.com your_token' \
-G --data 'action=logs'
import requests
headers = {'Authorization': 'example@email.com your_token'}
payload={'action':'download'}
r = requests.get('https://www.cancergenomeinterpreter.org/api/v1/job_id', headers=headers, params=payload)
with open('file.zip', 'wb') as fd:
fd.write(r._content)
curl --request GET \
--url https://www.cancergenomeinterpreter.org/api/v1/job_id \
--header 'Authorization: example@email.com your_token' \
-G --data 'action=download' \
-o file.zip
import requests
headers = {'Authorization': 'example@email.com your_token'}
r = requests.delete('https://www.cancergenomeinterpreter.org/api/v1/job_id', headers=headers)
r.json()
curl --request DELETE \
--url https://www.cancergenomeinterpreter.org/api/v1/jobid \
--header 'Authorization: example@email.com your_token'
The token in needed in any communication between the end user and the REST API.
Only registered users can request a token.