Introduction

A Mantle pipeline run object describes a specific time a pipeline was run on Mantle. It contains links to the pipeline run’s inputs, as well as its output datasets and files.

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')

Accessing files associated with pipeline run inputs

Downloading dataset input files for a pipeline run

Download dataset input files

import mantlebio

mantle = mantlebio.MantleClient()

# Download input files for a pipeline run
pipeline_run = mantle.pipeline_run.get('pipeline-run-id')   

input_dataset = pipeline_run.get_input_dataset('input-dataset-key')

input_dataset.download_s3('dataset_property','local/file/path/to/download/to')

Downloading S3 input files for a pipeline run

Download S3 input files

import mantlebio

mantle = mantlebio.MantleClient()

# Download input files for a pipeline run

pipeline_run = mantle.pipeline_run.get('pipeline-run-id')

pipeline_run.get_s3_input('input-key','local/file/path/to/download/to')

Adding outputs to pipeline runs

Adding a dataset output to a pipeline run

Add dataset output

import mantlebio

mantle = mantlebio.MantleClient()

# Create a dataset
dataset = mantle.dataset.create(
    name="4XP1",
    local=False,
    properties={
        "description": "X-ray structure of Drosophila dopamine transporter bound to neurotransmitter dopamine",
        "resolution": 2.5,
        "r_value": 0.2,
    }
)

# Add dataset output to a pipeline run
pipeline_run = mantle.pipeline_run.get('pipeline-run-id')

pipeline_run.add_dataset_output('my_output_dataset', dataset)

Adding a file output to a pipeline run

Add file output

import mantlebio

mantle = mantlebio.MantleClient()

# Add file output to a pipeline run
pipeline_run = mantle.pipeline_run.get('pipeline-run-id')

pipeline_run.add_file_output('my_output_file','local/file/path/to/upload_file.txt')