You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was having trouble getting the heatmaply dendrograms to match the heatmap.2 dendrogram, when I came across the heatmaply vignette directions to make them match. It seemed to work when scaling wasn't applied, but when I tried to apply row or column scaling, they no longer matched. Applying the scaling didn't seem to change the heatmap.2 dendrogram, but it did change the heatmaply dendrogram.
I made a quick shiny app to show the behaviour I'm getting with the scaling.
library(shiny)
ui <- fluidPage(
plotlyOutput("heatmap"),
plotOutput("heatmap2", height = "1000px")
)
server <- function(input, output, session) {
x <- as.matrix(datasets::mtcars)
output$heatmap <- renderPlotly({
heatmaply(x,
#### setting scale to "column" here instead of "none" causes the dendrogram to change for heatmaply
scale = "column",
seriate = "mean",
row_dend_left = T,
plot_method = "plotly")
})
output$heatmap2 <- renderPlot({
heatmap(x,
#### setting scale to "column" here instead of "none" doesn't seem to change the dendrogram in heatmap.2
#### so if both heatmaply and heatmap.2 are set to "column", only the heatmaply dendrogram changes and
#### they no longer match
scale = "column",
trace = "none",
col = viridis(100),
key = T)
})
}
shinyApp(ui, server)
I would expect that since the settings selected are those that in the vignette made heatmaply and heatmap.2 dendrograms match for non-scaled data, that the dendrograms would also match when you apply column scaling to both. There might be a very simple explanation for this that I'm missing or misunderstanding. I'm not sure if this is expected behaviour and if it might be better to post this on StackOverflow or if it is unexpected and this is the appropriate place to post this - if it's expected I apologize.
The text was updated successfully, but these errors were encountered:
Scaling in heatmap.2 is applied after calculating dendrograms, in heatmaply scaling happens before. I prefer the heatmaply behaviour as otherwise there's a mismatch in the data and clustering. You can get the heatmap.2 behaviour by calculating dendrograms on raw data and passing them in while specifying the desire scale setting
Thank you again for the great package.
I was having trouble getting the heatmaply dendrograms to match the heatmap.2 dendrogram, when I came across the heatmaply vignette directions to make them match. It seemed to work when scaling wasn't applied, but when I tried to apply row or column scaling, they no longer matched. Applying the scaling didn't seem to change the heatmap.2 dendrogram, but it did change the heatmaply dendrogram.
I made a quick shiny app to show the behaviour I'm getting with the scaling.
I would expect that since the settings selected are those that in the vignette made heatmaply and heatmap.2 dendrograms match for non-scaled data, that the dendrograms would also match when you apply column scaling to both. There might be a very simple explanation for this that I'm missing or misunderstanding. I'm not sure if this is expected behaviour and if it might be better to post this on StackOverflow or if it is unexpected and this is the appropriate place to post this - if it's expected I apologize.
The text was updated successfully, but these errors were encountered: