Teichlab / celltypist

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

Add rsc support #113

Closed Intron7 closed 5 months ago

Intron7 commented 6 months ago

This adds support for rapids-singlecell for the over clustering #110 . The results might differ a bit since rsc uses a brute-force knn approach and the leiden clustering is also slightly different.

The overclustering step is now for 200k cells 15x faster (3min vs 12s).

It's also set up in a way where when rsc fails to import it will default back to scanpy.

Please don't merge this yet since it uses the syntax that will be released with rapids-singlecell 0.10.0. This will come out shortly after scanpy 1.10.0

Intron7 commented 6 months ago

ok so scanpy released today so I'll also release later today.

ChuanXu1 commented 5 months ago

@Intron7, I have a question: why in _construct_neighbor_graph_rsc, you use adata = adata[:, adata.var.highly_variable].copy() instead of adata = adata[:, adata.var.highly_variable]?

Intron7 commented 5 months ago

The copy() crates the subsetted matrix and it's not a view anymore. That works a lot better with a lot with the following functions