plot Heatmap after the use of "Interaction" within DESeq2
1
0
Entering edit mode
JunLVI ▴ 40
@junlvi-8996
Last seen 6.3 years ago
Japan

 

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")
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)

TKS!

 

rnaseq deseq2 • 1.6k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 8 hours ago
United States

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 COMMENT

Login before adding your answer.

Traffic: 776 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6