 The initial version of the Galaxy Raver that is created with the Plenimo toolnet begins with the tool tag. This contains the ID and the name that we specified in Plenimo toolnet, as well as something called Python template version. Python template version is not required as we will instead be changing it to Profile. This is the minimum version of Galaxy that is recommended to use this tool. Beginning in 19.05, that does also specify the minimum Python version and therefore we can delete it and instead replace it with Profile 20.01. Next we will add a description to the tool. This is a very basic tag that simply adds help text to the beginning of the tool and is displayed in the toolbar to more easily identify the purpose of the tool. Next we are going to add the macros tag. The macros tag has two possible functions. One is to add XML tags that are repeatable throughout the wrapper, which we will not be getting into in this video, however it is described in the training. The other function is to add repeatable plain text elements. Here we are going to create the token, the tool version, and version suffix. These allow us to very easily update the tool's wrapper when the tool releases a new version or the wrapper itself needs to be edited. In case the tool itself increases in version, the tool version string is iterated. When it is simply the Galaxy wrapper that has changed, it is the version suffix that is iterated. The requirements section in this case is used to list all of the BioKonda and KondaForge packages as well as their versions that will be used in this tool. Here we will be using two different packages. First is of course Balerifon. This is version 1.0, however we will be using the token tool version that we wrote before in the macros section to specify the versions. This means again that we only have to iterate the tool version in one place as the tool itself increases in version. The other package that we will be using is SamTools. The most recent version of SamTools at the time of recording is 1.12, and we will therefore set that as the version string. For now we will be skipping the command section as variables used in the command sections are created in the inputs and outputs tag sections. The input section is where a user is able to input the values for specific parameters in the GUI. Here we directly translate all of the specific parameters that are exposed to the user as listed in the help section. Here there are three parameters that should be accessible to the user. Those are forward, reverse, and quality. Output will be set as part of the command but not directly shown to the user. Threads, log level, and version should not be exposed to the user either and therefore will not be included in the inputs section. The first parameter is forward. Now here we will set the name which we will use to refer to this variable internally within the command section. Then we will set the variable type which in this case is an input file and therefore we put data. As well as the format of that file which can either be a name sorted BAM file or a SAM file. We also set the label which is the name of the variable that will be shown to the user as well as some help text. Now normally we could also set an attribute called argument here. Argument simply shows to the user what the actual flag that would refer to this variable would be in this case. However since the name of the variable is the same as the long flag for the variable we can simply change the name attribute to argument. As well as adding the flag's dashes. We will then repeat this in this case I'm simply copying and changing out text for reverse. As I said before although the next parameter listed in the help section is output we will be specifying an output file manually in the command section. And therefore the next parameter in the inputs section is quality. Similarly to before we set up a parameter and label it with an argument. However the type this time is an integer and therefore we specify that as the type. Other input formats are available and those are listed in the galaxy help section or in the associated training. As this is a required input we set a default value so this will show up in the GUI as a pre-filled in text box. However if we didn't want that to be a default and we wanted the user to be able to skip this we could always set this as optional instead. We will however be leaving this as the default value of 20. Next is the output section. The output section tells galaxy how to find any and all outputs from a job you wish given to the user at the end of its running. Sometimes there may be multiple files however in this case there is only one. Because of that we are able to simply say find the single output file that is of format BAM that is in the working directory. For more information on how to generate different outputs multiple outputs and how to find and generate outputs for files with automatically generated names. Please check out our documentation or the tutorial associated with this video. Next is the command section where the actual commands that is run within the galaxy environment will be assembled using variables set in the inputs and output sections. Bash commands and some meta logic and variables. You can see here that I'm using a pound sign and then if this is to communicate with the Python interpreter cheetah that runs within this command section. This is simply allowing me to create an if statements that will not be represented in the final version of the command. So here I am checking the file type of the input forward that is set in the inputs section. And if it is type SAM I perform one action otherwise another one. All meta sections that use cheetah must be concluded with an end and then the type of command for example with a for loop you would have a for and then and for. There's also else if commands. The next cheetah command I'm using is set this allows me to create a local variable that is not generated within the inputs or outputs sections and allows me to use that variable elsewhere in this command. Then I use the bash commands to create a sim link between the forward input variable file. And the variable that I set with the set command for forward input dot Sam. Anytime a full bash command is used it must be concluded with a logical and to continue to link together the commands into one long bash script. Since the logic gates for the forward and reverse files are so similar I'm simply copying and pasting this and switching out variable names. And then I will be adding the ends. This means that the final version of the command that will run will only be two of these four lines. Two sim links created one for the forward one for the reverse none of the cheetah commands will show up in the final bash command. Now it can create the actual Balerophon commands that will come after the sim links are generated. We call Balerophon which is available because it was listed in the requirements as a package. And then we feed it the parameters as we would on the command line. So I hand it the forward flag and then give it the variable we set forward input. So it hands it the file that the user input and the GUI. We do the same with the reverse now reverse input which we set as a sim link. Then we set the quality which will input the integer that the user requested. Next we manually set the output file. This is that we can much more easily hand it to the next command which will be SAM tools in order to sort. And we have a specific file name to pass to that. Again we link the command to the double and in a single script. And we sample sorts that it comes out as a sorted BAM file. And we tell that to output the out file that we specified in our outputs. So this way Galaxy knows exactly where to look for that file. Finally we handed a reserved variable within this command environment which is Galaxy Slots. And that simply allows the administrators to specify threading used for this tool. And with that the command section is complete. Now as we're writing the tests for this tool I will show you the current structure of the test data folder. Which includes all of the files I will be using in the tests for this tool. Functionally the tests section in a Galaxy wrapper simply allows Plenimo, which will be discussed in the next section of this talk, to simulate a run of this tool with specified inputs and create outputs. And compare outputs to specific criteria including test files. Here we will be creating two tests. First in the case of a BAM input and second in the case of a SAM input. Here you see me telling Galaxy exactly how many output files to expect to detect. This is especially useful when you have tools where you are not certain how many files may be returned. Or in the case where you might have filters for specific inputs that give different numbers of file outputs. However in this case it is just good form to list the number of expected files. Next using the same parameter names as in the input section I set the actual values for each of the input parameters. For files I have to specifically use file names that exist within the test data folder. So here I am setting the forward file to be forward dot BAM. And I will be setting the reverse to be reverse dot BAM. I tell it specifically what file type to read this file as. As some file types have overlap in how they are read. For example tabular versus TSV or BAM versus a name sorted BAM. I also set the quality flag. Now because I set a value, a default value for the quality flag in the input section technically I do not have to set this with a value of 20. Because if I did not put anything here it would simply run with a quality value of 20. Finally I tell it what file in my test data folder to compare the output out file that we specified in the output section that returns from the tool. In this case I say compare the file that returns from this tool to my merged out dot BAM file. And I also tell it to double check that the file format that is returned from my tool is a BAM file. Since I also want to test the ability of this wrapper to take in SAM files I'm going to simply copy and paste this existing test. Change out the test data for my SAM files and compare them to my merged SAM dot BAM file. And manually set the data type of the new input files as SAM instead of name sorted BAM files. I will also just to double check that there are no problems with the quality flag switch out for a non-default value. These tests will be run in the next portion of this video which covers Plenimo. The next section is the help section which will display in markdown format help text at the bottom of the tool. This can be used to link out to tool documentation if you'd like or it could just simply be a more in-depth description of how the tool works. This is also a place where you can put any notes about the wrapper that you wish for users to know. As this is just a very basic tool we will be putting a modified version of the help text from the original tool here that gives a little bit more attribution to its source. Finally we have the citation section which allows us to very easily use either DOI or BibTek format to link directly from the tool wrapper to all relevant sources for the tool. In this case we will be citing the VGP paper for which this wrapper was generated and we can simply copy and paste a DOI as plain text between the tags. For more instructions on how to use a BibTek format you can find that in the attached tutorial. Lastly we also ensure that we use the proper formatting for wrapper versioning in this wrapper. For this we are going to be using the tool version and version suffix that we set in the macros and the final format should read as the tool version plus galaxy and then the galaxy version which is the version suffix so the string should look like this. Finally before we move to planemo usage I will show you how to add this tool wrapper to your local galaxy toolbox. To do this you are going to go to the config directory within galaxy and edit the file toolconf.xml. Looking in your config directory you might only have toolconf.xml.sample. This is my copy of toolconf.xml.sample that I have previously edited for my own personal usage and you can do the same to change your available tools. You can add sections to your tool panels so in this case we will be adding the section GCC which will show up on your toolbar as GCC tools. And then I will point this to the file that holds my tool wrapper which is mytools balerifon balerifon.xml. From now on when I start up galaxy this tool will appear at the bottom of my toolbar and I can access it whenever I would like.