Teichlab / celltypist

A tool for semi-automatic cell type classification
https://www.celltypist.org/
MIT License
278 stars 44 forks source link

Error : sparse matrix length is ambiguous; use getnnz() or shape[0] #16

Closed aditya-sarkar441 closed 2 years ago

aditya-sarkar441 commented 2 years ago

The anndata is GSE158055. I passed an anndata into the celltypist and got the above error. What is this error and how do I solve it ?

ChuanXu1 commented 2 years ago

@aditya-sarkar441, according to the information, it may be caused by an improper input format vs. the model in fetching the sparse matrix shape. Can you show the code you used to generate the anndata from GSE158055?

aditya-sarkar441 commented 2 years ago

http://covid19.cancer-pku.cn/

ChuanXu1 commented 2 years ago

@aditya-sarkar441 , as I checked there is a raw count matrix in .raw of that dataset. You can try to normalize and log1p it to serve as the input for CellTypist, instead of the .X which seems to come from scran normalization and which does not fit the requirement of CellTypist.

aditya-sarkar441 commented 2 years ago

@ChuanXu1 The problem is with the majority voting part. So in the command, if I initialize majority voting as False, then it works fine. But when I assign it to be True, then I get the above error.

I will try the above method once as well.