Introduction

Each time you run a Mantle Pipeline, a pipeline run object is generated. A pipeline run contains links to its input entities and parameters and its output entities.

Getting a pipeline run by unique ID

Get a pipeline run object by its unique ID
import mantlebio

mantle = mantlebio.MantleClient()

# Get a pipeline run
pipeline_run = mantle.pipeline_run.get(<'pipeline_run_id'>)

This returns a Python object representing the run.

Getting single entity outputs of a pipeline run

All outputs of a pipeline run expressed as key-value pairs. You can get a single entity output of a pipeline run using its key.

Get single entity output

import mantlebio

mantle = mantlebio.MantleClient()

# Get a pipeline run
pipeline_run = mantle.pipeline_run.get('pipeline_run_id')

# Get a entity output of the run using the key
pipeline_run.get_output('output_entity_key')

This returns a Python object representing the data entity.

Getting inputs of a pipeline run

You may need to access the inputs of a pipeline run to incorporate them into your downstream analysis.

All inputs of a pipeline run expressed as key-value pairs.

Getting a single entity input

If a pipeline takes a single entity input for a key, you can get a Python object representing the entity used in a specific run using the key:

Get single input entity
import mantlebio

mantle = mantlebio.MantleClient()

# Get a pipeline run
pipeline_run = mantle.pipeline_run.get('pipeline_run_id')

# Get a entity input of the run using the key
pipeline_run.get_input_dataset('input_entity_key')

This returns a Python object representing the data entity.

For example, the Mantle nf-core rnaseq pipeline takes a single entity for the reference genome:

Get reference entity for bulk-rnaseq run
import mantlebio

mantle = mantlebio.MantleClient()

# Get a bulk-rnaseq pipeline run
pipeline_run = mantle.pipeline_run.get('bulk-rnaseq_pipeline_run_id')

# Get the reference genome entity of the run
pipeline_run.get_input_dataset('reference')

Getting a list of entity inputs

If a pipeline can take multiple entity inputs for a key, you can get a list of the entities used in a specific run using the key:

Get a list of input entities
import mantlebio

mantle = mantlebio.MantleClient()

# Get a pipeline run
pipeline_run = mantle.pipeline_run.get('pipeline_run_id')

# Get a entity input of the run using the key
pipeline_run.get_input_dataset_list('input_entity_key')

This returns a Python list of entity objects.

For example, the Mantle nf-core rnaseq pipeline can take multiple rnaseq_fastq entities for the fastqs input:

Get fastq entities for bulk-rnaseq run
import mantlebio

mantle = mantlebio.MantleClient()

# Get a bulk-rnaseq pipeline run
pipeline_run = mantle.pipeline_run.get('bulk-rnaseq_pipeline_run_id')

# Get a list of the rnaseq_fastq inputs
pipeline_run.get_input_dataset_list('fastqs')

Advanced