DEP
DEP copied to clipboard
plot_heatmap: extract specific cluster group from heatmap
Hi,
Thank you for this very useful tool!
Is there a way to extract a specific cluster of proteins that was differentiated by k-means clustering in the heatmap?
Hi,
I know this comes late, but it can be solved by assigning plot_heatmap into a variable and setting argument plot = FALSE:
df <- plot_heatmap(dep, type = "centered", kmeans = TRUE, k = 4, col_limit = 4, show_row_names = FALSE, indicate = c("condition", "replicate"), plot = FALSE)
df is now a dataframe with 'protein' column and 'k' column, containing info into which cluster the particular protein belongs to, so you can extract the proteins of some cluster easily: df[df$k == cluster_number, ]