I have data-set with 90 observations(rows) across 20 columns. I have generated a pretty neat heatmap which clusters my data in two groups with the package pheatmap. Although its not entirely clean but the two clusters of dendrogram pretty much separates my samples in 2 distinct groups as per my conditions. Now I want to reduce this set of 90 to a stricter set around 20-30 obeservations but still want to preserve the same clustering order as shown in pheatmap
. Is there a way to do that? or any other package that reduces my observations to a minimum set which can still preserve by clustering order as seen now? The code for pheatmap
is
pheatmap(mydata[rownames(df.90),],scale="row",clustering_distance_cols = "correlation",show_rownames= T,show_colnames=T,color=col,annotation=batch.annotation,cluster_col=T,fontsize_row = 8,fontsize_col = 8,clustering_method = "ward.D2",border_color = NA,)
any package in R that I am missing out can handle such or even something in the pheatmap
I can use as a function for reducing the variables and make a kind of permutation test to find the minimum set of observations that can still retain my clustering
The data is genes in rows and expression in columns across patients.