scverse / scverse/scanpy

rank genes groups errors on less than 2 cells in a category

Open
#3,118 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area – Differential Expression
Dominant language
Python
Stars
2.6k
Forks
779
Avg merge
1d 4h
Merged PRs (30d)
27

Description

Hello,

I am using scanpy rank genes groups, and rank genes group filter for differential expression analysis after using a classifier. I often receive errors because statistics cannot be calculated on these types of low count groups. The workaround I have found is to drop these cells from the adata object, and then continue with differential expression.

Is there an existing solution for this that is better? Could we consider adding this as a flag to the function call? What I have in mind is a flag like "ignore_low = True". The flag would operate by taking the passed adata object, applying the 2 cell filtration internally, and performing differential expression as normal on this internal object. It would then append the relevant uns categories to the original adata object before exiting. The threshold could even be passable to make this more general.

What do we think? Is this too niche for this scale of a repository? In principle, I think that forcing these observations to be dropped is not best practice.

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 by locating the rank_genes_groups and rank_genes_groups_filter APIs and reviewing how low-count categories currently reach the statistical calculation. The issue proposes an optional low-count threshold, internal filtering, and preservation of relevant uns categories; done requires an agreed design for that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.