RNA-Seq DE analysis summary 2

RNA-Seq with Bioconductor in R

Mary Piper

Bioinformatics Consultant and Trainer

DESeq workflow - normalization

workflow-normalization

dds <- estimateSizeFactors(dds)
normalized_counts <- counts(dds, normalized=TRUE)
RNA-Seq with Bioconductor in R

Unsupervised clustering analyses: log transformation

workflow-clustering

# Log transformation of normalized counts
vsd <- vst(dds, blind=TRUE)
RNA-Seq with Bioconductor in R

Unsupervised clustering analyses

heatmap

RNA-Seq with Bioconductor in R

Unsupervised clustering analyses - heatmap

vsd %>%
    assay() %>% # Extract the vst matrix from the object
    cor() %>%   # Compute pairwise correlation values
    pheatmap(annotation = metadata[ , c("column_name1", "column_name2])

heatmap

RNA-Seq with Bioconductor in R

Unsupervised clustering analyses - pca

# PCA
plotPCA(vsd, intgroup="condition")

pca

RNA-Seq with Bioconductor in R

Running the DE analysis

DESeq2 workflow - model

RNA-Seq with Bioconductor in R

Running the DE analysis

# Create DESeq object
dds <- DESeqDataSetFromMatrix(countData = rawcounts,
                              colData = metadata,
                              design = ~ source_of_variation + condition)
# Run analysis
dds <- DESeq(dds)
RNA-Seq with Bioconductor in R

DESeq2 workflow - model

# Plot dispersion estimates
plotDispEsts(dds)

dispersion

RNA-Seq with Bioconductor in R

DESeq2 workflow - contrasts and LFC shrinkage

DESeq2 workflow - LFC shrinkage

RNA-Seq with Bioconductor in R

DESeq2 workflow - contrasts and LFC shrinkage

# Extract results for comparison of interest
res <- results(dds, 
                contrast = c("condition_factor", "level_to_compare", 
                "base_level"), 
                alpha = 0.05)
# Shrink the log2 foldchanges
res <- lfcShrink(dds, 
                contrast = c("condition_factor", "level_to_compare", 
                "base_level"), 
                res = res)
RNA-Seq with Bioconductor in R

DESeq2 workflow - LFC shrinkage

# Extract all results as a data frame
res_all <- data.frame(res) %>% 
        rownames_to_column(var = "ensgene") 
# Add gene annotations
res_all <- left_join(x = res_all, 
                    y = grcm38[, c("ensgene", "symbol", "description")], 
                    by = "ensgene") 
res_all <- arrange(res_all, padj)

annotations

RNA-Seq with Bioconductor in R

DESeq2 workflow - results exploration

DESeq2 workflow - results exploration

RNA-Seq with Bioconductor in R

DESeq2 workflow - results exploration

# Identify significant genes
res_sig <- subset(res_all, padj < 0.05)

sig results

RNA-Seq with Bioconductor in R

mutiple_viz.png

RNA-Seq with Bioconductor in R

Let's practice!

RNA-Seq with Bioconductor in R

Preparing Video For Download...