Closed padix-key closed 8 months ago
@padix-key, CellTypist first tries adata.X
and if its format is met, it will predict cell types accordingly. If adata.X
does not suffice, CellTypist will resort to adata.raw.X
to see whether adata.raw.X
works. If both do not work, an error will be raised. Please let me know whether it is clear to you.
Sorry for the late response. After source code inspection I also found this behavior and I think it is generally fine. However, in my opinion the error message does not convey the actual problem: If I have an AnnData
with X
but without raw
, the problem is that X
is not properly normalized, not that AnnData.raw
is None
.
@padix-key, error messages have been redesigned 42c2c1c8ba63a48d432087549891765ebac7c818 These new error messages will be available in the next version. I will close the issue and please reopen it if you have further questions or suggestions.
If the count matrix is not
log1p
normalized to a maximum of 10000, Celltypist resorts toadata.raw.X
instead ofadata.X
.In my case
adata.raw
is not populated at all, so instead of hinting to the the unexpected counts, Celltypist raisesI would suggest adding an optional parameter, e.g.
enforce_x
,allow_raw_counts
or something like that, that converts the log messageinto an exception.