planemo.training package

Submodules

planemo.training.tool_input module

Module contains code for the ToolInput class, dealing with the description of tool in workflow and XML.

class planemo.training.tool_input.ToolInput(tool_inp_desc, wf_param_values, wf_steps, level, should_be_there=False, force_default=False)[source]

Bases: object

Class to describe a tool input / parameter and its value from a workflow.

get_formatted_conditional_desc()[source]

Format the description (label and value) for parameters in a conditional.

get_formatted_desc()[source]

Get the formatted description (ready for hands-on tutorial) of the parameter.

get_formatted_inputs()[source]

Format the inputs of a step.

get_formatted_other_param_desc()[source]

Get value of a ‘simple’ parameter if different from the default value, None otherwise.

get_formatted_repeat_desc()[source]

Format the description (label and value) for parameters in a repeat.

get_formatted_section_desc()[source]

Format the description (label and value) for parameters in a section.

get_lower_param_desc()[source]

Get the formatted description of the paramaters in the ‘inputs’ of the tool description.

planemo.training.tool_input.get_empty_input()[source]

Get the string for an empty input.

planemo.training.tool_input.get_empty_param()[source]

Get the string for an empty param.

planemo.training.tool_input.get_input_tool_name(step_id, steps)[source]

Get the string with the name of the tool that generated an input.

planemo.training.topic module

Module contains code for the Topic class, dealing with the creation of a training topic.

class planemo.training.topic.Topic(name='new_topic', target='use', title='The new topic', summary='Summary', parent_dir='topics')[source]

Bases: object

Class to describe a training topic.

create_topic_structure()[source]

Create the skeleton of a new topic.

  1. create the folder and its structure

  2. update the index.md to match your topic’s name

  3. fill the metadata

  4. add a symbolic link to the metadata.yaml from the metadata folder

exists()[source]

Test if the topic exists.

export_metadata_to_ordered_dict()[source]

Export the topic metadata into an ordered dictionary.

get_requirements()[source]

Get the requirements as a list of ordered dictionaries.

init_from_kwds(kwds)[source]

Init a topic instance from a kwds dictionary.

init_from_metadata()[source]

Init a topic instance from the metadata file.

set_default_requirement()[source]

Set default requirement: Galaxy introduction.

set_paths()[source]

Set the paths to folder and files.

planemo.training.tutorial module

Module contains code for the Tutorial class, dealing with the creation of a training tutorial.

class planemo.training.tutorial.Tutorial(training, topic, name='new_tuto', title='The new tutorial', zenodo_link='')[source]

Bases: object

Class to describe a training tutorial.

create_hands_on_tutorial(ctx)[source]

Create tutorial structure from the workflow file (if it is provided).

create_tutorial(ctx)[source]

Create the skeleton of a new tutorial.

exists()[source]

Test if the tutorial exists.

export_workflow_file()[source]

Copy or extract workflow file and add it to the tutorial directory.

get_files_from_zenodo()[source]

Extract a list of URLs and dictionary describing the files from the JSON output of the Zenodo API.

get_tuto_metata()[source]

Return the string corresponding to the tutorial metadata.

has_workflow()[source]

Test if a workflow is provided for the tutorial.

init_data_lib()[source]

Init the data library dictionary.

init_from_existing_tutorial(tuto_name)[source]

Init a tutorial instance from an existing tutorial (data library and tutorial.md).

init_from_kwds(kwds)[source]

Init a tutorial instance from a kwds dictionary.

prepare_data_library_from_zenodo()[source]

Get the list of URLs of the files on Zenodo, fill the data library, save it into the file.

set_dir_name()[source]

Set the path to dir and files of a tutorial.

write_bibliography()[source]

Write the content of the bibliography file for the tutorial.

write_hands_on_tutorial(add_z_file_links=True)[source]

Write the content of the hands-on tutorial in the corresponding file.

planemo.training.tutorial.format_wf_steps(wf, gi)[source]

Get a string with the hands-on boxes describing the different steps of the worklow.

planemo.training.tutorial.get_hands_on_boxes_from_local_galaxy(kwds, wf_filepath, ctx)[source]

Server local Galaxy and get the workflow dictionary.

planemo.training.tutorial.get_hands_on_boxes_from_running_galaxy(wf_id, galaxy_url, galaxy_api_key)[source]

Get the workflow dictionary from a running Galaxy instance with the workflow installed on it.

planemo.training.tutorial.get_wf_inputs(step_inp)[source]

Get the inputs from a workflow step and format them into a hierarchical dictionary.

planemo.training.tutorial.get_wf_param_values(init_params, inp_connections)[source]

Get the param values from a workflow step and format them into a hierarchical dictionary.

planemo.training.tutorial.get_zenodo_record(zenodo_link)[source]

Get the content of a Zenodo record.

planemo.training.utils module

Module contains code for the Requirement, Reference and some general functions for training.

class planemo.training.utils.Requirement(req_type='internal', topic_name='introduction', title=None, tutorials=None, link=None)[source]

Bases: object

Class to describe a training requirement.

export_to_ordered_dict()[source]

Export the requirement into an ordered dictionary.

init_from_dict(metadata)[source]

Init from a dictionary generated by export_to_ordered_dict.

planemo.training.utils.load_yaml(filepath)[source]

Load the content of a YAML file to a dictionary.

planemo.training.utils.save_to_yaml(content, filepath)[source]

Save a dictionary to a YAML file.

Module contents

Module contains code for gtdk: Galaxy training development kit.

class planemo.training.Training(kwds)[source]

Bases: object

Class to describe a training.

check_topic_init_tuto()[source]

Check that the topic and tutorial are already there and retrieve them.

fill_data_library(ctx)[source]

Fill a data library for a tutorial.

generate_tuto_from_wf(ctx)[source]

Generate the skeleton of a tutorial from a workflow.

init_training(ctx)[source]

Create/update a topic/tutorial.