1 Course objectives

In this course you will learn how to visualize your data in R. In particular, you will learn:

  • how to make bar-charts, box-plots and others using ggplot
  • how to make PCA plots in ggplot
  • how to make interactive plots in R using Rshiny (an Intro)

2 Page Info

This page contains links to different lectures (slides) and practical exercises (labs) that are part of this workshop. The links below are similar to that under Schedule but organised here by topic.

Input code blocks are displayed like shown below. The code language is displayed above the block. Shell scripts (SH) are to be executed in the linux terminal. R scripts are to be run in R either through the terminal, RGui or RStudio.

sh
command

Note   Tip   Discuss   Task


This topic covers retrieving data needed for all the exercises in the entire course can be found in the following link.

Downloading data

Some pre-course R warm-up below, if you fancy that:

R warmup

3 Introduction

Most of the analyses is carried out in R and it will be useful to learn some basics in R that are very much necessary for this course. Even if you have learnt these things already, it is good to freshen up your memory.

Introduction to R

4 Main lab

4.1 Data

In most of the exercises, we will use RNA-seq data (Illumina short reads) from the human A431 cell line. It is an epidermoid carcinoma cell line which is often used to study cancer and the cell cycle, and as a sort of positive control of epidermal growth factor receptor (EGFR) expression. A431 cells express very high levels of EGFR, in contrast to normal human fibroblasts.

The A431 cells were treated with gefinitib, which is an EGFR inhibitor and is used (under the trade name Iressa) as a drug to treat cancers with mutated and overactive EGFR. In the experiment, RNA was extracted at four time points: before the gefinitib treatment (t=0), and two, six and twenty-four hours after treatment (t=2, t=6, t=24, respectively), and sequenced using an Illumina HiSeq instrument in triplicates (thus there are 3x4=12 samples).

This data is part of the transcriptomics course that is also given by NBIS. We will use some of the counts table that was generated in the course after different transformations like manual filtering for low counts, VST and DESeq2. You don’t have to know what these exactly mean to do these exercises :) These are basically the same data at different stages of the transcriptomics analysis.

4.2 ggplot part I

This section is for people who are not used to using ggplot2 before! This section covers all the major basics to the grid graphics using ggplot2. These include some of the important functions in ggplot: geoms, colors and aesthetics, facets, barplots and errorbars.

Basics in ggplot2

4.3 ggplot part II

This section is for the people who are comfortable in using in using ggplot2 and would like to learn some advanced functions in ggplot2.

Advanced ggplot2

4.4 Rshiny

This section is for the people here who are mainly interested in learning how to design the interactive RShiny app. This section covers all the basics of RShiny. The second section of this lab also includes some of the important functions which is important for mastering Rshiny

Rshiny

4.5 Rshiny Covid App

In this part, we learn how to write an app from scratch! So, we take the visualization of the covid data as an example from few countries that we would like to plot!

Rshiny Covid App

5 Solutions to exercises:

Here I have compiled all the solutions for the different exercises in each of the sections:

Solutions

6 Extra Tutorial for ggplot

In the following link, you can find several different ways to use ggplot and obtain incredible visualizations of the data. Depending on the kind of data you have and the kind of visualization you would like to see, you can follow it on the table contents in this following page:

Top 50 ggplot2 Visualizations