scverse / scverse/scanpy

Regressing out genes

Open
#492 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Python
Stars
2.6k
Forks
779
Avg merge
1d 4h
Merged PRs (30d)
27

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the sc.pp.regress_out entry point and reproduce the issue with the provided adata.obs assignment and gene argument. Determine whether regressing out a gene with many zero-expression cells is supported; done means the requested gene-level regression works without PerfectSeparationError or the limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.