Hello, I am doing differential gene expression analysis using DESeq2. I want to make an expression heat map of sample-to-sample distances on the matrix of variance-stabilized data(rlog). I followed this code.
rld <- rlog(Merged_dds, blind=TRUE)
rld_mat <- assay(rld)
rld_cor <- cor(rld_mat)
pheatmap(rld_cor, annotation = select(Merged_metadata, condition))
heat.colors <- brewer.pal(6, "Blues")
I got a heatmap for all samples(10 samples, with 4 different treatments, and one control). Each condition has 2 biological replicates. But I want to make a similar heatmap for only one condition vs control. I have 2 replicates for each condition. When I tried to use the same code for it, I did not get any error, but I also did not get the heatmap. So, my question is can I make a distance heatmap for 4 samples- 2 being one condition, other 2 being controls or not? If, yes, how should I change the code? Given I will use the correct data.
Thank you for reading my post. I hope to get your help.
Best wishes,
Select
rld_cor
for the samples you want. Standard rules of matrix subsetting in R apply.