Question: plot Heatmap after the use of "Interaction" within DESeq2
gravatar for JunLVI
6 months ago by
JunLVI40 wrote:


The structure of my dataset is 4 cell lines of 2 genotype with biological duplicates (4*2*2 samples), the purpose of the analysis to assess the effect of different genotypes (KO vs WT) on the gene expression in 4 cell lines) 

I used "Interation" in order to test for differences in KO effects:

dds$group <- factor(paste0(dds$compartment, dds$genotype))
design(dds) <- ~ group
dds <- DESeq(dds)
results(dds, contrast=c("group", "CelltypeA_WT", "CelltypeB_cKO"))

as showed above, I could easily get the result as well as report the result as ".csv" files. 

but is there easy way to plot heatmap of the results above? 

something like: 

topVarGenes <- head(order(rowVars(assay(rld)),decreasing=TRUE),40)
mat <- assay(rld)[ topVarGenes, ]
mat <- mat - rowMeans(mat)
df <-[,c("genotype","compartment")])
pheatmap(mat, annotation_col=df,fontsize=9,fontsize_number = 0.4 * fontsize)



ADD COMMENTlink modified 6 months ago by Michael Love13k • written 6 months ago by JunLVI40
gravatar for Michael Love
6 months ago by
Michael Love13k
United States
Michael Love13k wrote:

If you want to plot specific genes in a heatmap, don't use the topVarGenes to filter the mat. You can index the mat by the name or names of your specific genes:

mat <- assay(rld)
mat <- mat - rowMeans(mat)
mat <- mat[ your.specific.genes, ]
ADD COMMENTlink written 6 months ago by Michael Love13k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 187 users visited in the last hour