SlideShare a Scribd company logo
1 of 13
Download to read offline
Writing Galaxy Tools
30 June 2014, GCC2014, Baltimore
Peter Cock1
, Bj¨orn Gr¨uning2
, Greg Von Kuster3
1 James Hutton Institute, Scotland, UK; 2 Albert-Ludwigs-University, Germany; 3 Penn
State University, USA
Wrapping Command-line Tools
• Tell Galaxy what options to show the user
• Galaxy tells your tool the selected input filenames
• Galaxy tells your tool the desired output filenames
• Must tell Galaxy how to invoke the underlying tool...
Heart of each Galaxy tool is an XML file
Core elements:
• <inputs> – parameters/options/files
• <outputs> – output files expected
• <command> – how to turn this into a command line string
Secondary elements:
• <requirements> – tell Galaxy how to find the binaries etc
• <stdio> – what counts as an error?
• <description> – subtitle describing tool
• <help> – instructions to show the end user
• <tests> – functional tests
http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
Heart of each Galaxy tool is an XML file
Example:
<tool id="my_tool" name="My Tool" version="0.0.1">
<command >my_tool "$input1" "$output1"</command >
<description >Run My Tool (patent pending)</description >
<inputs >
<param name="input1" type="data" format="fasta"
label="Sequence in" help="FASTA format." />
</inputs >
<outputs >
<data name="output1" format="fasta"
label="My Tool Results" />
</outputs >
<help >
This is a Galaxy wrapper for My Tool.
</help >
</tool >
http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
The <inputs> and <param ...> tags
• <inputs>...</inputs> contains <param ...> tag(s)
• Each <param ...> tag requires a unique name
• This is used in the <command> and <tests>
• Each <param ...> tag requires a type
• e.g. for type="data" for an input file
• Each <param ...> tag should have a label and help
• These are shown in the user interface
• There are additional type-specific attributes
• e.g. for type="data" add format="..." for file type
http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
The <inputs> and <param ...> tags
Use <param type="???" ...> to control each parameter:
• type="data" – input file (from current history)
• type="text" – any string via a text box
• type="integer" – whole number via a text box
• type="float" – arbitrary number via a text box
• type="select" – Drop down lists, or radio buttons
• type="boolean" – True/false value with checkbox
• type="data column" – Pick column(s) from a tabular file
• ...
http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
The <outputs> and <data ...> tags
• <outputs>...</outputs> contains <data ...> tag(s)
• Each <data ...> tag requires a unique name
• This is used in the <command> and <tests>
• Each <data ...> tag should have an ftype
• e.g. for ftype="fasta" for a FASTA output file
• Each <data ...> tag should have a label
• This is the default dataset description in the history
http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
The <command> tag – basics
• The <command> tag is a command line string template
• Named every input <param ...> and output <data ...>
• Use $name to refer to that input parameter or output file
• Ideally use "$name" in case of spaces in filename
• Can split <command> over multiple lines
• XML so need &amp;, &lt; and &gt;
• Must escape $ to get an actual dollar sign, e.g.
<command >
my_tool --threads $ GALAXY_SLOTS
"$input1" "$output1"
</command >
http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
The <command> tag – advanced
• The <command> tag uses the Cheetah template language
• This can include for loops and if statements, e.g.
<command >
my_tool --threads $ GALAXY_SLOTS
## double hash for comment lines
## single hash for Cheetah syntax
#if $output_choice =="long"
--long
#end if
"$input1" "$output1"
</command >
http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
Advanced parameter options
• Galaxy supports conditional and repeated constructs
• Defined with more XML in the <inputs> section
• Galaxy supports multiple input files as one parameter
• Requires Cheetah syntax in the <command> tag
• Easiest to learn by example?
$ cd galaxy -dist
$ grep "<conditional " tools /*/*. xml
...
$ grep "<repeat " tools /*/*. xml
...
http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
The <help> tag
• Uses reStructuredText markup language
• Blank line for a paragraph break
• Use asterisks for *italics*, double-asterisks for **bold**
• Can include tables, images, links, etc.
<tool id="my_tool" name="My Tool" version="0.0.1">
...
<help >
This is a Galaxy wrapper for *My Tool *.
If you use this tool , ** please cite this paper **:
...
</help >
</tool >
http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
The <stdio> tag
• The <stdio> tag controls error detection
• Galaxy default is any output on stderr means an error (!)
• Unix/Linux convention allows logging etc on stderr
• Unix/Linux convention is non-zero return code means error
For Unix style tools, only check the return code:
<tool id="my_tool" name="My Tool" version="0.0.1">
...
<stdio >
<!-- Anything other than zero is an error -->
<exit_code range="1:" />
<exit_code range=":-1" />
</stdio >
...
</tool >
http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
Further reading
• Functional Tests
• Dynamics captions on output files
• Variable numbers of output files
• Composite datatypes
• Defining new Galaxy datatypes
• Dependencies & The Tool Shed
• Galaxy macros to reduce repetitive XML

More Related Content

What's hot

Enhanced Web Service Testing: A Better Mock Structure
Enhanced Web Service Testing: A Better Mock StructureEnhanced Web Service Testing: A Better Mock Structure
Enhanced Web Service Testing: A Better Mock StructureCRMScienceKirk
 
Large Scale Log Analytics with Solr: Presented by Rafał Kuć & Radu Gheorghe, ...
Large Scale Log Analytics with Solr: Presented by Rafał Kuć & Radu Gheorghe, ...Large Scale Log Analytics with Solr: Presented by Rafał Kuć & Radu Gheorghe, ...
Large Scale Log Analytics with Solr: Presented by Rafał Kuć & Radu Gheorghe, ...Lucidworks
 
code4lib 2011 preconference: What's New in Solr (since 1.4.1)
code4lib 2011 preconference: What's New in Solr (since 1.4.1)code4lib 2011 preconference: What's New in Solr (since 1.4.1)
code4lib 2011 preconference: What's New in Solr (since 1.4.1)Erik Hatcher
 
Solr Black Belt Pre-conference
Solr Black Belt Pre-conferenceSolr Black Belt Pre-conference
Solr Black Belt Pre-conferenceErik Hatcher
 
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UNSolr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UNLucidworks
 
What's new with Apache Spark's Structured Streaming?
What's new with Apache Spark's Structured Streaming?What's new with Apache Spark's Structured Streaming?
What's new with Apache Spark's Structured Streaming?Miklos Christine
 
Lucene's Latest (for Libraries)
Lucene's Latest (for Libraries)Lucene's Latest (for Libraries)
Lucene's Latest (for Libraries)Erik Hatcher
 
Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2Vinaykumar Hebballi
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with SolrErik Hatcher
 
Hacking Lucene for Custom Search Results
Hacking Lucene for Custom Search ResultsHacking Lucene for Custom Search Results
Hacking Lucene for Custom Search ResultsOpenSource Connections
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr DevelopersErik Hatcher
 
Beyond full-text searches with Lucene and Solr
Beyond full-text searches with Lucene and SolrBeyond full-text searches with Lucene and Solr
Beyond full-text searches with Lucene and SolrBertrand Delacretaz
 
Code transformation With Spoon
Code transformation With SpoonCode transformation With Spoon
Code transformation With SpoonGérard Paligot
 
Lucene And Solr Document Classification
Lucene And Solr Document ClassificationLucene And Solr Document Classification
Lucene And Solr Document ClassificationAlessandro Benedetti
 
Property based testing - Less is more
Property based testing - Less is moreProperty based testing - Less is more
Property based testing - Less is moreHo Tien VU
 
Lambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive CodeLambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive CodeIan Robertson
 
Build, logging, and unit test tools
Build, logging, and unit test toolsBuild, logging, and unit test tools
Build, logging, and unit test toolsAllan Huang
 
Recent Additions to Lucene Arsenal
Recent Additions to Lucene ArsenalRecent Additions to Lucene Arsenal
Recent Additions to Lucene Arsenallucenerevolution
 

What's hot (20)

Enhanced Web Service Testing: A Better Mock Structure
Enhanced Web Service Testing: A Better Mock StructureEnhanced Web Service Testing: A Better Mock Structure
Enhanced Web Service Testing: A Better Mock Structure
 
Large Scale Log Analytics with Solr: Presented by Rafał Kuć & Radu Gheorghe, ...
Large Scale Log Analytics with Solr: Presented by Rafał Kuć & Radu Gheorghe, ...Large Scale Log Analytics with Solr: Presented by Rafał Kuć & Radu Gheorghe, ...
Large Scale Log Analytics with Solr: Presented by Rafał Kuć & Radu Gheorghe, ...
 
code4lib 2011 preconference: What's New in Solr (since 1.4.1)
code4lib 2011 preconference: What's New in Solr (since 1.4.1)code4lib 2011 preconference: What's New in Solr (since 1.4.1)
code4lib 2011 preconference: What's New in Solr (since 1.4.1)
 
Calypso browser
Calypso browserCalypso browser
Calypso browser
 
Solr Black Belt Pre-conference
Solr Black Belt Pre-conferenceSolr Black Belt Pre-conference
Solr Black Belt Pre-conference
 
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UNSolr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UN
 
What's new with Apache Spark's Structured Streaming?
What's new with Apache Spark's Structured Streaming?What's new with Apache Spark's Structured Streaming?
What's new with Apache Spark's Structured Streaming?
 
Lucene's Latest (for Libraries)
Lucene's Latest (for Libraries)Lucene's Latest (for Libraries)
Lucene's Latest (for Libraries)
 
Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
 
Hacking Lucene for Custom Search Results
Hacking Lucene for Custom Search ResultsHacking Lucene for Custom Search Results
Hacking Lucene for Custom Search Results
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
 
Beyond full-text searches with Lucene and Solr
Beyond full-text searches with Lucene and SolrBeyond full-text searches with Lucene and Solr
Beyond full-text searches with Lucene and Solr
 
Code transformation With Spoon
Code transformation With SpoonCode transformation With Spoon
Code transformation With Spoon
 
Lucene And Solr Document Classification
Lucene And Solr Document ClassificationLucene And Solr Document Classification
Lucene And Solr Document Classification
 
High Performance Solr
High Performance SolrHigh Performance Solr
High Performance Solr
 
Property based testing - Less is more
Property based testing - Less is moreProperty based testing - Less is more
Property based testing - Less is more
 
Lambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive CodeLambda Chops - Recipes for Simpler, More Expressive Code
Lambda Chops - Recipes for Simpler, More Expressive Code
 
Build, logging, and unit test tools
Build, logging, and unit test toolsBuild, logging, and unit test tools
Build, logging, and unit test tools
 
Recent Additions to Lucene Arsenal
Recent Additions to Lucene ArsenalRecent Additions to Lucene Arsenal
Recent Additions to Lucene Arsenal
 

Similar to Writing Galaxy Tools XML Configuration

Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming LanguageSteve Johnson
 
gdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptxgdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptxsandeshshahapur
 
Gift-VT Tools Development Overview
Gift-VT Tools Development OverviewGift-VT Tools Development Overview
Gift-VT Tools Development Overviewstn_tkiller
 
Developing web apps using Erlang-Web
Developing web apps using Erlang-WebDeveloping web apps using Erlang-Web
Developing web apps using Erlang-Webfanqstefan
 
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal ApproachProject FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal ApproachIvo Neskovic
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to ElasticsearchSperasoft
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
 
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Guillaume Laforge
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersAlessandro Sanino
 
BITM3730 10-3.pptx
BITM3730 10-3.pptxBITM3730 10-3.pptx
BITM3730 10-3.pptxMattMarino13
 
TEMPLATES IN JAVA
TEMPLATES IN JAVATEMPLATES IN JAVA
TEMPLATES IN JAVAMuskanSony
 
Javascript done right - Open Web Camp III
Javascript done right - Open Web Camp IIIJavascript done right - Open Web Camp III
Javascript done right - Open Web Camp IIIDirk Ginader
 
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next LevelMWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Levelbalassaitis
 

Similar to Writing Galaxy Tools XML Configuration (20)

Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming Language
 
C Sharp Course 101.5
C Sharp Course 101.5C Sharp Course 101.5
C Sharp Course 101.5
 
gdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptxgdscWorkShopJavascriptintroductions.pptx
gdscWorkShopJavascriptintroductions.pptx
 
Gift-VT Tools Development Overview
Gift-VT Tools Development OverviewGift-VT Tools Development Overview
Gift-VT Tools Development Overview
 
Angular2
Angular2Angular2
Angular2
 
Meta Object Protocols
Meta Object ProtocolsMeta Object Protocols
Meta Object Protocols
 
Developing web apps using Erlang-Web
Developing web apps using Erlang-WebDeveloping web apps using Erlang-Web
Developing web apps using Erlang-Web
 
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal ApproachProject FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
 
Extensible markup language attacks
Extensible markup language attacksExtensible markup language attacks
Extensible markup language attacks
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
Struts2
Struts2Struts2
Struts2
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to Gophers
 
BITM3730 10-3.pptx
BITM3730 10-3.pptxBITM3730 10-3.pptx
BITM3730 10-3.pptx
 
TEMPLATES IN JAVA
TEMPLATES IN JAVATEMPLATES IN JAVA
TEMPLATES IN JAVA
 
Javascript done right - Open Web Camp III
Javascript done right - Open Web Camp IIIJavascript done right - Open Web Camp III
Javascript done right - Open Web Camp III
 
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next LevelMWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
 
Oops lecture 1
Oops lecture 1Oops lecture 1
Oops lecture 1
 

Recently uploaded

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Writing Galaxy Tools XML Configuration

  • 1. Writing Galaxy Tools 30 June 2014, GCC2014, Baltimore Peter Cock1 , Bj¨orn Gr¨uning2 , Greg Von Kuster3 1 James Hutton Institute, Scotland, UK; 2 Albert-Ludwigs-University, Germany; 3 Penn State University, USA
  • 2. Wrapping Command-line Tools • Tell Galaxy what options to show the user • Galaxy tells your tool the selected input filenames • Galaxy tells your tool the desired output filenames • Must tell Galaxy how to invoke the underlying tool...
  • 3. Heart of each Galaxy tool is an XML file Core elements: • <inputs> – parameters/options/files • <outputs> – output files expected • <command> – how to turn this into a command line string Secondary elements: • <requirements> – tell Galaxy how to find the binaries etc • <stdio> – what counts as an error? • <description> – subtitle describing tool • <help> – instructions to show the end user • <tests> – functional tests http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
  • 4. Heart of each Galaxy tool is an XML file Example: <tool id="my_tool" name="My Tool" version="0.0.1"> <command >my_tool "$input1" "$output1"</command > <description >Run My Tool (patent pending)</description > <inputs > <param name="input1" type="data" format="fasta" label="Sequence in" help="FASTA format." /> </inputs > <outputs > <data name="output1" format="fasta" label="My Tool Results" /> </outputs > <help > This is a Galaxy wrapper for My Tool. </help > </tool > http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
  • 5. The <inputs> and <param ...> tags • <inputs>...</inputs> contains <param ...> tag(s) • Each <param ...> tag requires a unique name • This is used in the <command> and <tests> • Each <param ...> tag requires a type • e.g. for type="data" for an input file • Each <param ...> tag should have a label and help • These are shown in the user interface • There are additional type-specific attributes • e.g. for type="data" add format="..." for file type http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
  • 6. The <inputs> and <param ...> tags Use <param type="???" ...> to control each parameter: • type="data" – input file (from current history) • type="text" – any string via a text box • type="integer" – whole number via a text box • type="float" – arbitrary number via a text box • type="select" – Drop down lists, or radio buttons • type="boolean" – True/false value with checkbox • type="data column" – Pick column(s) from a tabular file • ... http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
  • 7. The <outputs> and <data ...> tags • <outputs>...</outputs> contains <data ...> tag(s) • Each <data ...> tag requires a unique name • This is used in the <command> and <tests> • Each <data ...> tag should have an ftype • e.g. for ftype="fasta" for a FASTA output file • Each <data ...> tag should have a label • This is the default dataset description in the history http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
  • 8. The <command> tag – basics • The <command> tag is a command line string template • Named every input <param ...> and output <data ...> • Use $name to refer to that input parameter or output file • Ideally use "$name" in case of spaces in filename • Can split <command> over multiple lines • XML so need &amp;, &lt; and &gt; • Must escape $ to get an actual dollar sign, e.g. <command > my_tool --threads $ GALAXY_SLOTS "$input1" "$output1" </command > http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
  • 9. The <command> tag – advanced • The <command> tag uses the Cheetah template language • This can include for loops and if statements, e.g. <command > my_tool --threads $ GALAXY_SLOTS ## double hash for comment lines ## single hash for Cheetah syntax #if $output_choice =="long" --long #end if "$input1" "$output1" </command > http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
  • 10. Advanced parameter options • Galaxy supports conditional and repeated constructs • Defined with more XML in the <inputs> section • Galaxy supports multiple input files as one parameter • Requires Cheetah syntax in the <command> tag • Easiest to learn by example? $ cd galaxy -dist $ grep "<conditional " tools /*/*. xml ... $ grep "<repeat " tools /*/*. xml ... http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
  • 11. The <help> tag • Uses reStructuredText markup language • Blank line for a paragraph break • Use asterisks for *italics*, double-asterisks for **bold** • Can include tables, images, links, etc. <tool id="my_tool" name="My Tool" version="0.0.1"> ... <help > This is a Galaxy wrapper for *My Tool *. If you use this tool , ** please cite this paper **: ... </help > </tool > http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
  • 12. The <stdio> tag • The <stdio> tag controls error detection • Galaxy default is any output on stderr means an error (!) • Unix/Linux convention allows logging etc on stderr • Unix/Linux convention is non-zero return code means error For Unix style tools, only check the return code: <tool id="my_tool" name="My Tool" version="0.0.1"> ... <stdio > <!-- Anything other than zero is an error --> <exit_code range="1:" /> <exit_code range=":-1" /> </stdio > ... </tool > http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax
  • 13. Further reading • Functional Tests • Dynamics captions on output files • Variable numbers of output files • Composite datatypes • Defining new Galaxy datatypes • Dependencies & The Tool Shed • Galaxy macros to reduce repetitive XML