Scanpy equivalent of Seurat's ScaleData()

Hello! I’m trying to replicate a paper that uses Seurat’s ScaleData function to scale, center, and regress out certain variables. See here for documentation. What would be the scanpy equivalent to replicate this? I know that sc.pp.regress_out() exists, but does this update the feature values with the scaled and centered residuals like Seurat’s function does?

Secondly, when I use sc.pp.regress_out(), the column does not change. I was under the impression that it should be updated as the residual of the regression. Does anyone have an idea why this might be?

@spkhowe, I think you’re looking for sc.pp.scale, which you would call before regressing out your variables of interest.

For the second part, I’m not entirely sure what you mean. regress_out replaces the values of X with the residuals.