LieberInstitute / spatialDLPFC

spatialDLPFC project involving Visium (n = 30), Visium SPG (n = 4) and snRNA-seq (n = 19) samples
http://research.libd.org/spatialDLPFC/
16 stars 3 forks source link

Plot enriched genes in different clusters #59

Closed abspangler13 closed 2 years ago

abspangler13 commented 2 years ago

Gene enrichment was calculated as part of spatial registration analysis. Pick the top 3-5 genes (use getTopN() from spatial registration git issue) from each cluster based on the t-statistic. Plot the normalized gene expression for these genes. Have to do this on the pseudobulked data. Use pheatmap to make heatmap. Or could make violin plots too. This will be figure 3a.

https://github.com/LieberInstitute/Visium_IF_AD/blob/master/code/08_harmony_BayesSpace/04_heatmaps_dlpfc_markers.R#L131-L149

http://research.libd.org/SPEAQeasy-example/bootcamp_intro#52_Visualizing_DEGs

abspangler13 commented 2 years ago

Group samples by cluster and color code. Still show every sample but don't use sample name. Add row annotations (genes) to denote which cluster they're from. Don't cluster by row. Still cluster by samples (columns).

Can change height and width of plot based on k so you can still run it as an array job but have the plot size adjust for the number of clusters. Maybe k = 0.5.

To color heatmap, you can cap the maximum color. This will keep the color scale the same for every plot and allow you to see differences in lower values.