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?
library("genefilter") topVarGenes <- head(order(rowVars(assay(rld)),decreasing=TRUE),40) 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)