pbcommand Tool Contract

Tool Contract Models

class pbcommand.models.ToolContractTask(task_id, name, description, version, is_distributed, input_types, output_types, options, nproc, resources)[source]

Bases: object

Core metadata for a commandline task

Parameters:
  • task_id (str) – Global id to reference your tool in a pipeline
  • name – Display name of your
  • description – Short description of your tool
  • version – semantic style version string
  • is_distributed – If the task will be run locally or not
  • is_distributed – bool
  • input_types – list[FileType]
  • output_types
  • options – list of PacBioOption instances
  • nproc
  • resources
TASK_TYPE_ID = 'pbsmrtpipe.task_types.standard'
to_dict()[source]
class pbcommand.models.ToolDriver(driver_exe, env=None, serialization='json')[source]

Bases: object

Parameters:
  • driver_exe – Path to the driver
  • env – path to env to be sourced before it’s run?
Returns:

to_dict()[source]
class pbcommand.models.InputFileType(file_type_id, label, display_name, description)[source]

Bases: pbcommand.models.tool_contract._IOFileType

to_dict()[source]
class pbcommand.models.OutputFileType(file_type_id, label, display_name, description, default_name)[source]

Bases: pbcommand.models.tool_contract._IOFileType

to_dict()[source]
exception pbcommand.models.MalformedToolContractError[source]

Bases: exceptions.ValueError

exception pbcommand.models.MalformedResolvedToolContractError[source]

Bases: exceptions.ValueError

class pbcommand.models.ToolContract(task, driver, schema_version='2.0.0')[source]

Bases: object

Parameters:
  • task (ToolContractTask | ScatterToolContractTask | GatherToolContractTask) –
  • driver (ToolDriver) –
Returns:

WRITER_SCHEMA_VERSION = '2.0.0'
to_dict()[source]
class pbcommand.models.ScatterToolContractTask(task_id, name, description, version, is_distributed, input_types, output_types, tool_options, nproc, resources, chunk_keys, max_nchunks)[source]

Bases: pbcommand.models.tool_contract.ToolContractTask

Scatter tasks have a special output signature of [FileTypes.CHUNK]

The chunk keys are the expected to be written to the chunk.json file

TASK_TYPE_ID = 'pbsmrtpipe.task_types.scattered'
to_dict()[source]
class pbcommand.models.GatherToolContractTask(task_id, name, description, version, is_distributed, input_types, output_types, options, nproc, resources)[source]

Bases: pbcommand.models.tool_contract.ToolContractTask

Gather tasks have special input type [FileTypes.CHUNK]

Core metadata for a commandline task

Parameters:
  • task_id (str) – Global id to reference your tool in a pipeline
  • name – Display name of your
  • description – Short description of your tool
  • version – semantic style version string
  • is_distributed – If the task will be run locally or not
  • is_distributed – bool
  • input_types – list[FileType]
  • output_types
  • options – list of PacBioOption instances
  • nproc
  • resources
TASK_TYPE_ID = 'pbsmrtpipe.task_types.gathered'