[2021-06-11] Important update:
The public repository "Demo B2B Server" has been launched containing the code to illustrate the API functionalities of Bio2Byte Tools (Jupyter Notebook is available). More details on Readme file.
The user can access the APIs that require an input file using a Python script as described in the example below. Accepted formats for msatools are a variety of multiple sequence alignment formats.
-
Send request
#!/usr/bin/env python import requests, json ## input parameters ## url = 'https://bio2byte.be/msatools/api/' file_path = 'msa_file.clustal' # The file with the multiple sequence alignment token = 'YOURTOKEN' # Your personal token ## end input parameters ## file_content = open(file_path,'rb').read().decode("utf-8") values = { "file_content": file_content, "token": token, "tool_list": ["msatools"] } r = requests.post(url, data=values) queue_url = json.loads(r.content.decode("utf-8"))["Location"] queue_status_url = 'https://bio2byte.be/msatools' + queue_url print('Success: go to: ' + queue_status_url)
-
Get request
#!/usr/bin/env python import requests # Use the hash_id from the previous step's response hash_id = 'O4X8cOs6KexeeW22QD2W' url = 'https://bio2byte.be/msatools/api/queue/' + hash_id response = requests.get(url) print(response.content)