wmacnair/psupertime

Improvement suggestion for heatmap

doncarlos999 opened this issue · 1 comments

Thanks for the great piece package.

I have one suggestion . It would be good to be able to sort the heatmap produced by plot_heatmap_of_gene_clusters on the x axis in the same order as on the plot_profiles_of_gene_clusters.

From this:
seurat_time_course_4CL_and_e4CL_single_batch2020-06-08_18 30 55_heatmap_clustered_hvg_psuper

To This:
seurat_time_course_4CL_and_e4CL_single_batch2020-06-09_02 29 56_heatmap_clustered_hvg_psuper

So that the order matches this:
seurat_time_course_4CL_and_e4CL_single_batch2020-06-08_18 30 55_profile_clustered_hvg_psuper

I was able to achieve it by adding the following code:
go_list_ <- psupertime_go_analysis(naive_psuper, org_mapping="org.Hs.eg.db")
x <- go_list_$plot_dt
x_ord <- with(x, x[order(label_psuper),])
x_ord$cell_id <- factor(x_ord$cell_id, levels = unique(x_ord$cell_id))
go_list_$plot_dt <- x_ord
plot_heatmap_of_gene_clusters(go_list_)

Cheers
Carl

Hi Carl

Thanks for this suggestion. I'll look at including it :)

Cheers
Will