 Hi, I'm Ios, I'm a Galaxy developer. Today I will walk you through the workflow parameters tutorial. And I will first show you how to use simple parameters. Then I will show you how you can take a parameter and create other parameters from it. And then I'll show you how to read parameters from a data set so that you can calculate things in your workflow and then use the values that you've calculated in the next step. All right, so let's pull up the training material. So the tutorial is under using Galaxy and managing the data, workflows using workflow parameters. All right, so yeah, I mean, you probably know that workflows are really cool feature in Galaxy and you can easily and quickly put steps together. And in order to reuse the workflow, you want to parameterize it. So think of your workflow as a sort of program and you want to define your inputs, your outputs. And parameters are an important part of this. And specifically, we're talking about non-data set parameters here like text parameters, integer values, float values, Booleans, false true, colors, and more parameters that we will add later. All right, so for the interest of time, this workflow starts from an existing workflow. So we've got to import this particular workflow. So let's copy the link right here, go to workflows, go to import, paste the URL for the workflow here. And that's it. Now we're being redirected to the list of workflows. And hopefully, the workflow has imported successfully. All right, there we go. So the workflow is called Select First and Lines. Yeah, so let's have a look at this one. OK, cool. So it's a very, very simple workflow. You have an input data set here. And then you run the Select First tool on that particular input data set. And you probably, maybe you know this tool. I mean, it just literally takes the first lines from the data set. And you can put the number of lines that you want to take from the beginning right here. So that's great. And if you run the workflow, it'll just do that one thing. But maybe you want to parameterize this. So what you can do there is you can add a simple input used for workflow logic. This is the kind of work for parameters I'm mostly talking about here. And this is a number. So it's a whole number. It's an integer value. So instead of a text, let's say we use an integer here. And let's say number of lines to cut. We just labeled this so we know what it is. Let me pull up the tutorial right here to make sure that I'm not doing something else. Yep. OK, so what we're doing next is we go back to the Select First tool. We click on this little button right here. So if you hover over it, it says Add Connection to Module. That's what we want to do. And you see here this little input box has appeared. And now we can connect the parameter we just added right here. So that's it, basically. I can just briefly show you that we have different parameter types. You can select the currently available ones by clicking here and you get a little select field. And also, the editor will be smart enough to know that, OK, you can put a text parameter to an integer value. So let's flip that back to integer. We're going to pull up the training materials again. All right. OK. So that's it. We save the workflow. How we can run it? Actually, in fact, we need an import data set. And of course, we should also name our history. So let's say workflow editor tutorial. Let's add training tag. And we need to add the bit of data. So you have two ways to do this. The upload button are here through the workflow run form. You can also click on the upload button. It's the same thing. And then I believe we were supposed to paste text. Yep. So let's copy that right here. Did that work? I think so. OK, pull that menu back up. So we're just pasting our data here. Yeah. This is text data. I mean, you don't have to set this, but I'm going to do it. So we can close this. While this is still uploading, you can't select the data set here. But quick and dirty trick is you can also just drag it up here. And then you can decide the number of lines you want to take from the beginning. Or did the tutorial say how many lines we want? It doesn't actually run the workflow. But we can do this just to show you that it actually works also. So let's say, I mean, how many lines does this have? 16. All right, cool. So let's say take the first five. And there we go. I mean, this is the workflow submission screen here. It says we successfully started running this workflow. We got our parameter here. We got our inputs here. And you can see the individual steps here. And now we wait. Shouldn't be very long. In fact, the select first to us already running. So if we go on that step, we can look at the job. Hey, it turned okay. Right here, we see the number of lines is five. And if in the history, we expand this also nicely says five lines now. Let's take a look. Yep. That's five lines. All right. Let's move on. So this is the most basic thing. If you want to select text or integers. Maybe noteworthy. To mention is that you can connect text parameters to select fields. So for instance, if you want to select a reference genome, you can use text parameter to connect. All right. So next up, something else. Often you want to add a parameter that the user can set, but it's actually embedded in a larger context. So for instance, yeah, I mean, this example assumes that you're familiar with regular expressions. So say you have this regular expression. That should replace. The word foo. In the word foo bar. And replace foo. With. Something else. And then. Connect that with bar. Also, I said this wrong. So it takes the word foo. And then just appends bar. I mean, there are better ways to do this, but it's, it's just an example to show you how you can take a parameter and add additional things to it. All right. So this time we're creating new workflow. So let's do that. So my connection is not that great. It's all taking a little bit. There we go. So let's call that my silly. Projects workflow. You should definitely give that a better name. All right. There we go. Just a word. I mean, you want to fill this in usually if you like, make your cool, fancy workflow. You can add who you are in the license, but we don't need this for, for the example right here. So we have an input data set. Let's just say. A text. And put. File. We have a parameter. So we want to say, let's say, append this. Value. Again, I mean, these labels are not necessary. I don't think they're part of the tutorial, but I like to do this. Cause it makes it easier to follow what's going on. Okay. Switch back to. Tutorials. We added the input data set. We added the. Simple input. Okay. Then we have a tool that can take different values and just put them together. It's really quite. I mean, it's very simple and very powerful. Once you gather. I mean, creating complex workflows. It'll be more obvious why this is very cool. I still hope you will understand. All right. So that's an expression tool. You can find it here. So this is the compose text parameter. You're from parameters. All right. And so this has this little thing here where you can. Add. Add. Add. Add. Add. Add. Add. Add. Add. And there's this little thing here where you can add components or parts of the. The parameter that we want to compose. Um. So, um, we need to build basically the input field for the find and replace reggae tools. So there are two inputs. One is, um, The reggae itself and the other is the replacement field. It needs to go bracket thing we're looking for in a capture group, that's the bracket. So yeah, I mean, we need to basically prefix it with an opening bracket and a closing bracket. So let's do that. So basically we need three things, right? So we need this one, the opening bracket, we need the closing bracket. And this one here, the user is supposed to add. So let's do that. Okay. And then we need the regex find and replace tool, can find it on the text manipulation. There we go. Yeah, so the first thing is the input data set. So that's this right here. Yep, then we gotta click on insert check. And the find regex is the one we wanna replace. So again, we have to click here on add connection to module and we're connecting this one. So also I skipped glossed over this, but you can select here what the type of the parameter is. So this is text, so it matches. So that's fine, we can connect it. We don't really care about this output, but I think, oh yeah, we need to put the replacement in. Which is the backslash one bar. What that means is take the first captured thing, put it here and then follow up with bar. Yeah, and I always like to also label the outputs I'm interested in. So this is the replaced. Well, let's say replaced data set. All right, let's save this. Have a look at the training material. I'm usually doing what we're supposed to do. Yep, cool, now we can run it. And again, the tutorial tells us what we, what the input data set should be like. Yep, just upload the data set with a contents, wonder, let's wonder for those not speaking German. Again, let's put the text type, doesn't have to do it. And let's get going. And so we wanted to replace Wanda with Wanda bar. So if we type here bar as the value to append, it should hopefully do that. All right, so same submission screen. We can already see the parameters. We have our input here. The outputs will appear as they're being created. Yep, we've got this little output section here. It's a text file. I mean, we can also open up here the data set information. You see a little bit more than you're seeing because I'm administrator on this instance. But yeah, I mean, we see our parameter that we composed, which is the opening bracket bar, closing bracket and the replacement. And this shouldn't take too long. Guess it'll be done pretty soon. All right, that didn't work. What went wrong? Oh, yes, of course. I should have looked at the tutorial. Our input data set here is Wanda. That's great. We're looking for bar, which isn't there. I mean, that doesn't make any sense. I guess I should just read the tutorial better. So the problem was that as the parameter, and you can see that in the work front vocation I showed you earlier, the parameter I used was not the right one, right? It should be Wanda and not bar. So let's do it again. I want to select the thing we just uploaded, which was this one here, number three. Wonder, can check the parameters. Let's, that's not the value we want to append. Oops. It's actually the value we want to replace. But there you go. I mean, let's edit this. The work front is running, replace. So there we go. That is much more correct. Yep. So you can see the label here got updated. It's still running. While it's running, we can maybe have a look at the work front vocations page, which is a list of your current workflow runs. So we see here this one that's currently running. The parameter didn't get updated because this was the previous run. So the label is still wrong. If we'd run the workflow again, you'd get the proper label. All right, maybe let's move on. This is going to finish. Yeah, let's move to the last part. I think, I kind of think this is the most exciting one. So very often you do some things in a workflow and then the next step depends on a specific value that you calculated in the workflow. So you may want to, for instance, normalize the values in a data set based on something else that the workflow did. You want to determine whether the workflow should do this or should do that, depending on whether you're dealing with a certain type of data set or another data set. You want to do quality control and maybe you have a binary value, pass quality control, not pass quality control. All these sort of things you can do, but if it's just written out in a data set in your history, you can't really automatically do something with it. You would have to take the value and paste it into another text field or in another numeric field. And what you want to do actually is take the value from that data set and put it back into the parameter. So yeah, that's what we can do. So let's do this. So this is what we're going to construct here is a workflow that operates on numeric values in a data set. It sums up everything in the first column of the data set. So you get the total sum of the data set and then it's going to use the data mesh operations and temporary data tool. Nope, it's going to use the computing expression on every row tool to take the value in the first column and divide it by the total sum of the data set. So you get fractional values and yeah, add up the fractional values to end up back at one. All right, so let's do that. And yeah, in the meantime, this is also finished. Yay, we've got the window there. All right, so let's move on. I got to create another workflow. Let's say, calculate fractions. All right, so again, we need an input data set. What else do we need? We need the data mesh tool which is in the data mesh section. So this one operations on top of that data. We're not doing any grouping. The only thing we wanna do is we wanna sum column one. Let's connect those two things together. We don't care about the output here. And we need to read the value. So this is under expression tools pass parameter value from data set. Let's connect that up. All right, so this is taking like a total sum and then we want to do this compute and expression on every row. Compute, compute, compute an expression on every row. There we go. All right, so the first thing is the data set that is the input. So that's this one right here. And the expression. So that's kind of the tricky part, right? Oh, right, so what we wanna do is basically C1 divided by the total value in this data set. So let's say 1,200. Except, I mean, obviously we don't know this and that's the whole point. So this is a single text field right here. So the challenges we need to create this field. And as you should remember from the previous part of the tutorial we can compose this text value. So let's go right ahead and do that. So we need to add the compose text parameter tool as well. And what we wanna do here is we want the first component that just says C1 divided. And then this right here, we wanna read from a file. Actually, I mean, we are reading the parameter from the file here. We're passing it in to right here. And then we can replace the expression here with a calculated value from here. We don't care about these outputs. The only thing we really care is this right here, let's give it a label. This is, sorry, wanna label the output, not the step. So let's call this, yeah, fractional values. Okay, let's save this, go ahead and run it. Oh yeah, and of course we need input data again. Let's see what the tutorial is suggesting. All right, so you see, I mean, we wanna sum this up and then divide each value here by the total, which would be fractional values. So let's upload it here. All right, so this is still being processed on the server but let's just go ahead and do this. So there are no user defined values here, right? So we calculate the parameter we wanna add in the last step but the user doesn't have to enter anything. So we can just go right in the head and run it. And the workflow will actually only start scheduling once the input data set is ready. So that's kind of what you saw right here. All right, so first up, data mesh is doing its thing. You can look at the individual steps as well here. So that's just a single output data set that's currently still running. You can see the drops here. Nothing too interesting right now. And then let me maybe mention that we just did one data set here. We only write a single value but this tool works like, so the past parameter value works like any other tool in Galaxy. So that means you can also run it on a collection and if your text file, if you have a text file with a hundred values, you can split that into a collection with a hundred data sets where each value is a single line within the collection. And then you can try a hundred values at once. This is totally possible. All right, okay, so okay. So our output has finally been scheduled. It appeared here. Again, we can look at the data set information here which should already list the parameters that were used. Yep, and then we see it here. C1 divided by a big number. And if we look at the data set itself, we see big number, smaller number. These are the fractions. They should sum up to one. I leave that as an exercise for the reader to verify. So yeah, with that, I hope you see the value in using workflow parameters. They really make it easy to use your workflows in many different situations not having to copy and paste everything or hard code values. So that, yeah, should make it much easier for everybody to go use workflows. So I hope you like this. Bye.