util Package

common_install_util Module

common_util Module

tool_shed.util.common_util.accumulate_tool_dependencies(tool_shed_accessible, tool_dependencies, all_tool_dependencies)[source]
tool_shed.util.common_util.check_for_missing_tools(app, tool_panel_configs, latest_tool_migration_script_number)[source]
tool_shed.util.common_util.check_tool_tag_set(elem, migrated_tool_configs_dict, missing_tool_configs_dict)[source]
tool_shed.util.common_util.generate_clone_url_for_installed_repository(app, repository)[source]

Generate the URL for cloning a repository that has been installed into a Galaxy instance.

tool_shed.util.common_util.generate_clone_url_for_repository_in_tool_shed(user, repository)[source]

Generate the URL for cloning a repository that is in the tool shed.

tool_shed.util.common_util.generate_clone_url_from_repo_info_tup(app, repo_info_tup)[source]

Generate the URL for cloning a repository given a tuple of toolshed, name, owner, changeset_revision.

tool_shed.util.common_util.get_non_shed_tool_panel_configs(app)[source]

Get the non-shed related tool panel configs - there can be more than one, and the default is tool_conf.xml.

tool_shed.util.common_util.get_protocol_from_tool_shed_url(tool_shed_url)[source]

Return the protocol from the received tool_shed_url if it exists.

tool_shed.util.common_util.get_repository_dependencies(app, tool_shed_url, repository_name, repository_owner, changeset_revision)[source]
tool_shed.util.common_util.get_tool_dependencies(app, tool_shed_url, repository_name, repository_owner, changeset_revision)[source]
tool_shed.util.common_util.get_tool_shed_repository_ids(as_string=False, **kwd)[source]
tool_shed.util.common_util.get_tool_shed_url_from_tool_shed_registry(app, tool_shed)[source]

The value of tool_shed is something like: toolshed.g2.bx.psu.edu. We need the URL to this tool shed, which is something like: http://toolshed.g2.bx.psu.edu/

tool_shed.util.common_util.handle_galaxy_url(trans, **kwd)[source]
tool_shed.util.common_util.handle_tool_shed_url_protocol(app, shed_url)[source]

Handle secure and insecure HTTP protocol since they may change over time.

tool_shed.util.common_util.parse_repository_dependency_tuple(repository_dependency_tuple, contains_error=False)[source]
tool_shed.util.common_util.remove_port_from_tool_shed_url(tool_shed_url)[source]

Return a partial Tool Shed URL, eliminating the port if it exists.

tool_shed.util.common_util.remove_protocol_and_port_from_tool_shed_url(tool_shed_url)[source]

Return a partial Tool Shed URL, eliminating the protocol and/or port if either exists.

tool_shed.util.common_util.remove_protocol_and_user_from_clone_url(repository_clone_url)[source]

Return a URL that can be used to clone a repository, eliminating the protocol and user if either exists.

tool_shed.util.common_util.remove_protocol_from_tool_shed_url(tool_shed_url)[source]

Return a partial Tool Shed URL, eliminating the protocol if it exists.

tool_shed.util.common_util.tool_shed_get(app, tool_shed_url, uri)[source]

Make contact with the tool shed via the uri provided.

tool_shed.util.common_util.url_join(*args)[source]

Return a valid URL produced by appending a base URL and a set of request parameters.

data_manager_util Module

datatype_util Module

encoding_util Module

tool_shed.util.encoding_util.tool_shed_decode(value)[source]
tool_shed.util.encoding_util.tool_shed_encode(val)[source]

metadata_util Module

tool_shed.util.metadata_util.get_latest_changeset_revision(app, repository, repo)[source]
tool_shed.util.metadata_util.get_latest_repository_metadata(app, decoded_repository_id, downloadable=False)[source]

Get last metadata defined for a specified repository from the database.

tool_shed.util.metadata_util.get_previous_metadata_changeset_revision(repository, repo, before_changeset_revision, downloadable=True)[source]

Return the changeset_revision in the repository changelog that has associated metadata prior to the changeset to which before_changeset_revision refers. If there isn’t one, return the hash value of an empty repository changelog, hg_util.INITIAL_CHANGELOG_HASH.

tool_shed.util.metadata_util.get_repository_dependency_tups_from_repository_metadata(app, repository_metadata, deprecated_only=False)[source]

Return a list of of tuples defining repository objects required by the received repository. The returned list defines the entire repository dependency tree. This method is called only from the Tool Shed.

tool_shed.util.metadata_util.get_repository_metadata_by_id(app, id)[source]

Get repository metadata from the database

tool_shed.util.metadata_util.get_repository_metadata_by_repository_id_changeset_revision(app, id, changeset_revision, metadata_only=False)[source]

Get a specified metadata record for a specified repository in the tool shed.

tool_shed.util.metadata_util.get_repository_metadata_revisions_for_review(repository, reviewed=True)[source]
tool_shed.util.metadata_util.is_downloadable(metadata_dict)[source]
tool_shed.util.metadata_util.is_malicious(app, id, changeset_revision, **kwd)[source]

Check the malicious flag in repository metadata for a specified change set revision.

readme_util Module

tool_shed.util.readme_util.build_readme_files_dict(app, repository, changeset_revision, metadata, tool_path=None)[source]

Return a dictionary of valid readme file name <-> readme file content pairs for all readme files defined in the received metadata. Since the received changeset_revision (which is associated with the received metadata) may not be the latest installable changeset revision, the README file contents may not be available on disk. This method is used by both Galaxy and the Tool Shed.

tool_shed.util.readme_util.get_readme_file_names(repository_name)[source]

Return a list of file names that will be categorized as README files for the received repository_name.

tool_shed.util.readme_util.get_readme_files_dict_for_display(app, tool_shed_url, repo_info_dict)[source]

Return a dictionary of README files contained in the single repository being installed so they can be displayed on the tool panel section selection page.

repository_dependency_util Module

review_util Module

tool_shed.util.review_util.can_browse_repository_reviews(app, user, repository)[source]

Determine if there are any reviews of the received repository for which the current user has permission to browse any component reviews.

tool_shed.util.review_util.changeset_revision_reviewed_by_user(user, repository, changeset_revision)[source]

Determine if the current changeset revision has been reviewed by the current user.

tool_shed.util.review_util.get_component(app, id)[source]

Get a component from the database.

tool_shed.util.review_util.get_component_by_name(app, name)[source]

Get a component from the database via a name.

tool_shed.util.review_util.get_component_review(app, id)[source]

Get a component_review from the database

tool_shed.util.review_util.get_component_review_by_repository_review_id_component_id(app, repository_review_id, component_id)[source]

Get a component_review from the database via repository_review_id and component_id.

tool_shed.util.review_util.get_components(app)[source]
tool_shed.util.review_util.get_previous_repository_reviews(app, repository, changeset_revision)[source]

Return an ordered dictionary of repository reviews up to and including the received changeset revision.

tool_shed.util.review_util.get_review(app, id)[source]

Get a repository_review from the database via id.

tool_shed.util.review_util.get_review_by_repository_id_changeset_revision_user_id(app, repository_id, changeset_revision, user_id)[source]

Get a repository_review from the database via repository id, changeset_revision and user_id.

tool_shed.util.review_util.get_reviews_by_repository_id_changeset_revision(app, repository_id, changeset_revision)[source]

Get all repository_reviews from the database via repository id and changeset_revision.

tool_shed.util.review_util.has_previous_repository_reviews(app, repository, changeset_revision)[source]

Determine if a repository has a changeset revision review prior to the received changeset revision.

shed_util_common Module

tool_shed.util.shed_util_common.create_or_update_tool_shed_repository(app, name, description, installed_changeset_revision, ctx_rev, repository_clone_url, metadata_dict, status, current_changeset_revision=None, owner='', dist_to_shed=False)[source]

Update a tool shed repository record in the Galaxy database with the new information received. If a record defined by the received tool shed, repository name and owner does not exist, create a new record with the received information.

tool_shed.util.shed_util_common.extract_components_from_tuple(repository_components_tuple)[source]

Extract the repository components from the provided tuple in a backward-compatible manner.

Generate the URL for sharing a repository that is in the tool shed.

tool_shed.util.shed_util_common.generate_tool_guid(repository_clone_url, tool)[source]

Generate a guid for the installed tool. It is critical that this guid matches the guid for the tool in the Galaxy tool shed from which it is being installed. The form of the guid is <tool shed host>/repos/<repository owner>/<repository name>/<tool id>/<tool version>

tool_shed.util.shed_util_common.generate_tool_shed_repository_install_dir(repository_clone_url, changeset_revision)[source]

Generate a repository installation directory that guarantees repositories with the same name will always be installed in different directories. The tool path will be of the form: <tool shed url>/repos/<repository owner>/<repository name>/<installed changeset revision>

tool_shed.util.shed_util_common.get_absolute_path_to_file_in_repository(repo_files_dir, file_name)[source]

Return the absolute path to a specified disk file contained in a repository.

tool_shed.util.shed_util_common.get_categories(app)[source]

Get all categories from the database.

tool_shed.util.shed_util_common.get_category(app, id)[source]

Get a category from the database.

tool_shed.util.shed_util_common.get_category_by_name(app, name)[source]

Get a category from the database via name.

tool_shed.util.shed_util_common.get_ctx_rev(app, tool_shed_url, name, owner, changeset_revision)[source]

Send a request to the tool shed to retrieve the ctx_rev for a repository defined by the combination of a name, owner and changeset revision.

tool_shed.util.shed_util_common.get_current_repository_metadata_for_changeset_revision(app, repository, changeset_revision)[source]
tool_shed.util.shed_util_common.get_ids_of_tool_shed_repositories_being_installed(app, as_string=False)[source]
tool_shed.util.shed_util_common.get_latest_downloadable_changeset_revision(app, repository, repo)[source]
tool_shed.util.shed_util_common.get_next_downloadable_changeset_revision(repository, repo, after_changeset_revision)[source]

Return the installable changeset_revision in the repository changelog after the changeset to which after_changeset_revision refers. If there isn’t one, return None.

tool_shed.util.shed_util_common.get_next_prior_import_or_install_required_dict_entry(prior_required_dict, processed_tsr_ids)[source]

This method is used in the Tool Shed when exporting a repository and its dependencies, and in Galaxy when a repository and its dependencies are being installed. The order in which the prior_required_dict is processed is critical in order to ensure that the ultimate repository import or installation order is correctly defined. This method determines the next key / value pair from the received prior_required_dict that should be processed.

tool_shed.util.shed_util_common.get_ordered_metadata_changeset_revisions(repository, repo, downloadable=True)[source]

Return an ordered list of changeset_revisions that are associated with metadata where order is defined by the repository changelog.

tool_shed.util.shed_util_common.get_prior_import_or_install_required_dict(app, tsr_ids, repo_info_dicts)[source]

This method is used in the Tool Shed when exporting a repository and its dependencies, and in Galaxy when a repository and its dependencies are being installed. Return a dictionary whose keys are the received tsr_ids and whose values are a list of tsr_ids, each of which is contained in the received list of tsr_ids and whose associated repository must be imported or installed prior to the repository associated with the tsr_id key.

tool_shed.util.shed_util_common.get_repo_info_tuple_contents(repo_info_tuple)[source]

Take care in handling the repo_info_tuple as it evolves over time as new tool shed features are introduced.

tool_shed.util.shed_util_common.get_repository_and_repository_dependencies_from_repo_info_dict(app, repo_info_dict)[source]

Return a tool_shed_repository or repository record defined by the information in the received repo_info_dict.

tool_shed.util.shed_util_common.get_repository_by_id(app, id)[source]

Get a repository from the database via id.

tool_shed.util.shed_util_common.get_repository_by_name(app, name)[source]

Get a repository from the database via name.

tool_shed.util.shed_util_common.get_repository_by_name_and_owner(app, name, owner)[source]

Get a repository from the database via name and owner

tool_shed.util.shed_util_common.get_repository_categories(app, id)[source]

Get categories of a repository on the tool shed side from the database via id

tool_shed.util.shed_util_common.get_repository_dependency_types(repository_dependencies)[source]

Inspect the received list of repository_dependencies tuples and return boolean values for has_repository_dependencies and has_repository_dependencies_only_if_compiling_contained_td.

tool_shed.util.shed_util_common.get_repository_file_contents(file_path)[source]

Return the display-safe contents of a repository file for display in a browser.

tool_shed.util.shed_util_common.get_repository_files(folder_path)[source]

Return the file hierarchy of a tool shed repository.

tool_shed.util.shed_util_common.get_repository_for_dependency_relationship(app, tool_shed, name, owner, changeset_revision)[source]

Return an installed tool_shed_repository database record that is defined by either the current changeset revision or the installed_changeset_revision.

tool_shed.util.shed_util_common.get_repository_from_refresh_on_change(app, **kwd)[source]
tool_shed.util.shed_util_common.get_repository_ids_requiring_prior_import_or_install(app, tsr_ids, repository_dependencies)[source]

This method is used in the Tool Shed when exporting a repository and its dependencies, and in Galaxy when a repository and its dependencies are being installed. Inspect the received repository_dependencies and determine if the encoded id of each required repository is in the received tsr_ids. If so, then determine whether that required repository should be imported / installed prior to its dependent repository. Return a list of encoded repository ids, each of which is contained in the received list of tsr_ids, and whose associated repositories must be imported / installed prior to the dependent repository associated with the received repository_dependencies.

tool_shed.util.shed_util_common.get_repository_in_tool_shed(app, id)[source]

Get a repository on the tool shed side from the database via id.

tool_shed.util.shed_util_common.get_repository_metadata_by_changeset_revision(app, id, changeset_revision)[source]

Get metadata for a specified repository change set from the database.

tool_shed.util.shed_util_common.get_repository_owner(cleaned_repository_url)[source]

Gvien a “cleaned” repository clone URL, return the owner of the repository.

tool_shed.util.shed_util_common.get_repository_owner_from_clone_url(repository_clone_url)[source]

Given a repository clone URL, return the owner of the repository.

tool_shed.util.shed_util_common.get_repository_query(app)[source]
tool_shed.util.shed_util_common.get_tool_panel_config_tool_path_install_dir(app, repository)[source]

Return shed-related tool panel config, the tool_path configured in it, and the relative path to the directory where the repository is installed. This method assumes all repository tools are defined in a single shed-related tool panel config.

tool_shed.util.shed_util_common.get_tool_path_by_shed_tool_conf_filename(app, shed_tool_conf)[source]

Return the tool_path config setting for the received shed_tool_conf file by searching the tool box’s in-memory list of shed_tool_confs for the dictionary whose config_filename key has a value matching the received shed_tool_conf.

tool_shed.util.shed_util_common.get_tool_shed_from_clone_url(repository_clone_url)[source]
tool_shed.util.shed_util_common.get_tool_shed_repository_by_id(app, repository_id)[source]

Return a tool shed repository database record defined by the id.

tool_shed.util.shed_util_common.get_tool_shed_repository_by_shed_name_owner_changeset_revision(app, tool_shed, name, owner, changeset_revision)[source]

Return a tool shed repository database record defined by the combination of a tool_shed, repository name, repository owner and current changeet_revision.

tool_shed.util.shed_util_common.get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision(app, tool_shed, name, owner, installed_changeset_revision)[source]

Return a tool shed repository database record defined by the combination of a tool_shed, repository name, repository owner and installed_changeet_revision.

tool_shed.util.shed_util_common.get_tool_shed_repository_status_label(app, tool_shed_repository=None, name=None, owner=None, changeset_revision=None, repository_clone_url=None)[source]

Return a color-coded label for the status of the received tool-shed_repository installed into Galaxy.

tool_shed.util.shed_util_common.get_tool_shed_status_for_installed_repository(app, repository)[source]

Send a request to the tool shed to retrieve information about newer installable repository revisions, current revision updates, whether the repository revision is the latest downloadable revision, and whether the repository has been deprecated in the tool shed. The received repository is a ToolShedRepository object from Galaxy.

tool_shed.util.shed_util_common.get_updated_changeset_revisions(app, name, owner, changeset_revision)[source]

Return a string of comma-separated changeset revision hashes for all available updates to the received changeset revision for the repository defined by the received name and owner.

tool_shed.util.shed_util_common.get_updated_changeset_revisions_from_tool_shed(app, tool_shed_url, name, owner, changeset_revision)[source]

Get all appropriate newer changeset revisions for the repository defined by the received tool_shed_url / name / owner combination.

tool_shed.util.shed_util_common.get_user(app, id)[source]

Get a user from the database by id.

tool_shed.util.shed_util_common.get_user_by_username(app, username)[source]

Get a user from the database by username.

tool_shed.util.shed_util_common.handle_email_alerts(app, host, repository, content_alert_str='', new_repo_alert=False, admin_only=False)[source]

There are 2 complementary features that enable a tool shed user to receive email notification: 1. Within User Preferences, they can elect to receive email when the first (or first valid)

change set is produced for a new repository.
  1. When viewing or managing a repository, they can check the box labeled “Receive email alerts” which caused them to receive email alerts when updates to the repository occur. This same feature is available on a per-repository basis on the repository grid within the tool shed.

There are currently 4 scenarios for sending email notification when a change is made to a repository: 1. An admin user elects to receive email when the first change set is produced for a new repository

from User Preferences. The change set does not have to include any valid content. This allows for the capture of inappropriate content being uploaded to new repositories.
  1. A regular user elects to receive email when the first valid change set is produced for a new repository from User Preferences. This differs from 1 above in that the user will not receive email until a change set tha tincludes valid content is produced.
  2. An admin user checks the “Receive email alerts” check box on the manage repository page. Since the user is an admin user, the email will include information about both HTML and image content that was included in the change set.
  3. A regular user checks the “Receive email alerts” check box on the manage repository page. Since the user is not an admin user, the email will not include any information about both HTML and image content that was included in the change set.
tool_shed.util.shed_util_common.have_shed_tool_conf_for_install(app)[source]
tool_shed.util.shed_util_common.is_tool_shed_client(app)[source]

The tool shed and clients to the tool (i.e. Galaxy) require a lot of similar functionality in this file but with small differences. This method should determine if the app performing the action is the tool shed or a client of the tool shed.

tool_shed.util.shed_util_common.open_repository_files_folder(folder_path)[source]

Return a list of dictionaries, each of which contains information for a file or directory contained within a directory in a repository file hierarchy.

tool_shed.util.shed_util_common.repository_was_previously_installed(app, tool_shed_url, repository_name, repo_info_tuple, from_tip=False)[source]

Find out if a repository is already installed into Galaxy - there are several scenarios where this is necessary. For example, this method will handle the case where the repository was previously installed using an older changeset_revsion, but later the repository was updated in the tool shed and now we’re trying to install the latest changeset revision of the same repository instead of updating the one that was previously installed. We’ll look in the database instead of on disk since the repository may be currently uninstalled.

tool_shed.util.shed_util_common.set_image_paths(app, encoded_repository_id, text)[source]

Handle tool help image display for tools that are contained in repositories in the tool shed or installed into Galaxy as well as image display in repository README files. This method will determine the location of the image file and return the path to it that will enable the caller to open the file.

tool_shed.util.shed_util_common.set_repository_attributes(app, repository, status, error_message, deleted, uninstalled, remove_from_disk=False)[source]
tool_shed.util.shed_util_common.tool_shed_is_this_tool_shed(toolshed_base_url)[source]

Determine if a tool shed is the current tool shed.

tool_dependency_util Module

tool_shed.util.tool_dependency_util.build_tool_dependencies_select_field(app, tool_shed_repository, name, multiple=True, display='checkboxes', uninstalled_only=False)[source]

Generate a SelectField consisting of the current list of tool dependency ids for an installed tool shed repository.

tool_shed.util.tool_dependency_util.create_or_update_tool_dependency(app, tool_shed_repository, name, version, type, status, set_status=True)[source]

Create or update a tool_dependency record in the Galaxy database.

tool_shed.util.tool_dependency_util.create_tool_dependency_objects(app, tool_shed_repository, relative_install_dir, set_status=True)[source]

Create or update a ToolDependency for each entry in tool_dependencies_config. This method is called when installing a new tool_shed_repository.

tool_shed.util.tool_dependency_util.get_download_url_for_platform(url_templates, platform_info_dict)[source]

Compare the dict returned by get_platform_info() with the values specified in the url_template element. Return true if and only if all defined attributes match the corresponding dict entries. If an entry is not defined in the url_template element, it is assumed to be irrelevant at this stage. For example, <url_template os=”darwin”>http://hgdownload.cse.ucsc.edu/admin/exe/macOSX.${architecture}/faToTwoBit</url_template> where the OS must be ‘darwin’, but the architecture is filled in later using string.Template.

tool_shed.util.tool_dependency_util.get_platform_info_dict()[source]

Return a dict with information about the current platform.

tool_shed.util.tool_dependency_util.get_tool_dependency(app, id)[source]

Get a tool_dependency from the database via id

tool_shed.util.tool_dependency_util.get_tool_dependency_by_name_type_repository(app, repository, name, type)[source]
tool_shed.util.tool_dependency_util.get_tool_dependency_by_name_version_type(app, name, version, type)[source]
tool_shed.util.tool_dependency_util.get_tool_dependency_by_name_version_type_repository(app, repository, name, version, type)[source]
tool_shed.util.tool_dependency_util.get_tool_dependency_ids(as_string=False, **kwd)[source]
tool_shed.util.tool_dependency_util.get_tool_dependency_install_dir(app, repository_name, repository_owner, repository_changeset_revision, tool_dependency_type, tool_dependency_name, tool_dependency_version)[source]
tool_shed.util.tool_dependency_util.handle_tool_dependency_installation_error(app, tool_dependency, error_message, remove_installation_path=False)[source]
tool_shed.util.tool_dependency_util.parse_package_elem(package_elem, platform_info_dict=None, include_after_install_actions=True)[source]

Parse a <package> element within a tool dependency definition and return a list of action tuples. This method is called when setting metadata on a repository that includes a tool_dependencies.xml file or when installing a repository that includes a tool_dependencies.xml file. If installing, platform_info_dict must be a valid dictionary and include_after_install_actions must be True.

tool_shed.util.tool_dependency_util.remove_tool_dependency(app, tool_dependency)[source]

The received tool_dependency must be in an error state.

tool_shed.util.tool_dependency_util.remove_tool_dependency_installation_directory(dependency_install_dir)[source]
tool_shed.util.tool_dependency_util.set_tool_dependency_attributes(app, tool_dependency, status, error_message=None, remove_from_disk=False)[source]

tool_util Module

tool_shed.util.tool_util.build_shed_tool_conf_select_field(app)[source]

Build a SelectField whose options are the keys in app.toolbox.shed_tool_confs.

tool_shed.util.tool_util.build_tool_panel_section_select_field(app)[source]

Build a SelectField whose options are the sections of the current in-memory toolbox.

tool_shed.util.tool_util.copy_sample_file(app, filename, dest_path=None)[source]

Copy xxx.sample to dest_path/xxx.sample and dest_path/xxx. The default value for dest_path is ~/tool-data.

tool_shed.util.tool_util.copy_sample_files(app, sample_files, tool_path=None, sample_files_copied=None, dest_path=None)[source]

Copy all appropriate files to dest_path in the local Galaxy environment that have not already been copied. Those that have been copied are contained in sample_files_copied. The default value for dest_path is ~/tool-data. We need to be careful to copy only appropriate files here because tool shed repositories can contain files ending in .sample that should not be copied to the ~/tool-data directory.

tool_shed.util.tool_util.generate_message_for_invalid_tools(app, invalid_file_tups, repository, metadata_dict, as_html=True, displaying_invalid_tool=False)[source]
tool_shed.util.tool_util.get_headers(fname, sep, count=60, is_multi_byte=False)[source]

Returns a list with the first ‘count’ lines split by ‘sep’.

tool_shed.util.tool_util.get_tool_path_install_dir(partial_install_dir, shed_tool_conf_dict, tool_dict, config_elems)[source]
tool_shed.util.tool_util.handle_missing_index_file(app, tool_path, sample_files, repository_tools_tups, sample_files_copied)[source]

Inspect each tool to see if it has any input parameters that are dynamically generated select lists that depend on a .loc file. This method is not called from the tool shed, but from Galaxy when a repository is being installed.

tool_shed.util.tool_util.is_column_based(fname, sep='\t', skip=0, is_multi_byte=False)[source]

See if the file is column based with respect to a separator.

tool_shed.util.tool_util.is_data_index_sample_file(file_path)[source]

Attempt to determine if a .sample file is appropriate for copying to ~/tool-data when a tool shed repository is being installed into a Galaxy instance.

tool_shed.util.tool_util.new_state(trans, tool, invalid=False)[source]

Create a new DefaultToolState for the received tool. Only inputs on the first page will be initialized.

tool_shed.util.tool_util.panel_entry_per_tool(tool_section_dict)[source]
tool_shed.util.tool_util.reload_upload_tools(app)[source]

workflow_util Module

Tool shed helper methods for dealing with workflows - only two methods are utilized outside of this modules - generate_workflow_image and import_workflow.

class tool_shed.util.workflow_util.RepoToolModule(trans, repository_id, changeset_revision, tools_metadata, tool_id)[source]

Bases: galaxy.workflow.modules.ToolModule

classmethod from_dict(Class, trans, step_dict, repository_id, changeset_revision, tools_metadata, secure=True)[source]
classmethod from_workflow_step(Class, trans, step, repository_id, changeset_revision, tools_metadata)[source]
get_data_inputs()[source]
get_data_outputs()[source]
type = 'tool'
class tool_shed.util.workflow_util.RepoWorkflowModuleFactory(module_types)[source]

Bases: galaxy.workflow.modules.WorkflowModuleFactory

from_dict(trans, repository_id, changeset_revision, step_dict, tools_metadata, **kwd)[source]

Return module initialized from the data in dictionary step_dict.

from_workflow_step(trans, repository_id, changeset_revision, tools_metadata, step)[source]

Return module initialized from the WorkflowStep object step.

tool_shed.util.workflow_util.generate_workflow_image(trans, workflow_name, repository_metadata_id=None, repository_id=None)[source]

Return an svg image representation of a workflow dictionary created when the workflow was exported. This method is called from both Galaxy and the tool shed. When called from the tool shed, repository_metadata_id will have a value and repository_id will be None. When called from Galaxy, repository_metadata_id will be None and repository_id will have a value.

tool_shed.util.workflow_util.get_workflow_data_inputs(step, module)[source]
tool_shed.util.workflow_util.get_workflow_data_outputs(step, module, steps)[source]
tool_shed.util.workflow_util.get_workflow_from_dict(trans, workflow_dict, tools_metadata, repository_id, changeset_revision)[source]

Return an in-memory Workflow object from the dictionary object created when it was exported. This method is called from both Galaxy and the tool shed to retrieve a Workflow object that can be displayed as an SVG image. This method is also called from Galaxy to retrieve a Workflow object that can be used for saving to the Galaxy database.

tool_shed.util.workflow_util.get_workflow_module_name(module, missing_tool_tups)[source]
tool_shed.util.workflow_util.import_workflow(trans, repository, workflow_name)[source]

Import a workflow contained in an installed tool shed repository into Galaxy (this method is called only from Galaxy).

tool_shed.util.workflow_util.save_workflow(trans, workflow, workflow_dict=None)[source]

Use the received in-memory Workflow object for saving to the Galaxy database.