gxformat2.cytoscape package#
Submodules#
gxformat2.cytoscape.models module#
Pydantic models for Cytoscape.js workflow visualization elements.
- class gxformat2.cytoscape.models.CytoscapeEdge(*, group: Literal['edges'] = 'edges', data: CytoscapeEdgeData)[source]#
Bases:
BaseModelA Cytoscape.js edge element.
- data: CytoscapeEdgeData#
- group: Literal['edges']#
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gxformat2.cytoscape.models.CytoscapeEdgeData(*, id: str, source: str, target: str, input: str, output: str | None = None)[source]#
Bases:
BaseModelData payload for a Cytoscape edge (step connection).
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gxformat2.cytoscape.models.CytoscapeElements(*, nodes: list[CytoscapeNode] = <factory>, edges: list[CytoscapeEdge] = <factory>, layout: CytoscapeLayout | None = None)[source]#
Bases:
BaseModelComplete set of Cytoscape.js elements for a workflow visualization.
- edges: list[CytoscapeEdge]#
- layout: CytoscapeLayout | None#
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- nodes: list[CytoscapeNode]#
- class gxformat2.cytoscape.models.CytoscapeLayout(*, name: str)[source]#
Bases:
BaseModelLayout hint emitted on non-default layouts.
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gxformat2.cytoscape.models.CytoscapeNode(*, group: Literal['nodes'] = 'nodes', data: CytoscapeNodeData, classes: list[str] = <factory>, position: CytoscapePosition | None = None)[source]#
Bases:
BaseModelA Cytoscape.js node element.
- data: CytoscapeNodeData#
- group: Literal['nodes']#
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- position: CytoscapePosition | None#
- class gxformat2.cytoscape.models.CytoscapeNodeData(*, id: str, label: str, doc: str | None = None, tool_id: str | None = None, step_type: str = 'tool', repo_link: str | None = None)[source]#
Bases:
BaseModelData payload for a Cytoscape node (input or step).
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Module contents#
Cytoscape.js visualization for Galaxy workflows.
- class gxformat2.cytoscape.CytoscapeEdge(*, group: Literal['edges'] = 'edges', data: CytoscapeEdgeData)[source]#
Bases:
BaseModelA Cytoscape.js edge element.
- data: CytoscapeEdgeData#
- group: Literal['edges']#
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gxformat2.cytoscape.CytoscapeEdgeData(*, id: str, source: str, target: str, input: str, output: str | None = None)[source]#
Bases:
BaseModelData payload for a Cytoscape edge (step connection).
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gxformat2.cytoscape.CytoscapeElements(*, nodes: list[CytoscapeNode] = <factory>, edges: list[CytoscapeEdge] = <factory>, layout: CytoscapeLayout | None = None)[source]#
Bases:
BaseModelComplete set of Cytoscape.js elements for a workflow visualization.
- edges: list[CytoscapeEdge]#
- layout: CytoscapeLayout | None#
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- nodes: list[CytoscapeNode]#
- class gxformat2.cytoscape.CytoscapeLayout(*, name: str)[source]#
Bases:
BaseModelLayout hint emitted on non-default layouts.
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gxformat2.cytoscape.CytoscapeNode(*, group: Literal['nodes'] = 'nodes', data: CytoscapeNodeData, classes: list[str] = <factory>, position: CytoscapePosition | None = None)[source]#
Bases:
BaseModelA Cytoscape.js node element.
- data: CytoscapeNodeData#
- group: Literal['nodes']#
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- position: CytoscapePosition | None#
- class gxformat2.cytoscape.CytoscapeNodeData(*, id: str, label: str, doc: str | None = None, tool_id: str | None = None, step_type: str = 'tool', repo_link: str | None = None)[source]#
Bases:
BaseModelData payload for a Cytoscape node (input or step).
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class gxformat2.cytoscape.CytoscapePosition(*, x: int = 0, y: int = 0)[source]#
Bases:
BaseModelCytoscape node position (x/y coordinates).
- model_config = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- gxformat2.cytoscape.bakes_coordinates(layout: str) bool[source]#
Layouts that bake coordinates into
data.position.All other layouts are hint-only and rely on the runtime renderer.
- gxformat2.cytoscape.cytoscape_elements(workflow: dict[str, Any] | str | Path | GalaxyWorkflow | NormalizedFormat2, *, layout: str = 'preset') CytoscapeElements[source]#
Build Cytoscape visualization elements from a Galaxy workflow.
Accepts anything
normalized_format2()supports, plus an already normalizedNormalizedFormat2instance.layoutselects the placement strategy (defaultpreset); see_layout.pyand the cross-language spec for details.
- gxformat2.cytoscape.is_layout_name(value: str) bool[source]#
Return True if
valueis one of the supported Cytoscape layout names.
- gxformat2.cytoscape.main(argv=None)[source]#
Entry point for building Cytoscape visualizations of Galaxy workflows.
- gxformat2.cytoscape.render_html(elements: CytoscapeElements, layout: str = 'preset') str[source]#
Return a standalone HTML page visualizing the workflow with Cytoscape.js.
The returned string is a complete HTML document suitable for writing to a file or embedding in a Jupyter notebook.
- gxformat2.cytoscape.to_cytoscape(workflow_path: str, output_path=None, layout: str = 'preset')[source]#
Produce cytoscape output for supplied workflow path.
- gxformat2.cytoscape.topological_positions(elements: CytoscapeElements) dict[str, CytoscapePosition][source]#
Compute positions per the topological layering spec.
Returns a mapping keyed by node
data.id.