scverse / scverse/scanpy

Always add 'use_rep' for uns["neighbors"]["params"]

Open
#2,736 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Dimensionality Reduction 🤏 Area - Metadata 📝
Dominant language
Python
Stars
2.6k
Forks
779
Avg merge
1d 4h
Merged PRs (30d)
27

Description

Please describe your wishes and possible alternatives to achieve the desired result.

No key inside 'use_rep' can mean 'X' or 'X_pca' was used for nearest neighbor calculation depending on the number of vars. It's storing things correctly if 'use_rep' is called explicitly.

sc.pp.neighbors(combined_emb, n_neighbors=50)
combined_emb.uns["neighbors"]["params"]["use_rep"] -> KeyError

sc.pp.neighbors(combined_emb, n_neighbors=50, use_rep='X')
combined_emb.uns["neighbors"]["params"]["use_rep"] -> 'X'

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 sc.pp.neighbors and reproduce the two examples in the issue, comparing the implicit and explicit use_rep cases. The work is done when uns["neighbors"]["params"] includes use_rep with the representation actually used in both cases, while preserving the existing explicit behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.