scverse / scverse/scanpy

Scatter plots coloring when a gene in the column specified by `gene_symbols=` corresponds to multiple entries

Open
#926 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  • Additional function parameters / changed functionality / changed defaults?

When coloring by a gene in a column of .var specified by gene_symbols= and when there are multiple entries in .var sharing the same value of that attribute, currently only the first entry is used to coloring. Would you consider allowing a different summarisation, e.g. mean/sum/etc? An existing work around is that the user calculate that summarisation oneself and insert it into .obs, but it becomes tedious when the number grows. For example, this occurs when mapping genes across species with one-to-many mappings kept.

https://github.com/theislab/scanpy/blob/233aa15adbf565a7cb278d0724e3cb3f566b749f/scanpy/plotting/_tools/scatterplots.py#L844

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 in scanpy/plotting/_tools/scatterplots.py around the referenced line, where coloring by gene_symbols= handles matching .var entries. Determine how an aggregation choice such as mean or sum should be specified and what behavior is expected when multiple entries match; done should allow those entries to be summarized instead of using only the first one, with the relevant scatter-plot behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.