colomemaria / epiScanpy

Episcanpy: Epigenomics Single Cell Analysis in Python
BSD 3-Clause "New" or "Revised" License
139 stars 33 forks source link

How are feature groups grouped together (rank_feat_groups_matrixplot)? #73

Open hildemann opened 3 years ago

hildemann commented 3 years ago

Hi @DaneseAnna ,

now the rank_feature_groups_matrixplot is working however i don't quite understand the process of feature groups being grouped together. Because most likely this: epi.pl.rank_feat_groups(adata, feature_symbols='transcript_annotation') groups features by their variability score right? Because i really can't make any sense of the '3 vs rest' or '10 vs rest' figures this command generates. And then does it just create 14 groups of certain size with similiar high variability score?

matrixplot_

And then these feature groups are written on top of the rank_feature_matrixplot, right. With the corresponding genes of features on the lower x axis. To make more sense of this plot i specified grouby='cell_type' which at least made the y axis interpretable.

Thanks for advice,

Valentin

DaneseAnna commented 3 years ago

Hi Valentin,

You probably clustered your data before running epi.tl.rank_features. It provided you with a set of clusters (13 according to this plot), cells that share a lot of similarities. Then you ran epi.tl.rank_features(adata, groupby="louvain", reference='rest') which performedmultiple t-test (with benjamini-hochberg as a p-value correction method) to identify the most variable features in each of your Louvain cluster compared to all the remaining cells.

So you get in the columns labeled 3 in the heat map the 10 most differentially open features in the cells clustered as 3 with Louvain. And by the look of it, it corresponds to pDC cells. Now, what you see as feature name is not the transcript annotation. It is probably because you are using raw features to identify the differential peaks and they don't have the transcript annotation. One way to fix it would be to remove the raw layer.

Best, Anna