QIFEIDKN / STAGATE

Adaptive Graph Attention Auto-encoder for Spatial Domain Identification of Spatial Transcriptomics
MIT License
35 stars 18 forks source link

Problems in PAGA Analysis #9

Closed jingjingyac closed 2 years ago

jingjingyac commented 2 years ago

Hello, when I run PAGA, sc.tl.paga(used_adata, groups='Ground Truth') got the error ValueError: iterable must yield non-negative integers. I don't know how can I solve this problem.

xiao-kong-long commented 2 years ago

I have made some additions and changes on the basis of source code, making it run successfully. image On above image, what in red block are additional contents, and changed contents are in green. Hope it may help you

xiao-kong-long commented 2 years ago

pasted codes: embarked_mapping = {'Layer_1':0, 'Layer_2':1, 'Layer_3':2, 'Layer4':3, 'Layer_5':4, 'Layer_6':5, 'WM':6}

used_adata.obs['Ground Truth'] = used_adata.obs['Ground Truth'].map(embarked_mapping) used_adata.obs['Ground Truth'] = used_adata.obs['Ground Truth'].fillna(0).astype(int).astype('category')

sc.tl.paga(used_adata, groups='mclust')

jingjingyac commented 2 years ago

Ok thanks, I've solved the problem, it might have been the presence of Nan values at the beginning.