theislab / scib

Benchmarking analysis of data integration tools
MIT License
294 stars 63 forks source link

Normalize: could not find function "sizeFactors" #331

Closed Mari123i closed 2 years ago

Mari123i commented 2 years ago

Hello,

I have a dataset to normalize and when using normalize from scib I get the following error:

RRuntimeError: Error in sizeFactors(computeSumFactors(SingleCellExperiment(list(counts = data_mat)),  : 
could not find function "sizeFactors"

Versions: scib 1.0.3 scanpy 1.9.1 anndata 0.8.0 anndata2ri 1.0.6

Any tips on where this is coming from are very much apprechiated.

mumichae commented 2 years ago

Hi, thanks for pointing that out.

You are missing the R package scran for that function to work properly. We haven't addressed it in the documentation yet. Since R methods can't be managed by python installers, you need to install scran manually to the R instance that rpy2 accesses. Make sure you have Bioconductor installed as well.

We implemented scran as it was recommended by the Current best practices in single-cell RNA-seq analysis. Depending on your problem, you might also want to consider using one of the simpler normalisation methods implemented in scanpy.