Question: Is it possible to add a script to a workflow?
gravatar for kevanlynch
3.8 years ago by
kevanlynch30 wrote:

So I am new to Galaxy but I was wondering, is it at all possible to make a previously made script an element of a Galaxy workflow?

galaxy • 1.3k views
ADD COMMENTlink modified 3.8 years ago by fubar1.1k • written 3.8 years ago by kevanlynch30
gravatar for Jennifer Hillman Jackson
3.8 years ago by
United States
Jennifer Hillman Jackson25k wrote:


To use a script within a Workflow itself, it should be wrapped into a tool. To use a script to execute the Workflow (alone or along with other scripts you may have), use the API.

I hope this addressed your question, but let us know if you need more help. Jen, Galaxy team

ADD COMMENTlink written 3.8 years ago by Jennifer Hillman Jackson25k

It did thanks very much. I was asking about using a script in the workflow itself so thanks to your answer I was able to find this tutorial

ADD REPLYlink written 3.8 years ago by kevanlynch30

Good news, that is the right place for help to wrap a new tool up. Thanks, Jen

ADD REPLYlink written 3.8 years ago by Jennifer Hillman Jackson25k
gravatar for fubar
3.8 years ago by
fubar1.1k wrote:

If you only need a unix style 'filter' for your workflow (one input, one output, no parameters for your script), please check out the Tool Factory. If you need fixed or user configurable parameters and/or multiple input files, try the tool factory 2? 


The Tool Factory ( is a specialised Galaxy tool for running scripts (python/perl/bash/R) in Galaxy and (once they work with test data) creating a toolshed repository which can be uploaded into a tool shed to allow automated installation of the new tool (which runs the script) to any Galaxy for use in any workflow.

The entire script-to-running_tool process of converting an (trivial example) R script to use the BH procedure to 'adjust' some p values into a tool shed repository and then installing the generated tool from the toolshed back into Galaxy and then running it (NOT the tool factory this time but the newly installed freshly generated new tool!) is shown at 

That video is > 2 years old, rushed and compresses a lot into less than 8 minutes so might be confusing at first. Worse, it keeps mentioning the test toolshed - please ignore that and use the main one. There are lots of steps, and it involves a development galaxy/toolshed on your own workstation so you are an admin...

The Tool Factory is available in two versions you can find on the main toolshed through the admin menu - search for 'factory' - there's the 'original' publication tool factory which is restricted to simple 'filter' style scripts (one input file, one output file..) and tool factory 2 which is a substantially more flexible version that allows specification of the R/perl/python dependency package to run for reproducible research, arbitrary numbers of input files and optional user editable parameters for your script. Be warned that the additonal flexibility comes at the price of increased complexity in parameter passing, but both versions of the tool factory offer example code in each scripting language on the tool form. A very complicated example of converting an R script into a tool developers can use to prepare some of the tool_dependency.xml required to find all the R/BioC package tarballs required as dependencies for a particular R/BioC library can be seen at


Neither version should be installed into any production Galaxy because unrestricted scripting is potentially a huge security hole - although only administrators can actually execute the tool factory and generated tools are secure (assuming the scripts themselves are secure!). 


Bug reports and suggestions are welcomed - probably best to use the new git repo at

ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by fubar1.1k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 168 users visited in the last hour