15 Exercise with variancePartition and ComplexHeatmap
Instructors: Daianna and Renee
Now is your turn to work on variance partition analysis and to create heatmaps to visualize expression patterns of DEGs.
With the same dataset that you have (rse_gene
) perform the the variance partition analysis with smoking data for pups (i.e., taking pup samples from the smoking experiment) just as we did with nicotine data.
15.1 Steps:
- Subset the complete
rse_gene
object to smoking and pup data only. - Assume that all smoking pup samples are high quality and use them all for the variance partition analysis.
- Use
fitExtractVarPartModel()
to fit a model for each gene and extract the variance explained by each variable; do it with normalized counts. - Which variables contribute more to gene expression changes? Which ones should be included in the models for DEA? Why?
- Now select DEGs (for the smoking experiment) only. Create heatmaps to visualize the expression of these genes. Is it enough to use normalized counts directly from
assays(rse_gene_smoking)$logcounts
? Why? - Is there any clustering of the samples by
Group
or any other sample variable? - Separate upregulated and downregulated DEGs (by
logFC
) and create their individual heatmaps. What do you observe?