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
How can I extract the clustering order of the column of my samples? Essentially I have >100 samples and pheatmap nicely clusters them in to 2 broad groups, how can I extract the plotting order for downstream analysis?
When I examine p there does not seem to be this data in the object,
thanks
The text was updated successfully, but these errors were encountered:
As ?pheatmap indicates in the "Value" section, p contains a list with a component tree_row, which is "the clustering of rows as hclust object". You can get more details in the "Value" section of ?hclust, notably:
order
a vector giving the permutation of the original observations suitable for plotting, in the sense that a cluster plot using this ordering and matrix merge will not have crossings of the branches.
So the exact order is available with:
p$tree_col$order
or if you want the labels in their clustered order:
I have created my pheatmap using:
p<-pheatmap(mat),
scale = "row",
show_rownames = T, show_colnames = T,
border_color = NA,
clustering_method = "average",
clustering_distance_rows = "correlation",
clustering_distance_cols = "correlation",
breaks = seq(-3, 3, 0.05),
color = colorRampPalette(c("purple3", "black", "yellow2"))(120),
annotation_col =
pData(target_demoData)[, c("Annotation_initial2", "Conditon2")] )
p
How can I extract the clustering order of the column of my samples? Essentially I have >100 samples and pheatmap nicely clusters them in to 2 broad groups, how can I extract the plotting order for downstream analysis?
When I examine p there does not seem to be this data in the object,
thanks
The text was updated successfully, but these errors were encountered: