 Hi everyone, my name is Cristobal Gallardo, I'm member of the european galaxy group and in this training I'll show you how to create a galaxy wrapper from zero. For this tutorial it's recommended to have basic knowledge of the linux command line and git. This training is organized in four main sections. The first part will set up the content environment. The second part will create the galaxy tool wrapper by using planemo and the galaxy language server. In the third part will test the galaxy wrapper by using planemo and galaxy. And finally I'll show you how to publish the galaxy wrapper in a public repository. So let's start with the first step, set up the content environment. Conta is an open source closed platform package manager and environment management system. It allows to automate the process of installing, updating and removing package. In addition, conda allows to create separate environments containing files, package and their dependency that will not interact with other environments. So let's install conda. In our case we are using linux, so we need to copy this command, paste in the command line and now execute the bash script. So press enter, accept the license, accept the localization, ok and now we'll set up bioconda, a popular conda channel for bioinformatics software which provides multiple software distribution for computational biology. So let's copy this code and paste in the command line, ok so let's check if conda works, it seems that it's correctly installed, so let's start with the second step. Create the galaxy tool wrapper. We need to download one of the public galaxy tool wrapper repositories. In our case we are going to use the galaxy tools repository hosted by PRGronin. I suggest you to have a look at the realme because it contains quite a lot of information regarding the development of galaxy tools. Such for example you can explain how to create a conda package, also it provides some details about different galaxy tools repositories and so we need to fork this repository, we need to copy the address and clone the repository. This is the repository that we'll use for publishing our wrapper once it's finished. So let's access the repository, let's access the tool folder, if we have a look at the content we can see many different tools and in that folder we create a wrapper. So the next step is to install planemo. Planemo is a complex command line tool whose functions include facilitating the development of galaxy tools. For example the planemo link command allows us to validate the XML files in order to identify common problems. Planemo also allows to generate a graphical interface of a local galaxy instance, which is very useful during the development of tools. So let's install planemo, we need to run the command pip3 install planemo, ok perfect. So let's check, since that works, ok. In order to illustrate this tutorial, we are going to create a wrapper for a useful tool called sectq, among the functionalities of this tool are the conversion of fastq files into FASTA, ok so first let's check if the content package for this tool is available, we need to run the common content search sectq, yeah just a few seconds, perfect the content package is available. So now we should create a new environment in order to avoid conflicts with other previously installed tools, so agree and now we need to activate the environment. The next step is to install the content package of the sectq tool. So it seems that have been installed correctly, perfect. Now we need to create a new folder for the sectq tool and we are going to initialize the galaxy wrapper by using the command planemo tool init, it will generate the basic content. So we need to use the option macros id equal sectq, sec name convert to FASTA, requirement is sectq, version 1.3, example command, we are going to provide a very simple command, now we are going to provide an example input, an example output, 1.FASTA, that information will see later it's very useful for initializing the tool wrapper and finally we need to provide the command for the help section, ok so we see planemo have created two files and a new folder. Now we need to setup the galaxy language server, the galaxy language server is an implementation of the language server written in python to assist in the development of galaxy tool wrappers. We are going to use the visual studio code extension of the galaxy language server, this extension provides xml validation, tags and attributes completion and other extremely useful features, in the readme file the different features are described so I recommend you to have a look at it, ok so let's open the files created by planemo with visual studio code, here we have the macros xml and the main file, so in order to install the extension we need to click in the marketplace, look for the galaxy tools and install, perfect so now we can start writing the wrapper, when writing very simple tools macros xml files are not necessary at all, however it's highly recommended to use xml macros when writing complex tools in order to reduce duplicated xml elements, in the main xml file we can distinguish 5 main sections, the command section, input section, outputs, test and the help section, ok so now the first step is to set the correct format and now we are going to create the input elements, so here we see in the help section each parameter includes the type of variable and a description, we'll use that information for creating the element so by using the galaxy language server we just need to type gx and select the correct type and just we can move between the different fields by using the tabular key, we need to fill each fields with the information provided by the tool, in that case we just need to use the information from the help section, in other cases perhaps you need to have a look at the tool repository but in that case it's not necessary at all, so we are going to create a few inputs, now we are going to create one more boolean gx, now we need to type the argument the false value should be empty, check it false, now the label mark complement and in the help section we are going to include the information effective with minus m, ok so you just need to continue and create the rest of the option but we'll skip that, so let's do some magic, voila, now we'll use other other features of the galaxy language tool in order to generate the command section, so we need to click in b and we need to select generate commands, perfect now we need to pay attention at the order, so we see that the option should be before the inputs and the outputs, we need to remove that option and move the input file and the output files at the end of the command section, so perfect, now we are going to create the test section, test require input data and one simple approach consists in look for datasets in the repository, so we can use that one, we are going to copy this fastq file in our test data folder, we'll rename it as dataset01.fastq and here it is, ok now we have an input dataset next step we are going to generate an output from this input dataset with this simple command this is require for the test section, ok perfect, now we have the input dataset and the output dataset, so now we can check how many lines the size of the output dataset, that information also it's useful for creating the test, ok so now we are going to auto generate the scaffold of the test section by using other of the features of the galaxy language server, in that case we need to select generate test and here it is, the test have been auto generated, so it requires some minimal modification, we can write a command test01 default parameters here in the input parameter we need to type the input dataset that we have previously copied and we are going to set the minus a parameter as true and in that case we are going to use also the previous information in order to fill the assertions and we are going to remove a few lines which are not required at all in that case and also we are going to provide the expected output size which is 430 bytes and delta which is the random variation we are going to set that as 10 and ok so now we have this test is done, so now we are going to create a second test in order to show you a different way of creating a test, in that case we won't use a session but we provide the output file that we have previously generated, so value is test01.FASTA and the expected file type is FASTA, ok so this is done before running the test we are going to include some additional information, for example the citation is also necessary, so the easiest way is just to use a paper related with our tools, copy the toy and we just need to paste the toy in that web page, it will generate the piptext citation, we just need to create an element, citation type piptext and paste the piptext reference, ok so now we are going to create a few additional elements, one of them is the tool version which is very useful in order to make it easier to update the tools when necessary, also we are going to create an element called version suffix, so now we need to replace the version with this token, ok and also in the main XML file we need to replace the version with the tool version token plus galaxy version suffix and also we need to provide the profile which is the required galaxy version, the minimum galaxy version for running that tool, ok and the last element that we need to include in our wrapper is the bio tools element, bio tools is a web portal for tools registry and service monitoring information and the use of idam for precise scientific tool description, the information stored in the bio tool registry will be used in galaxy in order to classify the tools according to their function, so this is also an important task, so we just need to look for our tool in the database, let's see, ok there exists an entry for this tool that's perfect, so let's back, we just need to create a new XML element, xml, name, bio tools, gx and we just need to type the name of the tool and finally we need to expand this macro in the main xml file, ok so we can start with the first step, the first section which is the testing of the galaxy wrapper, before running the test we can validate the wrapper with the command l and now we are going to move to the root folder and we are going to download the galaxy repository, the reason for downloading the galaxy repository is that planemo use galaxy to run the test, so if we don't have the galaxy repository in our system, planemo will download the repository every time we run the test, so we need to copy the ssh address and git clone and paste the address, so now the repository is being downloaded, just be patient, it can take a few minutes, ok so perfect, now let's go back to the folder which contains the wrapper and we can run the test with the command planemo t galaxyroot, we need to specify the path of the galaxy repository and update the test data, now we are running the test that we created a few minutes ago, that first planemo requires to download some dependencies, ok now the tests are running, ok perfect, both tests pass it, so we can have a look at the report generated by planemo, so it includes the information such as the command line and the value of the different parameters, these reports are extremely useful for debugging, so now after running the test the next step is to launch a local galaxy instance in order to check if the tool interface is correct, this is very useful in order to identify mispellings or typos, also to use the galaxy interface is quite useful for debugging and for developing the tool, so once again we are going to use the galaxy repository that we have downloaded previously, ok just a few seconds, ok so the web interface of the local galaxy instance is running, we just need to copy this address and paste it in the browser, so here it is, this is the tool wrapper, you can see it seems quite fine, by using the web interface you can easily identify problems in the labels for example, also let's try to to run the tool by using the web interface, so we are going to upload the input data set which is inside the test data folder, here it is data set 01 start, ok so here is input data set, we can modify some of the parameters and run, now we can check the outputs and compare the inputs and the outputs, yeah we can see the fastq file have been converted in faster format, ok then we can close the web interface and we can move to the fourth step which is publish the wrapper, planemo can be used to publish repositories to the tool sheet, it requires to create a special file called sheet eml, in that case we will use the command planemo sheet init, the sheet file will be used to map the files to the tool sheet, we need to run the command planemo sheet init name, name of the tool owner, in that case since we are using galaxy tools repository the owner is your running description, a short description of the tool long description, so for example tool for converting fastq files into faster files and finally in category which in that case is faster manipulation, ok so let's have a look at the file, you can see it is a very simple file, ok so let's have a look now we need to add the content, so also we need to create a new branch of this repository, need to check out, now we need to commit the chains, in this new branch hit commit, minus m and up to files and we are going to push a wrapper to the repository which we forget previously, so we just need to click and compare and pull request you need to provide a meaningful title, for example add tool sectq and include a description for example dspr include the sectq tool, so that's all, the last step is just create the pull request against the galaxy tools repository, so this is the end of the training, I hope you enjoy, bye