View markdown source on GitHub

Introduction to the ToolFactory tutorial.

Contributors

Authors: Ross Lazarus avatar Ross Lazarus

Objectives

last_modification Published: May 26, 2021
last_modification Last Updated: Jan 24, 2023

What is the ToolFactory?

Speaker Notes

The ToolFactory is a Galaxy tool for developers and scientists who routinely write their own analysis code. It generates fully functional, toolshed-ready tools. Supplied with a working command line script, it can generate a new Galaxy tool that “wraps” that script. Scripts useful to other scientists can be widely shared through any toolshed.


BYO programming skills

Speaker Notes

Programming skills are needed to make any new Galaxy tool. The ToolFactory automatically generates wrapper code, but does not write the script. If you routinely create generalisable, working analysis code, the ToolFactory can help share your work as real Galaxy tools.


The ToolFactory needs a working command line script to be useful

Speaker Notes

The ToolFactory can help turn working scripts into new Galaxy tools. Any scripting language available in Conda will work. Positional or “Argparse” style command line parameter passing can be used. The generated tool will not work if the script was broken to start with. Without a working script, it is about as useful as a chocolate teapot.


What does the developer need to do ?

Speaker Notes

The developer prepares a working script and input samples. The sample input files are uploaded to a Galaxy history. The completed ToolFactory form collects all the information needed to generate a new tool. The samples become the inputs for the built-in test.


What happens when the ToolFactory is executed?

Speaker Notes

An XML tool wrapper is generated in the history. The new tool is installed in the local server. It is ready to run locally. It looks and acts just like any manually prepared Galaxy tool.


What happens when a new tool is updated with the planemo_test tool ?

Speaker Notes

The Planemo test and lint reports and a copy of the generated XML wrapper and a log file are returned. The tested toolshed archive is ready to share if the tests and linting passed.


Easy and quick to learn, but limited compared to manual tool wrapping.

Speaker Notes

Although a code generator is easy to learn to use, it is limited to relatively simple scripts. Many Conda packages require complexities that no code generator can provide. Hand written code is required. Scripts can sometimes be adapted to work around the many limitations of the code generator.


The big picture

Galaxy as an IDE for tools with the ToolFactory

Speaker Notes

Galaxy can serve as a persistent integrated tool development environment. The developer supplies all the details for the new tool on the form, including a known good script with test data. Clicking “Run Tool” on the form runs a Galaxy job. It generates the new tool wrapper, writing it to the history and installing it in the local Galaxy. ToolFactory jobs are like any other jobs - clicking the redo button will recreate the form used. The developer can return to adjust the form and generate an updated tool at any time. In this way, tools can easily be maintained as long as the job that generates them is saved.


If you got this far

Speaker Notes

If you would like to learn more about the ToolFactory, there is a far more detailed introduction and hands-on tutorial available. We hope you will enjoy learning about and using the ToolFactory in your work.


Key Points

Thank you!

This material is the result of a collaborative work. Thanks to the Galaxy Training Network and all the contributors! Galaxy Training Network Tutorial Content is licensed under Creative Commons Attribution 4.0 International License.