SCCAF / sccaf

Single-Cell Clustering Assessment Framework
MIT License
85 stars 18 forks source link

IndexError when performing SCCAF cluster analysis #40

Open leomorelli opened 3 years ago

leomorelli commented 3 years ago

Hi, I'm new in the field so I may, so I do apologize for errors I may have committed. My problem is that when I perform the cluster analysis step with SCCAF an IndexError occurs:


ad.raw=ad

sc.tl.leiden(ad,resolution=2)

sc.pl.umap(ad,color=['leiden','nnet2'])

ad.obs['L1_Round0'] = ad.obs['leiden']

SCCAF_optimize_all(min_acc=0.9,ad=ad, use='pca',basis ='umap')
541 mask = adata.obs[key].cat.categories[imask] == adata.obs[key].values
--> 542 color = adata.uns[key + '_colors'][imask]
543 if not isinstance(color[0], str):
544 from matplotlib.colors import rgb2hex

IndexError: list index out of range

The following list represents what it is stored in ad.uns['L1_Round0_self-projection_colors']:

['#1f77b4', '#ff7f0e', '#279e68', '#d62728', '#aa40fc', '#8c564b', '#e377c2', '#b5bd61', '#17becf', '#aec7e8', '#ffbb78', '#98df8a', '#ff9896', '#c5b0d5', '#c49c94', '#f7b6d2', '#dbdb8d', '#9edae5', '#ad494a']

I'm not sure if I've made a mistake somewhere in the analysis but I am grateful for any hints. Thank you!