gxformat2 package¶
Submodules¶
gxformat2.abstract module¶
Module for exporting Galaxy workflows to CWL abstract interface.
gxformat2.converter module¶
Functionality for converting a Format 2 workflow into a standard Galaxy workflow.
-
gxformat2.converter.
main
(argv=None)[source]¶ Entry point for script to conversion from Format 2 interface.
gxformat2.cytoscape module¶
Build standalone visualization for Galaxy workflows.
gxformat2.export module¶
Functionality for converting a standard Galaxy workflow into a format 2 workflow.
gxformat2.interface module¶
This module contains an interface and implementation describing Galaxy interactions used by gxformat2.
The interface is ImporterGalaxyInterface
and the default
implementation based on BioBlend
is BioBlendImporterGalaxyInterface
.
-
class
gxformat2.interface.
BioBlendImporterGalaxyInterface
(**kwds)[source]¶ Bases:
object
Implementation of
ImporterGalaxyInterface
using bioblend.
-
class
gxformat2.interface.
ImporterGalaxyInterface
[source]¶ Bases:
object
An abstract interface describing Galaxy operations used by gxformat2.
Specifically containing definitions of operations required to load workflows into Galaxy.
gxformat2.lint module¶
Workflow linting entry point - main script.
gxformat2.linting module¶
Generic utilities for linting.
Largely derived in large part from galaxy.tool_util.lint.
gxformat2.main module¶
Module containing convert_and_import_workflow()
.
gxformat2.markdown_parse module¶
Utilities for parsing “Galaxy Flavored Markdown”.
See markdown_util.py for loading objects and interacting with the rest of Galaxy. This file is meant to be relatively self contained and just used to “parse” and validate Galaxy Markdown. Keeping things isolated to allow re-use of these utilities in other projects (e.g. gxformat2).
gxformat2.model module¶
Abstractions for dealing with Format2 data.
-
gxformat2.model.
convert_dict_to_id_list_if_needed
(dict_or_list: Union[Dict[KT, VT], List[T]], add_label: bool = False, mutate: bool = False) → list[source]¶ Convert a list or dict to a list with keys embedded.
If add_label is True, embed dict keys as ‘label’ attribute else ‘id’.
-
gxformat2.model.
ensure_step_position
(step: dict, order_index: int)[source]¶ Ensure step contains a position definition.
Modifies the input step dictionary.
-
gxformat2.model.
inputs_as_native_steps
(workflow_dict: dict)[source]¶ Return workflow inputs to a steps in array - like in native Galaxy.
Convert Format2 types into native ones. workflow_dict is a Format 2 representation of a workflow. This method does not modify workflow_dict.
-
gxformat2.model.
inputs_as_normalized_steps
(workflow_dict)[source]¶ Return workflow inputs to a steps in array.
Normalize Format2 inputs. workflow_dict is a Format 2 representation of a workflow. This method does not modify workflow_dict.
-
gxformat2.model.
native_input_to_format2_type
(step: dict, tool_state: dict) → str[source]¶ Return a Format2 input type (‘type’) from a native input step dictionary.
gxformat2.normalize module¶
Abstractions for uniform across formats.
-
class
gxformat2.normalize.
Inputs
(workflow_dict)[source]¶ Bases:
object
An abstraction around a Galaxy workflow’s inputs.
-
count
¶ Return the number of declared inputs for the workflow.
-
-
class
gxformat2.normalize.
NormalizedWorkflow
(input_workflow: dict)[source]¶ Bases:
object
Present a view of a Format2 workflow that has been normalized.
In a normalized view: - Steps are a list and ids/labels have been populated - references to anonymous outputs have been relaced with the correct anonymous label
TODO: - input: <type> has been converted to input: {type: <type>} - step inputs have been replaced with input declarations - normalize out declarations to dicts?
-
gxformat2.normalize.
inputs_normalized
(**kwd)[source]¶ Call steps_normalized and retain just the input steps normalized.
-
gxformat2.normalize.
outputs_normalized
(**kwd)[source]¶ Ensure Format2 and return outputs.
Probably should go farther and normalize source -> outputSource, but doesn’t yet do this.
gxformat2.yaml module¶
YAML loading utilities for gxformat2.
-
gxformat2.yaml.
ordered_dump
(data, stream=None, Dumper=<class 'yaml.dumper.SafeDumper'>, **kwds)[source]¶ Safe and ordered dump of YAML to stream.
-
gxformat2.yaml.
ordered_dump_to_path
(as_dict: dict, path: str)[source]¶ Safe and ordered dump of YAML to path.
Module contents¶
The public interface or entry point for the Format 2 workflow code.
-
gxformat2.
convert_and_import_workflow
(has_workflow, **kwds)[source]¶ Conversion and import Format 2 workflows into a target Galaxy instance.
-
gxformat2.
from_galaxy_native
(native_workflow_dict, tool_interface=None, json_wrapper=False)[source]¶ Convert native .ga workflow definition to a format2 workflow.
This is highly experimental and currently broken.
-
class
gxformat2.
ImporterGalaxyInterface
[source]¶ Bases:
object
An abstract interface describing Galaxy operations used by gxformat2.
Specifically containing definitions of operations required to load workflows into Galaxy.