Here there is a size factor calculation in R which can be painful (i.e. setting up stable environment, etc.) ! I would use pyDESeq2 since it's now a well maintained python tool.
from pydeseq2 import preprocessing
_, size_factors = preprocessing.deseq2_norm(adata.X)
Here there is a size factor calculation in R which can be painful (i.e. setting up stable environment, etc.) ! I would use pyDESeq2 since it's now a well maintained python tool.