The Seven Bridges Knowledge Center

The Seven Bridges Platform is a simple solution for doing bioinformatics at industrial scale. But sometimes, everyone needs a little help.

Get Started

Submitting tasks for execution

There are two methods for starting multiple tasks on the Seven Bridges Platform:

  1. Submit tasks one by one inside a loop.
  2. Submit a batch task. A batch task can consist of many child tasks and can be created with a single API call, whereas submitting tasks inside a loop requires one API call for each task. Using batch tasks is therefore the recommended approach.

Not optimized for rate limit

In the example below, we iterate over samples and submit tasks one by one (in this case we run Salmon for RNA-seq analysis). This example assumes that we already grouped our input FASTQ files by samples in a dictionary.

for sample_id, fastq_files in samples.items():
     
    inputs = {
        "reads": fastq_files,
        "transcriptome_fasta_or_salmon_index_archive": index_file,
        "gtf": gene_map_file
    }
     
    task = api.tasks.create(
        name="Salmon {}".format(sample_id),
        project=project,
        app=salmon_workflow.id,
        inputs=inputs
    )

Optimized for rate limit

In this example, which is optimized for rate limit, we run Salmon as a batch task for all input files at once using sample_id as batching criterion. This example assumes that file metadata sample_id is already set for all input files.

inputs = {
    "reads": fastq_files,
    "transcriptome_fasta_or_salmon_index_archive": index_file,
    "gtf": gene_map_file
}
 
batch_task = api.tasks.create(
    name="Salmon batch",
    project=project,
    app=salmon_workflow.id,
    inputs=inputs,
    batch_input="reads",
    batch_by={
        "type": "CRITERIA",
        "criteria": ["metadata.sample_id"]
    }
)

Updated about a year ago

Submitting tasks for execution


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.