scenicplus icon indicating copy to clipboard operation
scenicplus copied to clipboard

Generating a Umap with eRegulon AUC does not produce proper clusters

Open redvoidling opened this issue 11 months ago • 2 comments

Describe the bug Following the "Tutorial: Branched differentiation trajectory" I tried to create an UMAP from the eRegulon AUC but the output is just a mix of all the celltypes. In my understanding this data is a abstraction of the GEX and ACC but on a TF basis. So what could have gone wrong?

Screenshot 2024-02-26 at 18 24 45

redvoidling avatar Feb 28 '24 16:02 redvoidling

You might want to see my response on Issue#287 I had the same issue.

In short try:

import pandas as pd
import anndata
import sklearn
auc_key = 'eRegulon_AUC'
signature_keys = ['Gene_based', 'Region_based']
data_mat = pd.concat([scplus_obj.uns[auc_key][x].T for x in signature_keys])
selected_regulons = [x for x in data_mat.index if '+_+' in x]
data_mat = data_mat.loc[selected_regulons]
adata = anndata.AnnData(X=data_mat.T.copy())
adata.obs = pd.concat([adata.obs, scplus_obj.metadata_cell], axis=1)

Hope it helps.

bhhlee avatar Mar 02 '24 08:03 bhhlee

Great that helped! Thanks a lot!

redvoidling avatar Mar 05 '24 15:03 redvoidling