Closed J-sara closed 6 years ago
Hey J-sara,
Like you said, return_heatmap creates a pheatmap object, which stores the clustered tree is stored in $tree_row, so you can return the clusters with the cutree function on that:
t <- plot_pseudotime_heatmap(x, return_heatmap=T)
t <- as.data.frame(cutree(t$tree_row, k=3)
colnames(t) <- "Cluster"
t$Gene <- rownames(t)
Just be sure to change k=n to match the number of clusters in the heatmap.
Then you can use dplyr::filter on that data frame to get genes associated with each cluster, or you can write it out to a csv and do whatever you want with it
thanks @dpcook !
Hi @dpcook The cutree function that set k parameter same as plot_pseudotime_heatmap's num_clusters result showing variable clustering compared with the result of plot_pseudotime_heatmap showing. What happen to this ? and how to fix it ? any advice would be appreciated.
Hello,
I have used "plot_pseudotime_heatmap" to find genes that change as a function of pseudotime. Because I have several genes (around 1000 genes) on the heatmap, the name of the genes that cluster together is not readable. How I can find the name of the genes that cluster together on the heatmap? Using "return_heatmap =TRUE" argument gives an object that includes the gene names on the heatmap but is not still obvious which one are clustered together. I want to perform GO term analysis on the genes that follow a similar pattern during the pseudotime.
Best