Open eggrandio opened 6 months ago
@jokergoo I have tried to do it again, making the dendrogram from scratch (in case there is some hidden value in the MSA dendrogram) but I still get the same issue. I think I have done this in the past and there was no issue with using precalculated dendrograms
test_dendro <- data.frame("genes" = labels(gene_dendro),
"rand_val" = c(sample(1:100, length(labels(gene_dendro)), replace = TRUE))) %>%
column_to_rownames("genes") %>%
dist() %>%
hclust() %>%
as.dendrogram()
par(mar=c(5, 4, 4, 10) + 0.1)
test_dendro %>% rev() %>% plot(horiz=T)
input_matrix <- readRDS("input_matrix.RDS")
Heatmap(
input_matrix,
name = "Expression",
cluster_rows = test_dendro,
row_dend_reorder = FALSE,
cluster_columns = FALSE)
I want to plot the expression of a group of genes (rows) in different conditions (columns), but I want to cluster them based on their sequence similarity, not on their expression values. When I apply the precalculated dendrogram, the heatamap is reordered even if I specify not to reorder rows (in fact, a new row dendrogram seems to be calculated).
Here is the source_data.
*There are two genes without expression values, but removing them makes no difference regarding this issue.
First, I am precalculating a dendrogram based on gene sequence similarity:
Then I want to apply it to the expression values and make a heatmap:
The expected output would be something like this, preserving the dendrogram row order (I would like to show the row dendrogram):