Scatter plots coloring when a gene in the column specified by `gene_symbols=` corresponds to multiple entries
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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