ephemeris package¶
Submodules¶
ephemeris.common_parser module¶
ephemeris.generate_tool_list_from_ga_workflow_files module¶
Tool to generate tools from workflows
-
ephemeris.generate_tool_list_from_ga_workflow_files.generate_tool_list_from_workflow(workflow_files, panel_label, output_file)[source]¶ Return type: object
ephemeris.get_tool_list_from_galaxy module¶
Tool to extract a tool list from galaxy.
-
class
ephemeris.get_tool_list_from_galaxy.GiToToolYaml(url, output_file, include_tool_panel_section_id=False, skip_tool_panel_section_name=True, skip_changeset_revision=False)[source]¶ -
-
get_repo_from_tool(tool)[source]¶ Get the minimum items required for re-installing a (list of) tools
-
get_repositories()[source]¶ Toolbox elements returned by api/tools may be of class ToolSection or Tool. Parse these accordingly to get a list of repositories.
-
merge_tool_changeset_revisions()[source]¶ Each installed changeset revision of a tool is listed individually. Merge revisions of the same tool into a list.
-
toolbox¶ Gets the toolbox elements from <galaxy_url>/api/tools
-
ephemeris.run_data_managers module¶
Run-data-managers is a tool for provisioning data on a galaxy instance.
Run-data-managers has the ability to reload the datatables after a data manager has finished. It is therefore able to run multiple data managers that are interdependent. When a reference genome is needed for bwa-mem for example, Run-data-managers can first run a data manager to fetch the fasta file, reload the data table and run another data manager that indexes the fasta file for bwa-mem.
Run-data-managers needs a yaml that specifies what data managers are run and with which settings. An example file can be found here.
By default run-data-managers skips entries in the yaml file that have already been run. It checks it in the following way: * If the data manager has input variables “name” or “sequence_name” it will check if the “name” column in the data table already has this entry.
“name” will take precedence over “sequence_name”.
- If the data manager has input variables “value”, “sequence_id” or ‘dbkey’ it will check if the “value” column in the data table already has this entry. Value takes precedence over sequence_id which takes precedence over dbkey.
- If none of the above input variables are specified the data manager will always run.
-
ephemeris.run_data_managers.data_table_entry_exists(tool_data_client, data_table_name, entry, column='value')[source]¶ Checks whether an entry exists in the a specified column in the data_table.
-
ephemeris.run_data_managers.get_name_from_inputs(input_dict)[source]¶ Returns the value that will most likely be recorded in the “name” column of the datatable. Or returns False
-
ephemeris.run_data_managers.get_value_from_inputs(input_dict)[source]¶ Returns the value that will most likely be recorded in the “value” column of the datatable. Or returns False
ephemeris.setup_data_libraries module¶
Tool to setup data libraries on a galaxy instance
ephemeris.shed_install module¶
NOTE: While shed-install can be used to run data managers, it is recommended to use run-data-managers instead.
A script to automate installation of tool repositories from a Galaxy Tool Shed into an instance of Galaxy. Galaxy instance details and the installed tools can be provided in one of three ways:
- In the YAML format via dedicated files (a sample can be found here).
- On the command line as dedicated script options (see the usage help).
- As a single composite parameter to the script. The parameter must be a single, YAML-formatted string with the keys corresponding to the keys available for use in the YAML formatted file (for example: –yaml_tool “{‘owner’: ‘kellrott’, ‘tool_shed_url’: ‘https://testtoolshed.g2.bx.psu.edu’, ‘tool_panel_section_id’: ‘peak_calling’, ‘name’: ‘synapse_interface’}”).
Only one of the methods can be used with each invocation of the script but if more than one are provided are provided, precedence will correspond to order of the items in the list above. When installing tools, Galaxy expects any tool_panel_section_id provided when installing a tool to already exist in the configuration. If the section does not exist, the tool will be installed outside any section. See shed_tool_conf.xml.sample in this directory for a sample of such file. Before running this script to install the tools, make sure to place such file into Galaxy’s configuration directory and set Galaxy configuration option tool_config_file to include it.
-
class
ephemeris.shed_install.InstallToolManager(tools_info, gi, default_install_tool_dependencies=False, default_install_resolver_dependencies=True, default_install_repository_dependencies=True, require_tool_panel_info=True)[source]¶ Bases:
object-
create_tool_install_payload(tool_info)[source]¶ For each listed tool (tool_info) we generate a payload that contains all required parameters, filling up missing parameters with user-defined and/or default settings. Return None if a required parameter is missing
-
-
class
ephemeris.shed_install.ProgressConsoleHandler(stream=None)[source]¶ Bases:
logging.StreamHandlerA handler class which allows the cursor to stay on one line for selected messages
-
on_same_line= False¶
-
-
ephemeris.shed_install.dump_to_yaml_file(content, file_name)[source]¶ Dump YAML-compatible content to file_name.
-
ephemeris.shed_install.galaxy_instance(url=None, api_key=None)[source]¶ Get an instance of the GalaxyInstance object. If the arguments are not provided, load the default values using load_input_file method.
-
ephemeris.shed_install.get_install_tool_manager(options)[source]¶ Parse the default input file and proceed to install listed tools. :type options: OptionParser object :param options: command line arguments parsed by OptionParser
-
ephemeris.shed_install.install_repository_revision(tool, tsc)[source]¶ Adjusts tool dictionary to bioblend signature and installs single tool
-
ephemeris.shed_install.installed_tool_revisions(gi=None, omit=None)[source]¶ Get a list of tool revisions installed from a Tool Shed on a Galaxy instance. Included are all the tool revisions that were installed from a Tool Shed and are available from /api/tool_shed_repositories url on the given instance of Galaxy. :type gi: GalaxyInstance object :param gi: A GalaxyInstance object as retured by galaxy_instance method. :type omit: list of strings :param omit: A list of strings that, if found in a tool name, will result
in the tool not being included in the returned list.Return type: list of dicts Returns: Each dict in the returned list will have the following keys: name, owner, tool_shed_url, revisions. See also
this method returns a subset of data returned by installed_tools function
-
ephemeris.shed_install.installed_tools(gi, omit=None)[source]¶ Get a list of tools on a Galaxy instance. :type gi: GalaxyInstance object :param gi: A GalaxyInstance object as retured by galaxy_instance method. :type omit: list of strings :param omit: A list of strings that, if found in a tool name, will result
in the tool not being included in the returned list.Return type: dict Returns: The returned dictionary contains the following keys, each containing a list of dictionaries: - tool_panel_shed_tools with a list of tools available in the
tool panel that were installed on the target Galaxy instance from the Tool Shed; - tool_panel_custom_tools with a list of tools available in the tool panel that were not installed via the Tool Shed; - shed_tools with a list of tools returned from the installed_tool_revisions function and complemented with a tool_panel_section_id key as matched with the list of tools from the first element of the returned triplet. Note that the two lists (shed_tools and tool_panel_shed_tools) are likely to be different and hence not every element in the shed_tools will have the tool_panel_section_id!
See also
installed_tool_revisions (this function also returns the output of the installed_tool_revisions function, as shed_tools key).
-
ephemeris.shed_install.load_input_file(tool_list_file='tool_list.yaml')[source]¶ Load YAML from the tool_list_file and return a dict with the content.
-
ephemeris.shed_install.log_tool_install_error(tool, start, msg, errored_tools)[source]¶ Log failed tool installations
-
ephemeris.shed_install.log_tool_install_success(tool, start, installed_tools)[source]¶ Log successfull tool installation. Tools that finish in error still count as successfull installs currently.
-
ephemeris.shed_install.run_data_managers(options)[source]¶ Run Galaxy Data Manager to download, index, and install reference genome data into Galaxy. :type options: OptionParser object :param options: command line arguments parsed by OptionParser
-
ephemeris.shed_install.the_same_tool(tool_1_info, tool_2_info)[source]¶ Given two dicts containing info about tools, determine if they are the same tool. Each of the dicts must have the following keys: name, owner, and (either tool_shed or tool_shed_url).
ephemeris.sleep module¶
Utility to do a blocking sleep until a Galaxy instance is responsive. This is useful in docker images, in RUN steps, where one needs to wait for a currently starting Galaxy to be alive, before API requests can be made successfully.
The script functions by making repeated requests to
http(s)://fqdn/api/version, an API which requires no authentication
to access.