sagetasks.sevenbridges package

Submodules

sagetasks.sevenbridges.general module

sagetasks.sevenbridges.general.bundle_client_args(auth_token, platform='cavatica', endpoint=None, **kwargs)[source]

SevenBridges - Bundle client arguments

sagetasks.sevenbridges.general.create_tasks(client_args, project, app_id, manifest, inputs_fn)[source]

SevenBridges - Create draft tasks

sagetasks.sevenbridges.general.get_copied_app_id(client_args, project, app_id=None)[source]

SevenBridges - Get (or import) an imported copy of a public app

sagetasks.sevenbridges.general.get_project_id(client_args, project_name, billing_group_name)[source]

SevenBridges - Get (or create) project

sagetasks.sevenbridges.general.get_volume_id(client_args, volume_name=None, volume_id=None)[source]

SevenBridges - Get a cloud volume

sagetasks.sevenbridges.general.import_volume_file(client_args, project, volume_id, volume_path, project_path)[source]

SevenBridges - Import a file from a volume

sagetasks.sevenbridges.inputs module

sagetasks.sevenbridges.inputs.format_rg_val(val)[source]

Replaces all whitespace from input string with underscores.

sagetasks.sevenbridges.inputs.get_unique_value(df, col, default=None)[source]

Retrieves unique scalar value from Pandas DataFrame column.

sagetasks.sevenbridges.inputs.manifest_to_kf_rnaseq_app_inputs_factory(file_col='cavatica_file_id', sample_col='sample_id', readlen_col='read_length', sampletype_col='sample_type', orientation_col='read_orientation', orientation_vals=('R1', 'R2'), strandedness_col='strandedness', strandedness_vals=('default', 'rf-stranded', 'fr-stranded'), library_col='library_id', platform_col='platform')[source]

Creates function for generating the KF RNA-seq app inputs from a file manifest.

Parameters
  • file_col (str, optional) – Manifest column name for Cavatica file IDs. Defaults to “cavatica_file_id”.

  • sample_col (str, optional) – Manifest column name for sample IDs. Defaults to “sample_id”.

  • readlen_col (str, optional) – Manifest column name for read lengths. Defaults to “read_length”.

  • sampletype_col (str, optional) – Manifest column name for sample types (e.g., tumor vs normal). Defaults to “sample_type”.

  • orientation_col (str, optional) – Manifest column name for read orientations. Defaults to “read_orientation”.

  • orientation_vals (tuple, optional) – Manifest column values for mapping to R1 and R2. Defaults to (“R1”, “R2”).

  • strandedness_col (str, optional) – Manifest column name for RNA-seq strandedness. Defaults to “strandedness”.

  • strandedness_vals (list of str, optional) – Manifest column values for mapping to the defaults. Defaults to (“default”, “rf-stranded”, “fr-stranded”).

  • library_col (str, optional) – Manifest column name for library IDs. Defaults to “library_id”.

  • platform_col (str, optional) – Manifest column name for sequencing platforms. Defaults to “platform”.

sagetasks.sevenbridges.prefect module

sagetasks.sevenbridges.utils module

class sagetasks.sevenbridges.utils.SbgUtils(client_args)[source]

Bases: object

static bundle_client_args(auth_token, platform='cavatica', endpoint=None, **kwargs)[source]

Bundles the information for authenticating a SevenBridges client.

create_folder(folder_name, parent)[source]

Creates a folder with the given name and parent.

create_project(project_name, billing_group_name)[source]

Creates a project with the given name and billing group.

create_task(app_id, inputs, task_name, callback_fn=None)[source]

Drafts a task with the given app, inputs, and task name.

The optional callback_fn provides the option to update the task once it’s created (e.g., updating an input using the task ID).

extract_id(resource)[source]

Extracts the resource ID (or returns the ID if already a string).

These IDs are strings, which can be pickled unlike the resource objects.

get_billing_group(billing_group_name)[source]

Retrieves the billing groups with the given name.

get_copied_app(app_id)[source]

Retrieves a public app that’s been copied to a project.

get_copied_app_name(app_id, increment=False)[source]

Generates a consistent naming scheme for public apps that are copied.

get_file(file_name, parent)[source]

Retrieves a file with the given name and parent.

get_folder(folder_name, parent)[source]

Retrieves the folder with the given name and parent.

get_folders_recursively(folder_names, parent=None)[source]

Gets (or creates) a nested list of folders recursively.

get_or_create(get_fn, create_fn)[source]

Gets a single resource or creates it if missing.

get_or_create_copied_app(app_id)[source]

Gets (or copies) a public app in the opened project.

get_or_create_folder(folder_name, parent)[source]

Gets (or creates) a folder with the given name and parent.

get_or_create_project(project_name, billing_group_name)[source]

Gets (or creates) a project with the given information.

get_or_create_task(app_id, inputs, task_name, callback_fn=None)[source]

Gets (or drafts) a task with the given app, inputs, and task name.

get_or_create_volume_file(volume_id, volume_path, project_path)[source]

Gets (or imports) the given volume file under the given project path.

get_project(project_name=None, project_id=None)[source]

Retrieves the projects with the given name or ID.

get_public_app(app_id)[source]

Retrieves the public app with the given ID.

get_task(task_name=None, app_id=None)[source]

Retrieves the tasks with the given name and/or app ID.

get_volume(volume_name=None, volume_id=None)[source]

Retrieves the cloud volumes with the given name or ID.

import_app(app_id)[source]

Copies a public app into the opened project.

import_volume_file(volume_id, volume_path, parent)[source]

Imports the given volume file under the given parent.

open_project(project)[source]

Sets the given project as the default for other methods.

property project

Property for raising an error if a project hasn’t been opened yet.

Module contents

Collection of Seven Bridges Genomics-related Prefect tasks

Adapted from code that Tom Yu authored: https://github.com/include-dcc/synapse-cavatica/blob/main/scripts/rnaseq_flow.py