scenicplus
scenicplus copied to clipboard
Generating a Umap with eRegulon AUC does not produce proper clusters
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?
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.
Great that helped! Thanks a lot!