zhanghao-njmu / SCP

An end-to-end Single-Cell Pipeline designed to facilitate comprehensive analysis and exploration of single-cell data.
https://zhanghao-njmu.github.io/SCP/
GNU General Public License v3.0
351 stars 79 forks source link

Question relative to zscore #146

Open arnaudmet opened 1 year ago

arnaudmet commented 1 year ago

Hi, I have a question about zscore in the GroupHeatmap. Are the zscore compute for each gene, so i can compare the expression of one gene across all my group ? Or compute for each group so i compare the expression of multiple genes in one group ?

Thanks

zhanghao-njmu commented 1 year ago

The z-score is specifically utilized in a Heatmap to visualize the expression patterns of different genes using a unified color scheme. If you wish to compare gene expression across multiple groups or within specific groups, you can employ the FeatureStatPlot function. This function utilizes the expression data stored in the 'data' slot in default, for example:

# Multiple group comparisons
FeatureStatPlot(pancreas_sub, stat.by = c("Rbp4", "Pyy"), group.by = "SubCellType", multiplegroup_comparisons = TRUE)
# Pairwise comparisons within specified groups
FeatureStatPlot(pancreas_sub, stat.by = c("Rbp4", "Pyy"), group.by = "SubCellType", comparisons = list(c("Alpha", "Beta"), c("Alpha", "Delta")))
FeatureStatPlot(pancreas_sub, stat.by = c("Rbp4", "Pyy"), group.by = "SubCellType", comparisons = list(c("Alpha", "Beta"), c("Alpha", "Delta")), sig_label = "p.format")
# Within-group comparisons (pairwise or multiple group comparisons)
FeatureStatPlot(pancreas_sub, stat.by = c("G2M_score", "Fev"), group.by = "SubCellType", split.by = "Phase", comparisons = TRUE)