scverse / scverse/scanpy

sc.tl.rank_genes_groups to rank only specific genes of interest?

Open
#748 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

After clustering cells with a restricted gene set, I would like to see the contribution of "specified genes" in subgrouping the cells.

sc.tl.rank_genes_groups uses all the genes in the background for the statistical calculations. I want to test it for all the Louvain groups against the rest of the data (so, groups='all', reference='rest').

Is there a way, we can specify the gene list? (I tried using the use_raw of sc.tl.rank_genes_groups to subset). I don't find any other options to restrict gene lists here.

subset_genes = ldata[:, ['Gabrg1', 'Ntrk1', 'Htr1a', 'Plaur', 'Il31ra', 'Gabrg3', 'P2rx3', 'Oprk1', 'P2ry1', 'Cnih3']]
sc.tl.rank_genes_groups(ldata, 'louvain', method='wilcoxon', use_raw= 'subset_genes', n_genes = 100)
sc.pl.rank_genes_groups(ldata, n_genes=15, sharey=False)

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 reading the sc.tl.rank_genes_groups entry point and how its use_raw, groups, reference, and n_genes options feed the statistical calculations. The change is complete when callers can provide a restricted gene list while retaining groups='all' and reference='rest', and sc.pl.rank_genes_groups displays the resulting rankings.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.