IRIDA Pipeline Development

This document describes the necessary steps for integrating new pipelines into IRIDA.

1. Introduction

Pipelines in IRIDA take as input data managed by IRIDA and run through a collection of tools to produce some meaningful result. Pipelines are implemented as a Galaxy Workflow and executed using an instance of Galaxy that has been setup for IRIDA. Pipelines are versioned and are stored and distributed either along with the IRIDA software, or as a separate plugin compiled into a Java JAR file. Tools used by a pipeline are versioned and are stored and distributed using Galaxy Toolsheds. In particular, the Galaxy Main Toolshed is used to store and distribute tools for a pipeline.


IRIDA provides support for developing and integrating additional pipelines from Galaxy. This process can be divided into two stages: Galaxy Workflow Development and IRIDA Integration. The necessary steps, in brief, are:

2. Galaxy Workflow Development

Galaxy provides the ability to organize different bioinformatics tools together into a single workflow for producing specific results. These workflows can make use of already existing bioinformatics tools in Galaxy, or can include customized tools which can be distributed using a Galaxy Toolshed.

2.1. Integrate tools into Galaxy

The first step to constructing a pipeline for IRIDA is to make sure the underlying bioinformatics tools are available in Galaxy. You can check the Galaxy Main Toolshed to see if the software you wish to use is available.

If the software does not already exist as an installable tool in Galaxy, then you may have to package the necessary files to integrate into Galaxy yourself. The software package Planemo can be used to construct the necessary wrappers for tools in Galaxy and integrate these into the Galaxy environment. More information on how to develop Galaxy tools with Planemo can be found in the Planemo Building Galaxy Tools section.

Once the necessary wrappers are constructed for Galaxy, these should be integrated into Galaxy Toolshed. This step will allow anyone to install the Galaxy tools into their local Galaxy instance. On upload of a Galaxy tool to the Galaxy Toolshed, a unique id will be assigned to each tool, which is used by IRIDA to specify the exact software to be run in Galaxy. For example, the id for Prokka, which is used for annotation of genomes, is, which includes the name of the toolshed where Prokka can be found

2.2. Develop a Galaxy Workflow

Tools in Galaxy can be linked together to construct a workflow. Galaxy provides a built-in editor for constructing and modifying workflows.


This editor allows for the definition of input files and file types, tools and parameter settings for the tools, as well as which files will be used as output from the workflow. More information on constructing Galaxy workflows can be found in the Galaxy Workflow Editor documentation.

In order for a workflow to properly be integrated into IRIDA, the input and output to this workflow must be in a specific format.

2.2.1. Input Format

IRIDA currently only supports two types of input files: a collection of paired-end sequence reads in FASTQ format, and an optional reference genome in FASTA format.

For the paired-end sequence reads this must be a dataset collection of type list:paired, which will correspond to a list of paired-end FASTQ sequence reads (one entry in the list per each sample/pair of fastq files transferred from IRIDA).


For the optional reference genome, if you wish to use a reference genome, the type must be an input dataset, not a dataset collection. Currently, IRIDA only supports reference genomes in FASTA format.


Please also make note of the names given to each input dataset, in this case sequence_reads_paired and reference, as the names will be used to link up data sent from IRIDA to the Galaxy workflow.

2.2.2. Output Format

Output datasets within IRIDA can be of any file type and there can be many outputs for each workflow. Each output should have a consistent name which will be used by IRIDA to find and download the appropriate file from Galaxy. This can be accomplished by adding a Rename Dataset action to each output file. In this case, for the tool PhyML the name is phylogeneticTree.tre.


In addition, each output dataset should be marked as a workflow output by selecting the asterix * icon, in this case both the output_tree and the csv files from the PhyML and SNP Matrix tools have been selected as output.

2.3. Export Workflow

Once the workflow is written in Galaxy, it can be exported to a file by going to the Workflow menu at the top, finding your particular workflow and selecting Download or Export. This will save the workflow as a *.ga file, which is a JSON-formatted file defining the tools, tool versions, and structure of the workflow.


3. IRIDA Integration

3.1. Write IRIDA workflow files

IRIDA makes use of three files irida_workflow.xml,, and to define the workflow and associated metadata about the workflow.

The easiest way to generate these files is to make use of the irida-wf-ga2xml program. Assuming you already have a file exported from the steps above, you can generate the necessary additional files for IRIDA with:

java -jar irida-wf-ga2xml-1.0.0-SNAPSHOT-standalone.jar \
  -i \
  -o output

This will build the necesary files under output/. As an example:

java -jar irida-wf-ga2xml-1.0.0-SNAPSHOT-standalone.jar -i src/main/resources/ca/corefacility/bioinformatics/irida/model/workflow/analysis/type/workflows/SISTRTyping/0.3/ -n SISTRTyping -t SISTR_TYPING -W 0.1.0 -o output

This will produce the following directory structure:

└── SISTRTyping
    └── 0.1.0
        ├── irida_workflow.xml

NOTE: You may need to edit the output from irida-wf-ga2xml to ensure that only necessary tool parameters are kept in the irida_workflow.xml file and that the proper tool revision is used for each tool if this information is not embedded in your Galaxy Workflow ga file.

3.2. Write IRIDA workflow plugin

IRIDA includes a mechanism for packaging up all the above workflow files into a single JAR file which can be distributed and installed independently of the main IRIDA software. To package up the IRIDA workflow into a JAR file you can start with a template plugin located in irida-plugin-example. An overview of the changes you will need to make is as follows.

3.2.1. Install IRIDA to local Maven repository

In order to compile the IRIDA plugin, you will have to install the main IRIDA code ( to your local Maven repository. This can be accomplished with:

git clone
cd irida
mvn clean install -DskipTests

3.2.2. Download IRIDA plugin example

Once you’ve installed IRIDA to your local Maven repository, you can download the IRIDA example plugin to your machine and begin modifying the files in this project to suite your needs.

git clone
cd irida-plugin-example

3.2.3. Copy workflow files above from output/ to src/main/resources/workflows

You will need to copy over the files generated above to src/main/resources/workflows. The directory structure you should end up with will be:

└── 0.1.0
    ├── irida_workflow.xml

You may (or may not) need to modify these files from the automatically generated versions. A description of each of these files is as follows.

The file contains the workflow structure (generated from Galaxy). An example of the format is as follows:

    "a_galaxy_workflow": "true", 
    "annotation": "", 
    "format-version": "0.1", 
    "name": "Read info", 
    "steps": {
        "0": {
            "annotation": "", 
            "content_id": null, 
            "id": 0, 
            "input_connections": {}, 
            "inputs": [
                    "description": "", 
                    "name": "sequence_reads"
            "label": null, 
            "name": "Input dataset collection", 
            "outputs": [], 
            "position": {
                "left": 200, 
                "top": 200
            "tool_errors": null, 
            "tool_id": null, 
            "tool_state": "{\"collection_type\": \"list:paired\", \"name\": \"sequence_reads\"}", 
            "tool_version": null, 
            "type": "data_collection_input", 
            "uuid": "e267248b-6ddc-4b5e-a476-e805ce1bc4d5", 
            "workflow_outputs": [
                    "label": null, 
                    "output_name": "output", 
                    "uuid": "ae59d874-94ab-4b14-b456-15e2fee2860d"

Normally you will not be required to modify this file. irida_workflow.xml

This file contains information about the particular pipeline installed in IRIDA. An example would be:

<?xml version="1.0" encoding="UTF-8"?>
    <parameter name="Grep1-4-pattern" defaultValue="^@">
      <toolParameter toolId="Grep1" parameterName="pattern"/>
    <output name="hash.txt" fileName="hash.txt"/>
    <output name="read-count.txt" fileName="read-count.txt"/>

Normally this file will be generated for you by irida-wf-ga2xml. A few key elements are:

  1. <id> defines a unique id for the workflow. This must be a UUID. A quick way to generate a random UUID on linux is the command uuid -v 4.
  2. <analysisType> defines what type of analysis this workflow belongs to. This string should match the string defined for the AnalysisType in the Java plugin class defined below.
  3. <sequenceReadsPaired> defines the name of the input dataset in Galaxy for the paired-end sequence reads chosen previously. In this case it is sequence_reads.
  4. <toolParameter> defines how to map parameters a user selects in IRIDA to those in Galaxy (defined in the file).
  5. <output> defines, for an output file, a name in IRIDA and maps it to the name of the file in Galaxy that was chosen previously. In this case it is hash.txt and read-count.txt.
  6. <toolRepositories> defines the different Galaxy ToolSheds from which the dependency tools come from, as well as a revision number for the tool.

Additional details and a description of the syntax of this file can be found in the IRIDA Workflow Description documentation.


If the pipeline outputs an html file, then any custom styling (css) required for the page must be added directly to the html page. There are two ways to do this:

1) Pull directly from a CDN provider by adding <script src="URL_TO_CSS_FILE"></script> to the <head></head> tags in the html output. 2) Add your styles directly in the <head></head> tags as follows: <style> //CSS styles go here </style>

Any javascript required by the page will also need to be either embedded in the html file in <script></script> tags or pulled from a CDN provider by adding <script src="URL_TO_JS_FILE"></script>

This file contains information on the text to display in the IRIDA UI for each pipeline (specifically the en or English text, other languages can be stored in other files). An example of this file is:

pipeline.parameters.modal-title.readinfo=ReadInfo Pipeline Parameters
workflow.READ_INFO.title=ReadInfo Pipeline
pipeline.h1.ReadInfo=ReadInfo Pipeline
pipeline.title.ReadInfo=Pipelines - ReadInfo



The entries like workflow.READ_INFO.title=ReadInfo Pipeline contain the text used to display the pipeline entry on the “Pipelines” page in the UI:


The entries like pipeline.parameters.readinfo.Grep1-4-pattern=Grep1-4-pattern contain information used to display the text when adjusting pipeline parameters:


The Grep1-4-pattern part corresponds to the name attribute under a <parameter> entry in the irida_workflow.xml file:

<parameter name="Grep1-4-pattern" defaultValue="^@">
  <toolParameter toolId="Grep1" parameterName="pattern"/>

3.2.4. Write a Plugin implementation defining some key properties of the pipeline

This is a class which defines configuration for the pipeline and allows IRIDA to load the necessary files. When implementing the pipeline as a plugin this class can be located in any package you wish, and can have any name you wish. You will want to implement the two methods which are indicated as required in this file. You can also override the methods indicated as optional in the file for additional configuration. For an example of a class you can look at This should look like:

public class ExamplePlugin extends Plugin {

	public static final AnalysisType MY_ANALYSIS_TYPE = new AnalysisType("MY_ANALYSIS_TYPE");

	public ExamplePlugin(PluginWrapper wrapper) {

	public static class PluginInfo implements IridaPlugin {

		/*** Required ***/
		public AnalysisType getAnalysisType() {
			return new AnalysisType("READ_INFO");

		public UUID getDefaultWorkflowUUID() {
			return UUID.fromString("79d90ca8-00ae-441b-b5c7-193c9e85a968");
		/*** Optional ***/
		public Optional<Color> getBackgroundColor() {
			return Optional.of(Color.decode("#dd1c77"));
		public Optional<Color> getTextColor() {
			return Optional.of(Color.BLACK);
		public Optional<AnalysisSampleUpdater> getUpdater(MetadataTemplateService metadataTemplateService,
				SampleService sampleService, IridaWorkflowsService iridaWorkflowsService) throws IridaPluginException {
			return Optional.of(new ExamplePluginUpdater(metadataTemplateService, sampleService, iridaWorkflowsService));

		public Optional<String> getAnalysisViewer() {
			return Optional.of("tree");

The purpose of each method is as follows:

3.2.5. (Optional) Implement an Updater class

An Updater class is used to perform post-processing on the resulting files, primarily intended to write back pipeline results into the IRIDA metadata system. Please see the for an example implementation, or the built-in implementations in Implementing this class is optional for your pipeline.

If you do implement this class, you will also want to make sure to update the file with an entry like:

workflow.label.share-analysis-samples.READ_INFO=Save sequence read information to Project Line List Metadata

This contains the message to display asking the user if they wish to Save Results to Samples for their pipeline before launching the pipeline.


3.2.6. (Optional) Set a viewer for analysis results

Your plugin can use one of IRIDA’s built in analysis results viewers by implementing the getAnalysisViewer() method in IridaPlugin.

The viewers available to plugins in IRIDA are the following:

3.3. Update the pom.xml file

You will have to update the pom.xml file in order to set version information and other metadata about your pipeline.

3.3.1. Update the Maven version/info

You will want to update the Maven version/information section for this particular plugin. That is:


Please see the Maven Documentation for more details.

3.3.2. Update the properties section/plugin info

The properties section contains additional information you will have to update. In particular:

<plugin.provider>Aaron Petkau</plugin.provider>


The <plugin.*> entries contain information about your particular plugin as defined by PF4J.

The <irida.version.compiletime> contains the exact IRIDA version this plugin will need to be compiled against (compile-time version).

3.4. Build

Once you’ve made all the updates, you can try building and testing your plugin. To build your plugin, you can run:

mvn clean package

You should find your packaged plugin JAR file in target/ (e.g., target/example-plugin-0.1.0-SNAPSHOT.jar).

4. Test in IRIDA

Once you’ve built your Galaxy workflow and made all the above modifications, you can attempt to load up the pipeline in IRIDA. To do this, please first copy the target/*.jar file to /etc/irida/plugins on a machine with IRIDA installed and restart IRIDA. Your plugin should show up in the Analyses > Pipelines page in IRIDA.


You should also be able to see messages like below in the IRIDA log file when starting up:

INFO org.pf4j.AbstractPluginManager:801 - Plugin 'example-plugin@0.1.0' resolved
INFO org.pf4j.AbstractPluginManager:320 - Start plugin 'example-plugin@0.1.0'
DEBUG - Loaded 1 valid pipeline plugins.