Search
Question: plot Heatmap after the use of "Interaction" within DESeq2
0
16 months ago by
JunLVI40
Japan
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)
resultsNames(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:

library("genefilter")
mat <- assay(rld)[ topVarGenes, ]
mat <- mat - rowMeans(mat)
df <- as.data.frame(colData(rld)[,c("genotype","compartment")])
pheatmap(mat, annotation_col=df,fontsize=9,fontsize_number = 0.4 * fontsize)

TKS!

modified 16 months ago by Michael Love17k • written 16 months ago by JunLVI40
0
16 months ago by
Michael Love17k
United States
Michael Love17k 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, ]