How can I get DESeq2 heatmap result in tabular format?
1
0
Entering edit mode
7.7 years ago
Kurban ▴ 230

Hello guy, I have use DEseq2 got the heat map based on unigenes’ readcounts. The command lines I have used are:

colData <- read.table("colData.txt") countData <- read.table("countData_DEGs(count_larger_1).txt")

rownames(colData) <- sub("fb","",rownames(colData)) all(rownames(colData) %in% colnames(countData))

countData <- countData[, rownames(colData)] all(rownames(colData) == colnames(countData))

dds <- DESeqDataSetFromMatrix(countData = countData, colData = colData, design =~ condition)

pheatmap(log2.norm.counts, cluster_rows=TRUE, show_rownames=FALSE, cluster_cols=TRUE, annotation_col=df)

dev.print(pdf, 'countData_DEGs(count_larger_1_heatmap_include_cluster.pdf')

But I want to know detailed information like which unigenes clustered together. And if I could get this cluster result in tabular format would be great. How can I do that? I am very new at R language. any suggestion would be appreciated.

RNA-Seq • 2.2k views
ADD COMMENT
0
Entering edit mode
7.7 years ago
e.rempel ★ 1.1k

Hi Kurban,

first you can save pheatmap as an object:

cluster.object <- pheatmap(log2.norm.counts, cluster_rows=TRUE, show_rownames=FALSE, cluster_cols=TRUE, annotation_col=df)

Then you can inspect the hierarchical tree of cluster results by

cutree(cluster.object$tree_col, number_of_clusters)

assuming that your genes are in columns. The variable number_of_clusters has to be set by you.

ADD COMMENT
0
Entering edit mode

hi @e.rempel,

could not cut the tree, and reported this error:

cutree(cluster.object$tree_col,60) Error in cutree(cluster.object$tree_col, 60) : invalid 'tree' ('merge' component)

ADD REPLY
0
Entering edit mode

Hi Kurban,

the error message implies that there is something wrong with cluster.object$tree_col: an object of class hclust. Can you have a look at cluster.object$tree_col$merge?

ADD REPLY

Login before adding your answer.

Traffic: 1639 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