 Hi, all. In this video, I will be showing you how to use one of the most interesting features of the Galaxy interface, and one of the quite recently added ones, and specifically how to launch integrated development environments into the interface and specifically that we will be trying and launching our studio. For those who are not aware of it, RStudio is an integrated environment that provides a graphical interface to R and helps put out code and execute code around R, include libraries and so forth. So the first thing to do in order to launch this active environment is to actually start RStudio here. So I've typed RStudio tools, you see that there is an option here, and I click execute right here. So as you can see, a new job is appearing here on my history. I will actually name my history here as RStudio, RStudio lesson. And it might take a bit while to start. At some point it will turn yellow at which page it will be ready to continue. And as you can see, RStudio has just started running. And it's, it's worth noting that as opposed to other jobs. The fact that there is an interactive session and active session running somewhere is indicated by the fact that this is, this will not turn green, but rather stay in an in an order state. So this is RStudio running, but the next question is how can we actually access it. So in order to do that, we go to user menu and you can see here again with the active and active tool section. If I click on that, you see that RStudio is now listed here. And the RStudio name is an active link so I can click on that. And you can see that the RStudio environment is actually popping up into an into a new tab. And you can see the version of R that is running on the back end is version 4.0.2. And there are some general information about the R version of this running on the back end, plus some interesting functions. That we will be touching about later. And you can see that there are, they are able to act as intermediary between the RStudio environment and Galaxy. You can put information from the Galaxy, from RStudio into Galaxy and vice versa. So there is, they can be RStudio can be literally a part of the execution pipeline. Another point that is worth pointing out is that a lot of the quite extensively used packages in R for mathematics are already installed for us on the back end so we don't really need to work on those. So, before we continue on just a quick intro for people who have not seen the interface before. And there are three main parts and there is a fourth one that I will be activating in a bit. Actually, we can start by working on a more formal way. So, this is the console where the commands are being executed and we can put one of them out. For example, I can type here 2 plus 2 and enter and it will print out the sum. So, here you can see that I can put one command after the other. And this type here is the environment and the history. So, the history keeps all the commands that we've been using, we're executing. So, this is where we will be maintaining all our variables. And here on the last on the last on the bottom right. It's the files plots packages and help tab where you can see the files that are already available for us if it was a local installation this will be our local folder. So, we can create plots of the created packages that are already active as you can see here or we can activate and help, which is one of the most critical parts of our and our studio and viewer for some plotting that we can, and if we create one of the most critical for this one. And another panel that's quite useful and I will be starting right now, and is to create a text file a script to be more precise, where we'll be putting our all our commands in one after the other so we can run it. So in order to do that, I go here to file. So, I'm going to set option new file and I click on our script. So as you can see here, we have a brand new brand new file that brand new tab, which actually we can type is enough I can press enters many times as I can. I can type a few things here with some will be touching also in a second. And, and all of these can be captured in a file, and that is can be used as a script. As you can see right now it has no name, plus the actual name is read with the master it means that this is not yet saved. So the first thing that we should do is to actually save it. I can do this through here or by using the shortcut control s. Which will give us the indication of let's actually save this as a script. And for our purposes I'm going to put it as a galaxy. Our basics. And I'm going to save this, and you see that now in our in our files section down here and new file has appeared, which has the extension r. And the reason is that by default, and our studio puts all the scripts as a dot our file. Also you can see here that name have changed. And now this is a script that we can execute. And a few more things about the interface. So as I said earlier here, I can actually drag and drop all those points so it can, we can customize how much of a surface we want for each of those tabs. And for the time being I want to show how we can run a command on the console, one of the easiest commands is type date in parentheses those this is a function. If I press enter you can see that it prints out. The time the date. This video is actually put together. And I think that we can do. So as you can see now I've pasted the command, and I have to press enter and it directly gave me the response. I can do the exact same thing here by putting date and parentheses. And this time around if I press enter, nothing will happen because as I said before this is a file that captures all the commands that we will be using. So what I can do, the idea is, it's much more easy to edit if we put in the text file that we can edit again again, add more commands and make it more structured way. Plus another thing is that we can put comments. So here what I will write is and gives a current date and time. So comments start with the hashtag symbol. And this is online one and everything after the hashtag is completely ignored by our one executing. So here put a comment so that I can remember later on when I review this that what this actual comments going to be doing. And I pressed enter new line, I press the command enter and so forth. And now what I can is I can save it, I press control s, and I can start running one line after the other. So there are three main ways of doing something of executing something I can highlight everything. And then as you can see, there's an about here called run, which if I hover about it says that I can run either the current line or the selection. So here I've selected lines one, two, three and four. So if I run this, you see down here in the bottom that it actually executed the command, the comment first of all, nothing because it's common. The new line, no command. So we just create a new line then the actual command and the output and the new line. I can do this also line by line so I can click this one. So I can do this without the first command that it sees or alternative me. I can shift enter on a particular command. Sorry. And in this case I actually execute this specific line as you can see here so control plus sorry control plus enter. Let me put this in a comment here. And this is the selector, which is the criminal as command plus enter in Mac, if I remember correctly, and this allows us to allows to execute this line only. I'm saving get the script. So this gives some some information. I'm going to try a few more commands here I'll put here for example the deer command I'm going to paste also the session info and like here session info also as you've just seen, and there is the option of help enough so it realized what what is the function trying to type. And it gave me some information as you can see I insist. It gives me already a list of different commands that I can use. I'll press time here and the question and the parentheses and and now I can run it. So for example, I can run them one by one so control and this one. And it actually gives us a listing of our whole of the current working directory and the session info is one of the most useful functions, especially if we want to replicate. And for someone else to replicate our work. It gives a clear information about what is already available what are the libraries that are available for our what are the loaded libraries and everything else. And the last one actually gives us the current time, and it changes up until second so it changes a favorite multiple times and give a new value. And so, again, this is a script, let me say it again, now that it was hired are a good thing to keep in mind is that let me start working directly now on to the script part. Is that are and our studio in that case is case sensitive, which means that when we type something we need to be to be careful how to type. So for example, if I typed system like that. It will give me an error as you can see here that I cannot find functions this time because this is case sensitive. I'll put this as a comment and are is case sensitive. Which is the following command will produce an error. So, and this is how basically we can interact with our studio and just to provide some additional context. And it might be interesting to highlight some basic aspects of our. So one of the first things that might be useful to know is how fast for help. So let's say that we want to to use a function that will round a number to its nearest integer. So let's say round to nearest. The actual function that does that is called round. Sorry, round. If I put pie 3.14, and I execute this by pressing control enter, you see that the output down here is is three. So two points to keep in mind. One point to keep in mind is that this is a function and we know that function because has parentheses in the same context is times a function session inferences function. DIR is a function and date is a function. And as a function, it might expect zero input or one or more. If we want to learn more about how round for example might work with, we can put the question mark round, which basically says, okay, can you give me some information about the function bound by doing that, you see that in this tab down here done right. And we have now more information about how we can use round altogether, not as the function itself, but generally for rounding. So you see that it is ceiling floor trunk round that we were actually looking for an additional information about those and you can see that this round here as well. I can also do rounds specifically for this function. You can give me the same page, because partly it's the same page for both those things. And you can see now that for example round has also an alternative way of request information. In this case, it's not only what is the input, and the number of the one to round, but also how much to how many digits we want to do that. So I can do round 3.414. And this time I want the digits to be one. And if I run this you see that it's rounded up to the two one digit after the dot. And so it's 3.3.1. It's interesting to try different variation of that. And I get some information about this might work so if I do round 3.14159, and I can play for visits equals to it will give me the 314 which is the original value, we can try the same thing with no argument. I can do round 3.14159 and run this and you can see that by default, and the default value is seen here in the help function, and it is provided as output three. If you want to need to look for formal help, this tab right here is your friend. For example, let's say that we want to learn more about t-test. I can type here t-test, press enter, and give me all the information that as you can find around t-test. I can give you some information how it can be used, what are the different functions already available that actually provides information about that. So for example, since I'm here that there is an actual function in the stats packets called t-test, which is the same t-test. If I click on that, it leads me to how it is syntax, what to expect as input, what is the different things that expect as input for the function and so forth. We will be looking all those things specifically when we start working on additional functions for R. The final point is to, as I said earlier, RStudy is very helpful in giving information out. So let's say for example we want to do linear modelling. I can type lm and I can start looking for information about that. So what I did, I typed lm and pressed tab. As soon as I pressed tab, you see that RStudy popped up with the different aspects, the different ways that we can use lm and also if I hover over each of those, it gives you information about its works. So here we see that the base function lm is used to fit linear models and expects a formula, a data, subsets, weights and so forth. And also it gives us information about what are the default values. For example, the default method is QR and we can change different aspects of the whole thing. So this is a very quick and intro into how RStudio can be launched and what are the different aspects of RStudio here. I'm going to go back to Galaxy. So as you can see it's still running. So if you want to actually stop it, you need to click on this icon here and press on stop. This will terminate this particular session and it will remove the job from your history and you will not be able to access the RStudio server again. And before you do that, that accommodation would be to save if you have anything here from your environment back into Galaxy, or if you created any files and you download directly from here for example by clicking on that you can use as move to or export and you can save them all to your local directory. And with that, this is intro to the RStudio in Galaxy. And there is a very helpful tutorial that covers all those aspects into the training material. And I hope you found this useful.