Introduction to R for Life Scientists
This workshop is directed toward life scientists with little to no experience with statistical computing or bioinformatics. This interactive workshop will introduce the R statistical computing environment, including basic instruction in data types, variables, array manipulation, functions, data frames, data import/export, visualization, and using packages. At the end of the workshop, participants will see a live demonstration of a real biomedical application - analysis of publicly available RNA-seq data. This will demo (1) how to acquire publicly accessible data from NCBI Gene Expression Omnibus, and (2) how to use Bioconductor packages to import, process, QC, analyze, and visualize the results of the analysis. By the end of the workshop, participants will be able to use R for basic data manipulation and visualization, and will know where to look for further help and instruction. Participants will also be exposed to analyzing RNA-seq data. An advanced follow-on course will go through a gene expression data analysis in detail. This course is sponsored by the Claude Moore Health Sciences Library.
Date: Feb 23, 2015
Time: 2:00-5:00pm
Location: Health Sciences Library, Carter Classroom
Pre-requisites:
- Bring a laptop to the course with the software installed as detailed below.
- Print and bring this R Cheat Sheet created specifically for this workshop.
Registration: Click here.
Course material:
- Slides
- Code used in course:
- Part I: Introduction to R
- Part II: RNA-seq data analysis
Before coming
You must bring a laptop with the necessary software installed to the course. Please install the software below prior to the course - we will not have time during the workshop to troubleshoot installation issues. Please email me (sd...@virginia.edu) if you have any trouble.
Software setup
Note: R and RStudio are separate downloads and installations. R is the underlying statistical computing environment, but using R alone is no fun. RStudio is a graphical integrated development environment that makes using R much easier. You need R installed before you install RStudio.
- Download data. Download the
gapminder.csv
andmalebmi.csv
files from bioconnector.org/data. Save them somewhere easy to find. Optionally, open them up in Excel and look around. - Install R. You'll need R version 3.1.2 or higher. Download and install R for Windows or Mac OS X (download the latest R-3.x.x.pkg file for your appropriate version of OS X).
- Install RStudio. Download and install the latest stable version of RStudio Desktop. Alternatively, download the RStudio Desktop v0.99 preview release (the 0.99 preview version has many nice new features that are especially useful for this particular workshop).
- Install R packages. Launch RStudio (RStudio, not R itself). Ensure that you have internet access, then enter the following commands into the Console panel (usually the lower-left panel, by default). Note that these commands are case-sensitive. At any point (especially if you've used R/Bioconductor in the past), R may ask you if you want to update any old packages by asking
Update all/some/none? [a/s/n]:
. If you see this, typea
at the propt and hitEnter
to update any old packages. If you're using a Windows machine you might get some errors about not having permission to modify the existing libraries -- don't worry about this message. You can avoid this error altogether by running RStudio as an administrator.
# Install packages from CRAN
install.packages("dplyr")
install.packages("ggplot2")
install.packages("tidyr")
install.packages("knitr")
install.packages("rmarkdown")
You can check that you've installed everything correctly by closing and reopening RStudio and entering the following commands at the console window:
library(dplyr)
library(ggplot2)
library(tidyr)
library(knitr)
library(rmarkdown)
These commands may produce some notes or other output, but as long as they work without an error message, you're good to go. If you get a message that says something like: Error in library(packageName) : there is no package called 'packageName'
, then the required packages did not install correctly. Please do not hesitate to email me prior to the course if you are still having difficulty.
Take the pre-workshop survey
Click here to take the pre-workshop survey. It should take about a minute to complete.