cellgeni / sceasy

A package to help convert different single-cell data formats to each other
GNU General Public License v3.0
346 stars 52 forks source link

seurat to anndata formatting adata.X as CSC sparse resulting in inefficient handling #69

Open dpcook opened 1 year ago

dpcook commented 1 year ago

Just documenting this in case others encounter it and find it helpful. I have been using sceasy in R to convert my Seurat objects to Anndata. I had noticed I was getting slow training speeds with scVI.

Not familiar with scipy's sparse matrix formats, I was ignoring a warning message telling me about the issue, but type(adata.X) was CSC sparse, which is apparently inefficient at row splicing. After converting with adata.X = scipy.sparse.csr_matrix(adata.X), scVI training speeds increased 10-fold.