Chapter 12 Annex

12.1 Local installation

This section describes how to install R, Rstudio, and a set of important packages for the course.

  1. Download R from the CRAN page: https://cloud.r-project.org/. At the top of that page, choose the Download R link corresponding to your operating system.

    If you use Windows, follow install R for the first time, then click the link to download R. The installation procedure is like any other software, and you can safely use all default options.

    If you use Mac (OS X), download the pkg installer that matches you OS version and install like any other software

    Linux users are advised to use their package manager.

  2. Download and install the Rstudio Desktop Open source edition: https://rstudio.com/products/rstudio/download/#download. Choose the installer for your operating system and version. Install as any other software.

  3. Start Rstudio and install the following packages:

install.packages(c("tidyverse", "rmarkdown", "remotes", "devtools"))
install.packages("BiocManager")
BiocManager::install("UCLouvain-CBIO/rWSBIM1207")

If during any of the package installation steps, you get asked to update some packages, for example with a message like

Old packages: 'tinytex', 'TSP', 'tximeta', 'umap', 'vctrs', 'waveslim',
  'xcms', 'xlsx', 'xml2'
Update all/some/none? [a/s/n]:

You can answer a to update all your packages.

  1. To be able to compile Rmd files into pdf, you will also need to install an additional software. On Windows, the easiest is to install tinytex direct from the R console with tinytex::install_tinytex25. For Max OSX, you will need to install MacTeX. This post provides details. For linux, use your package manager to install the tex-live suite.

    Compilation to html will not require any additional installations and can also be used.

12.2 Using a cloud R/RStudio instance

An alternative to local installation is to use virtual machines that run in the cloud. Here, we will use Renku platform provided by the Swiss Data Science Center (SDSC).

  1. Create a new renku user - click to Login - Sign up button on https://renkulab.io/, click Register at the bottom of the login screen and follow instructions.

    Once completed, you will get to the following (or similar) screen, belonging here to user WSBIM1207.student.

Figure 12.1: Renky labding page.

Renky labding page.
  1. Now that you have created a Renku account, you will need to fork (i.e. copy) the course renku project into your own account. To do so, open the following link: https://renkulab.io/projects/laurent.gatto/wsbim-bioinfo

Figure 12.2: The WSBIM-bioinfo renku project page.

The WSBIM-bioinfo renku project page.

The second support video below also demonstrates the following steps for another renku project.

  1. Fork the project under your own account by click the fork button in the rop right corner (see previous screenshot). You can keep all the default values in the popup window and click on Fork again.

Figure 12.3: Forking the WSBIM-bioinfor renku project page.

Forking the WSBIM-bioinfor renku project page.
  1. The next window shows your personal copy of the WSBIM-bioinfo Renku project.
  1. Click the Environments tab and the New button to create a runnable cloud environment that contains R, RStudio, and all pre-installed packages. At this stage, if you already see an interactive environment (with a green tick box), you can immediately skip to step 8. Otherwise, the building could take up to 50 minutes (depending on caching). You can safely shut your computer down at this stage, as the environment is built in the cloud.

Figure 12.4: The Interactive Environment tab.

The *Interactive Environment* tab.

Figure 12.5: The Renku environment is being build.

The Renku environment is being build.
  1. Once built, you can start the cloud environment. Make sure you keep the default settings, i.e default environment /rstudio and 0.25 CPUs and 1G of RAM. For this course, these low resources are enough26.

Figure 12.6: The environment build settings.

The environment build settings.
  1. It will take some more time to get the environment started, shown below.

Figure 12.7: The Renku environment is being build.

The Renku environment is being build.
  1. Once ready, you now only have to click the blue Connect button to start RStudio in the cloud.

Figure 12.8: The Renku environment is now built.

The Renku environment is now built.
The Renku environment running RStudio.

Figure 12.9: The Renku environment running RStudio.

The RStudio instance has already all the required packages pre-installed. To close the remote RStudio, either use q() in the R console, click File and Quit Session, or the red round icon in the top corner. Next time, it won’t be necessary to repeat all the steps. Simply navigate to your project’s environment tab, rebuild the environment in a matter of seconds and connect. The video below illustrates these very same steps.

Here’s a shorter video that shows the forking using the new Renku interface. While the interface has changed, the steps are essentially the same.

It is easy to upload files directly to the remote RStudio instance by using the Upload button in RStudio’s file navigator menu. To download files or directories, select the files/folders in the file menu and click on More and then Export. The video below briefly illustrates this and demonstrates how to save any changes (including new files and folders) back to Renku.

Note that projects can only be forked once. If you want or need to fork the WSBIM1207 Renku project again, you first need to delete your existing fork:

  1. Navigate to your project page.
  2. In the top right corner, click on View in GitLab.
  3. In the bottom left corner, click on Settings.
  4. Click on Advanced at the bottom of the page.
  5. Navigate to the very bottom and click on the red button Remove project.
  6. You will be to type the name of the project (wsbim1207) and then confirm that you want to permanently delete it.

You can now restart the procedure described above.

12.2.1 Saving your work

Save your files to RenkuLab.Figure 12.10: Save your files to RenkuLab.

  1. Make sure you regularly save the scripts that you are editing, to save you from intermittent connection issues.
  2. Once you have finished working, save you data back to RenkuLab files using the Addins and Save to RenkuLab. This will make sure that your files are safe even when the environment is closed completely.
  3. In addition, it is recommended to download (export) all your files as an additional backup.

More about Renku

Here are a set of introductory videos (in French) prepared by Christine Choirat:

12.3 Universal Desktop Service at UCLouvain

Students at the UCLouvain can use the Universal Desktop Service (UDS) to access the software and files installed on the university network through a virtual working environment.


  1. There might be messages or event errors during the installation of tinytex. At the end, you can run tinytex:::is_tinytex() to verify if it installed successfully (if TRUE is returned).↩︎

  2. Given that the resources are provided for free by the SDSC and are shared by all users, it is good practice to only use the resources that are needed.↩︎

Page built: 2024-03-15 using R version 4.3.2 Patched (2023-12-27 r85757)