layout: true class: inverse, middle, large --- class: special # Intro to Galaxy Tools slides by @martenson .footnote[\#usegalaxy / @galaxyproject] --- class: larger ## Please Interrupt! We want and will answer your questions. --- # The Problem > You have written a Python script to analyze data and you want to share it with command-line averse colleagues # The Solution Integrate the script as a tool into (your) Galaxy server. --- # Requirements * Have or write command line executable. * Determine inputs and outputs of the tool. * Describe the tool to Galaxy. * Instruct Galaxy to load the tool. --- class: normal # What is a Galaxy tool? - Set of resources that describes how to display and execute software. - Cornerstone of Galaxy tool is a `tool wrapper` written in XML. - Galaxy loads tools from configuration files (also XML). - The basic one is `tool_conf.xml`. - The `tool_path` in `galaxy.ini` specifies filesystem path where to search for tools (defaults to `tools/`). ??? Wrapper can be written in .yml also. --- # Tool Syntax The XML wrapper follows a [schema](https://docs.galaxyproject.org/en/latest/dev/schema.html). simplified: * requirements * command * inputs * outputs * test * help * citation --- class: smaller # Tool example (hashing tool) ```xml
on a dataset
secure_hash_message_digest.py --input "${input1}" --output "${out_file1}" #if $algorithms.value: #for $algorithm in str( $algorithms ).split( "," ): --algorithm "${algorithm}" #end for #end if
``` --- # Tool example (hashing tool) You need few more things: - Add the wrapper to the `tools/` folder. - Add script `secure_hash_message_digest.py` to the same folder. - Add the following `
` to the `tool_conf.xml`. - Restart Galaxy. ??? If you use `
` you do not have to restart Galaxy for the tool to load. --- # Planemo [Command-line utilities](http://planemo.readthedocs.io/) to ease the development of tools. ```shell $ planemo lint $ planemo test $ planemo serve ``` [Full list of commands](http://planemo.readthedocs.io/en/latest/commands.html) --- # Building a tool using Planemo This time connect with ``` ssh -L 9090:localhost:9090 galaxyguest@YOUR_VM ``` and then run ``` sudo apt-get install seqtk ``` Please follow the exercise at [Planemo documentation](http://planemo.readthedocs.io/en/latest/writing_standalone.html).