Add a ``batch_key`` to ``sc.pp.scale()``
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 779
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 27
Description
What kind of feature would you like to request?
Additional function parameters / changed functionality / changed defaults?
Please describe your wishes
Being able to z-score each batch separately is a pretty easy way to overcome some technical effect in the data. Inspired by multiMAP and its per-batch scaling, I just ran BBKNN on the pancreas having z-scored each of the four batches separately, and got an improved output:
Seems like it might be worth offering this as an option in the scaling function?
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 with the sc.pp.scale() entry point and inspect how its current scaling parameters and batch-related data are handled. Define the expected batch_key behavior from the request, then verify that z-scoring is performed separately for each batch and that existing scaling behavior remains unchanged when it is omitted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- bioinformatics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100