SCCAF / sccaf

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

ValueError: At least one label specified must be in y_true #36

Open tina-roostaei opened 4 years ago

tina-roostaei commented 4 years ago

Hi, I have converted my Seurat object integrated assay using SeuratDisk to anndata format, and want to run SCCAF. Data is loaded with no error using sc.read. However, when I run SCCAF_optimize_all I get the following warning and error:

anaconda3/lib/python3.7/site-packages/sklearn/metrics/classification.py:261: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison if np.all([l not in y_true for l in labels]):

ValueError: At least one label specified must be in y_true

It seems that the seurat cluster IDs (numbers starting from 0) are treated as scalar. I was wondering if there is any solution on how to solve this and get the SCCAF_optimize_all to run. Thanks

camerongw commented 4 years ago

I have had the same issue, also using Seurat-generated clusters. It'd be excellent to get a solution.

mamtagiri commented 3 years ago

HI guys, Do we have a solution for this figured? I get the same error.

mamta

mamtagiri commented 3 years ago

here is the solution:

a.obs['seurat_clusters'] = a.obs.seurat_clusters.astype('object')

achamess commented 3 years ago

I also had this problem. Recasting to dtype 'object' did not work. For me, I needed to recast to dtype 'str' and then it worked

adata.obs['L1_Round0'] = adata.obs['RNA_snn_res.2']
adata.obs['L1_Round0'] = adata.obs['L1_Round0'].astype('str')