☰ Menu

      Advanced Single Cell RNA-Seq Workshop

Home
Introduction and Lectures
Intro to the Workshop and Core
Schedule
What is Bioinformatics/Genomics?
Experimental Design and Cost Estimation
Single Cell Sample Preparation - Dr. Diana Burkart-Waco
Support
Using Slack in this workshop
Using Zoom in this workshop
Cheat Sheets
Software and Links
Scripts
Prerequisites
CLI - Logging in and Transferring Files
CLI - Intro to Command-Line
CLI - Advanced Command-Line (extra)
CLI - Running jobs on the Cluster and using modules
R - Getting Started
R - Intro to R
R - Prepare Data in R (extra)
R - Data in R (extra)
More Materials (extra)
Data Reduction
Generating Expression Matrices
Expression project setup
Preprocessing reads with HTStream
Generating Expression Tables
VDJ T cell and B cell
Velocity analysis
Data analysis
scRNA analysis prepare, part 1
Mapping Comparison
Anchoring (Comparison dataset)
Shiny App Install/Overview
Shiny App Practical Usage
AWS Hosted App (Optional)
scRNA analysis prepare, part 2
Monocle
VDJ T cell and B cell analysis
Velocity analysis
ETC
Closing thoughts
Workshop Photos
Github page
Biocore website

Create a new RStudio project, PART 1

Open RStudio and create a new project, for more info see Using-Projects

Learn more about renv

Set some options and make sure the packages are installed (if not install it), and then load them and verify they all loaded correctly.

In the R console run the following commands

# For Markdown
packages <- c('highr', 'knitr', 'markdown', 'rmarkdown', 'tinytex', 'xfun')
if (!any(rownames(installed.packages()) %in% packages)){
  if (!requireNamespace("BiocManager", quietly = TRUE))
      install.packages("BiocManager")
  BiocManager::install(packages)
}

if (!any(rownames(installed.packages()) == "Seurat")){
  if (!requireNamespace("BiocManager", quietly = TRUE))
      install.packages("BiocManager")
  BiocManager::install("Seurat")
}
library(Seurat)

if (!any(rownames(installed.packages()) == "hdf5r")){
  if (!requireNamespace("BiocManager", quietly = TRUE))
      install.packages("BiocManager")
  BiocManager::install("hdf5r")
}
library(hdf5r)

if (!any(rownames(installed.packages()) == "tximport")){
  if (!requireNamespace("BiocManager", quietly = TRUE))
      install.packages("BiocManager")
  BiocManager::install("tximport")
}
library(tximport)

if (!any(rownames(installed.packages()) == "ggVennDiagram")){
  if (!requireNamespace("BiocManager", quietly = TRUE))
      install.packages("BiocManager")
  BiocManager::install("ggVennDiagram")
}
library(ggVennDiagram)

## used in Seurat findMarkers
if (!any(rownames(installed.packages()) == "limma")){
  if (!requireNamespace("BiocManager", quietly = TRUE))
      install.packages("BiocManager")
  BiocManager::install('limma')

}
library(limma)

sessionInfo()

Lets spend a minute looking at the reports and the data

Download the data for the workshop, extract it.

In the R console run the following command.

download.file("https://bioshare.bioinformatics.ucdavis.edu/bioshare/download/iimg5mz77whzzqc/Adv_comparison_outputs.zip", "Adv_comparison_outputs.zip", method = "wget")
zipf <- "Adv_comparison_outputs.zip"
outdir <- "."
unzip(zipf, exdir=outdir)

Then uncompress the zip File, into the project folder

Download the template Markdown workshop document Mapping Comparison and open it.

In the R console run the following command

download.file("https://raw.githubusercontent.com/ucdavis-bioinformatics-training/2020-August-Advanced-scRNAseq/master/data_analysis/Mapping_Comparison.Rmd", "Mapping_Comparison.Rmd")

Download the ensembl ids to gene symbols from biomart. More info on how to create this can be found here: scMapping

download.file("https://raw.githubusercontent.com/ucdavis-bioinformatics-training/2020-August-Advanced-scRNAseq/master/datasets/ens2sym.txt", "ens2sym.txt")

Download the template Markdown workshop document Anchoring and open it.

In the R console run the following command

download.file("https://raw.githubusercontent.com/ucdavis-bioinformatics-training/2020-August-Advanced-scRNAseq/master/data_analysis/anchoring.Rmd", "anchoring.Rmd")

Edit the file YAML portion

The top YAML (YAML ain’t markup language) portion of the doc tells RStudio how to parse the document.

---
title: "Single Cell Mapping Comparison"
author: your_name
date: current_date
output:
    html_notebook: default
    html_document: default
---

Your RStudio should look something like this

RStudio