You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Seurat, there is an option of selecting a list of genes in the pre-processing regressOut function. I was wondering if there was similar functionality in Scanpy. Doing something like below does not work for me as a lot of the cells have 0 expression, giving me a PerfectSeparationError.
Hi,
I'm not entirely sure how Seurat does it, but I assume you could take the mean expression level (or mean z-score) of a couple of genes, store that in a .var column, and regress that out by sc.pp.regress_out(adata, var_col)?
If you want to ensure an equal contribution of all the genes to the gene score without weighting by mean gene expression, you could first use sc.pp.scale() on a copy of the adata object like this:
In Seurat, there is an option of selecting a list of genes in the pre-processing regressOut function. I was wondering if there was similar functionality in Scanpy. Doing something like below does not work for me as a lot of the cells have 0 expression, giving me a PerfectSeparationError.
adata.obs[gene] = adata[:, adata.var_names==gene].X
sc.pp.regress_out(adata,gene)
Any help would be appreciated. Thank you!
The text was updated successfully, but these errors were encountered: