Analysis Jobs

The public API supports submitting analysis jobs. To submit an analysis job, you must have already uploaded the files you wish to analyze to the Biodock filesystem, and you must have a published analysis pipeline.

Pipelines can only be created and published through the website, NOT the API.

Only user-created pipelines are supported through the public API, NOT Biodock pipelines.

To submit an analysis job, use the following endpoint:

Submit analysis job

POST https://app.biodock.ai/api/external/analysis-jobs

Headers

NameTypeDescription

X-API-KEY*

String

API key.

Request Body

NameTypeDescription

pipelineId*

String

Pipeline to use for analysis.

filesystemIds*

List[String]

Filesystem items to analyze.

name

String

Name of the job.

{
    id: "0123456789",
    percentageCompleted: 0,
    status: "PENDING"
}

You can view progress for your analysis job using the following endpoint:

Fetch analysis job

GET https://app.biodock.ai/api/external/analysis-jobs/{id}

Path Parameters

NameTypeDescription

id*

String

Headers

NameTypeDescription

X-API-KEY*

String

API key.

{
    id: "0123456789",
    percentageCompleted: 100,
    status: "SUCCEEDED",
    objectsDataCSVUrl: "https://...",
    aggregateDataCSVUrl: "https://..."
}

You can view progress for all your analysis jobs using the following endpoint:

List analysis jobs

GET https://app.biodock.ai/api/external/analysis-jobs

Query Parameters

NameTypeDescription

limit

Number

Maximum number of results to show.

startingAfter

String

Pagination cursor id.

Headers

NameTypeDescription

X-API-KEY*

String

API key.

{
    results: [{
        id: "0123456789",
        percentageCompleted: 100,
        status: "SUCCEEDED",
        objectsDataCSVUrl: "https://...",
        aggregateDataCSVUrl: "https://..."
    }],
    count: 1
}

Masks data is not generated by default during an analysis job. If you would like to obtain the masks data for your analysis job, you must first generate the masks data with the following endpoint:

Submit download masks job

POST https://app.biodock.ai/api/external/analysis-jobs/{id}/download-masks

Path Parameters

NameTypeDescription

id*

String

Headers

NameTypeDescription

X-API-KEY*

String

API key.

{
    percentageCompleted: 0,
    status: "SUBMITTED"
}

Once the masks generation has completed, the download link to the masks will be available. You can view the progress and obtain the download link with the following endpoint:

Fetch download masks job

GET https://app.biodock.ai/api/external/analysis-jobs/{id}/download-masks

Path Parameters

NameTypeDescription

id*

String

Headers

NameTypeDescription

X-API-KEY*

String

API key.

{
    percentageCompleted: 100,
    status: "SUCCEEDED",
    masksZipUrl: "https://..."
}

Sample Usage

Submitting an analysis job

import requests

API_KEY = "" # Replace with your api key
FILESYSTEM_IDS = [""] # Replace with your filesystem ids. Add to the list as neccesary
PIPELINE_ID = "" # Replace with your pipeline id

URL = "https://app.biodock.ai/api/external/analysis-jobs"
headers = {"X-API-KEY": API_KEY, "Content-Type": "application/json"}
data = {"filesystemIds": FILESYSTEM_IDS, "pipelineId": PIPELINE_ID}

response = requests.post(URL, json=data, headers=headers)
print(response.text)

View the progress of a specific analysis job

import requests

API_KEY = "" # Replace with your api key
ANALYSIS_JOB_ID = "" # Replace with your analysis job id

URL = f"https://app.biodock.ai/api/external/analysis-jobs/{ANALYSIS_JOB_ID}"
headers = {"X-API-KEY": API_KEY, "Content-Type": "application/json"}

response = requests.get(URL, headers=headers)
print(response.text)

View the progress of all your analysis jobs

import requests

API_KEY = "" # Replace with your api key

URL = "https://app.biodock.ai/api/external/analysis-jobs"
headers = {"X-API-KEY": API_KEY, "Content-Type": "application/json"}

response = requests.get(URL, headers=headers)
print(response.text)

Generate masks data for an analysis job

import requests

API_KEY = "" # Replace with your api key
ANALYSIS_JOB_ID = "" # Replace with your analysis job id

URL = f"https://app.biodock.ai/api/external/analysis-jobs/{ANALYSIS_JOB_ID}/download-masks"
headers = {"X-API-KEY": API_KEY, "Content-Type": "application/json"}

response = requests.post(URL, headers=headers)
print(response.text)

View the progress of masks generation

import requests

API_KEY = "" # Replace with your api key
ANALYSIS_JOB_ID = "" # Replace with your analysis job id

URL = f"https://app.biodock.ai/api/external/analysis-jobs/{ANALYSIS_JOB_ID}/download-masks"
headers = {"X-API-KEY": API_KEY, "Content-Type": "application/json"}

response = requests.get(URL, headers=headers)
print(response.text)

Last updated