sccaf
sccaf copied to clipboard
ValueError: At least one label specified must be in y_true
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
I have had the same issue, also using Seurat-generated clusters. It'd be excellent to get a solution.
HI guys, Do we have a solution for this figured? I get the same error.
mamta
here is the solution:
a.obs['seurat_clusters'] = a.obs.seurat_clusters.astype('object')
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')