drieslab / Giotto

Spatial omics analysis toolbox
https://drieslab.github.io/Giotto_website/
Other
258 stars 98 forks source link

understanding the output of plotMetaDataHeatmap VS plotHeatmap #186

Open moutazhelal opened 2 years ago

moutazhelal commented 2 years ago

Dear Giotto team,

Thank you for reading my issue.

I have a small question regarding plotting scran DEGs using two different functions plotMetaDataHeatmap and plotHeatmap: I ran these line of codes to generate my heatmaps

plotMetaDataHeatmap(gobject =Myloid_Giotto_norm, selected_feats = topgenes_25_scran_myloid1$genes ,
                    metadata_cols = c('leiden_clus'), custom_feat_order = topgenes_25_scran_myloid1$genes ,
                    x_text_size = 10, y_text_size = 10,
                    save_param = list(save_name = '6_b_metaheatmap_gini'))

plotHeatmap(gobject = Myloid_Giotto_norm,feats= topgenes_25_scran_myloid1$genes ,expression_values =  "normalized",cluster_column = 'leiden_clus',cluster_color_code= colors,
            cluster_order = "custom", cluster_custom_order = c("1","2","3","4","5","6"),feat_order = "custom" ,feat_custom_order  = topgenes_25_scran_myloid1$genes ,
            save_param = list(save_name="10_a_heatmap_myeloid_cluster_1_scran", base_width=12))

Visually these are some differences between the two outputd as plotHeatmapshow the expression of each spot and plotMetaDataHeatmap displays an overall value for the expression of a specific gene in a cluster. However my question is: is the overall value that is displayed using plotMetaDataHeatmapthe median or mean in a specific cluster ?

RubD commented 2 years ago

Hi @moutazhelal Currently it is hardcoded to be the mean, but we could potentially make it more flexible and add median as an option if that would help. We're also considering to provide a dotplot so that you can see both the mean/median and the number of cells with detected expression.