Get startedGet started for free

Hierarchical heatmap by condition

When performing quality assessment of our count data, we need to transform the normalized counts for better visualization of the variance for unsupervised clustering analyses. To assess the similarity of the smoc2 samples using hierarchical heatmaps, transform the normalized counts and perform hierarchical clustering analysis. Assume all libraries have been loaded, the DESeq2 object created, and the size factors have been stored in the DESeq2 object, dds_smoc2.

This exercise is part of the course

RNA-Seq with Bioconductor in R

View Course

Exercise instructions

  • Transform the normalized counts from the dds_smoc2 object using the vst() function with the blind argument and save to vsd_smoc2.
  • Extract the matrix of transformed normalized counts from the vsd_smoc2 object using the assay() function and save as vsd_mat_smoc2.
  • Calculate the correlation values between samples and save to vsd_cor_smoc2.
  • Create a heatmap of the correlation values using pheatmap() with an annotation bar designating condition from the smoc2_metadata data frame.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Transform the normalized counts 
vsd_smoc2 <- ___(___, ___)

# Extract the matrix of transformed counts
vsd_mat_smoc2 <- ___(___)

# Compute the correlation values between samples
vsd_cor_smoc2 <- ___(___) 

# Plot the heatmap
___(___, annotation = select(___, ___))
Edit and Run Code