Warning

This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy.visualization.plugins package

Submodules

galaxy.visualization.plugins.config_parser module

exception galaxy.visualization.plugins.config_parser.ParsingException[source]

Bases: ValueError

An exception class for errors that occur during parsing of the plugin framework configuration XML file.

class galaxy.visualization.plugins.config_parser.PluginConfigParser[source]

Bases: object

Class that parses a plugin configuration XML file.

Each plugin will get the following info:
  • how to load a plugin:

    – how to find the proper template – how to convert query string into DB models

  • when/how to generate a link to the plugin

    – what provides the data – what information needs to be added to the query string

__init__()[source]
parse_file(xml_filepath)[source]

Parse the given XML file for plugin data. :returns: plugin config dictionary

parse_plugin(xml_tree)[source]

Parse the template, name, and any data_sources and params from the given xml_tree for a plugin.

parse_entry_point(xml_tree)[source]

Parse the config file for script entry point attributes like src and ``css`.

class galaxy.visualization.plugins.config_parser.DataSourceParser[source]

Bases: object

Component class of PluginConfigParser that parses data_source elements within plugin elements.

data_sources are (in the extreme) any object that can be used to produce data for the plugin to consume (e.g. HDAs, LDDAs, Jobs, Users, etc.). There can be more than one data_source associated with a plugin.

ALLOWED_MODEL_CLASSES = ['Visualization', 'HistoryDatasetAssociation', 'LibraryDatasetDatasetAssociation']
parse(xml_tree)[source]

Return a plugin data_source dictionary parsed from the given XML element.

parse_model_class(xml_tree)[source]

Convert xml model_class element to a galaxy model class (or None if model class is not found).

This element is required and only the first element is used. The model_class string must be in ALLOWED_MODEL_CLASSES.

parse_tests(xml_tree_list)[source]

Returns a list of test dictionaries that the registry can use against a given object to determine if the plugin can be used with the object.

class galaxy.visualization.plugins.config_parser.ListParser(aList)[source]

Bases: list

Converts a xml structure into an array See: http://code.activestate.com/recipes/410469-xml-as-dictionary/

__init__(aList)[source]
class galaxy.visualization.plugins.config_parser.DictParser(parent_element)[source]

Bases: dict

Converts a xml structure into a dictionary See: http://code.activestate.com/recipes/410469-xml-as-dictionary/

__init__(parent_element)[source]
class galaxy.visualization.plugins.config_parser.ParamParser[source]

Bases: object

Component class of PluginConfigParser that parses param elements within plugin elements.

params are parameters that will be parsed (based on their type, etc.) and sent to the plugin template by controllers.

DEFAULT_PARAM_TYPE = 'str'
parse(xml_tree)[source]

Parse a plugin parameter from the given xml_tree.

galaxy.visualization.plugins.datasource_testing module

galaxy.visualization.plugins.datasource_testing.is_object_applicable(trans, target_object, data_source_tests)[source]

Run a visualization’s data_source tests to find out if it can be applied to the target_object.

galaxy.visualization.plugins.plugin module

Visualization plugins: instantiate/deserialize data and models from a query string and render a webpage based on those data.

class galaxy.visualization.plugins.plugin.VisualizationPlugin(path: str, name: str, config: dict[str, Any])[source]

Bases: object

A plugin that instantiates resources, serves static files.

__init__(path: str, name: str, config: dict[str, Any]) None[source]
to_dict()[source]

galaxy.visualization.plugins.registry module

Lower level of visualization framework which does three main things:
  • associate visualizations with objects

  • create urls to visualizations based on some target object(s)

  • unpack a query string into the desired objects needed for rendering

class galaxy.visualization.plugins.registry.VisualizationsRegistry(app: StructuredApp, directories_setting: str | None = None, skip_bad_plugins: bool = True)[source]

Bases: object

Main responsibilities are:
  • discovering visualization plugins in the filesystem

  • testing if an object has a visualization that can be applied to it

  • generating a link to controllers.visualization.render with

    the appropriate params

  • validating and parsing params into resources (based on a context)

    used in the visualization template

BASE_DIR = 'static/plugins/visualizations'

base directory of visualizations

BASE_URL = 'visualizations'

base url to controller endpoint

__init__(app: StructuredApp, directories_setting: str | None = None, skip_bad_plugins: bool = True) None[source]

Set up the manager and load all visualization plugins.

Parameters:

app (galaxy.app.UniverseApplication) – the application (and its configuration) using this manager

get_plugin(key)[source]

Wrap to throw error if plugin not in registry.

get_visualizations(trans, target_object=None, embeddable=None)[source]

Get the names of visualizations usable on the target_object and the urls to call in order to render the visualizations.

get_visualization(trans, visualization_name, target_object)[source]

Return data to build a url to the visualization with the given visualization_name if it’s applicable to target_object or None if it’s not.