Entering edit mode
2.7 years ago
mgranada3
▴
50
I am trying to create a heat map in R using the package(pheatmap). I am to do this using my normalized data for ALL genes with hierarchical clustering per 100's of genes. However, I am confused because my heat map still includes the control data. It was communicated to me that if the treatment was normalized to the control then the control data would appear as having zero expression. When I create my heat map I still see the control data. Is this right?
I have provided some of my code, I am following Analyzing RNA-Seq Data with DESEQ2
coldata <- read.csv("coldata.csv", row.names=1)
cts <- read.csv("countmatrix.csv", row.names=1)
coldata <- coldata[,c("condition","type")]
coldata$condition <- factor(coldata$condition)
coldata$type <- factor(coldata$type)
library("DESeq2")
dds <- DESeqDataSetFromMatrix(countData = cts, colData = coldata, design = ~ condition)
keep <- rowSums(counts(dds)) >= 10
dds <- dds[keep,]
dds <- DESeq(dds)
vsd <- vst(dds, blind=FALSE)
library("pheatmap")
select_test <- order(rowMeans(counts(dds,normalized=TRUE)), decreasing=TRUE)
df <- as.data.frame(colData(dds)[,c("condition","type")])
pheatmap(assay(vsd)[select_test,], cluster_rows=TRUE, cutree_rows=4, show_rownames=FALSE,
cluster_cols=FALSE, annotation_col=df)
I don't know which line in your codes did this.
To show the DEGs in heatmap, you can try set the parameter
scale = "row"
; or mannually calculate the log(treatment/control) values and use it as the the input matrix forpheatmap()
So I thought the
rowMeans(counts(dds,normalized=TRUE))
is me normalizing.I did not really understand what
scale="row"
did, is this sufficient normalization for publishing work?According to the help page, what
normalized = TRUE
does isSo the control data won't "disappear".
scale = "row"
means conducting z-score normalization in every row.