extend options to aggregate ranks across batches for HVG selection
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 779
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 27
Description
I would like to get an opinion from @gokceneraslan, @adamgayoso (who implemented this originally), or someone else more familiar in hvg selection here.
I feel like we should probably have multiple methods for this, which we expose via a kwarg. I'm not confident median rank makes sense as a value here. I think there are assumptions about what kinds of values a rank can have that get broken by taking the median.
Is the method for aggregating hvgs from multiple batches here reasonable? For reference, a similar code block can be found in _highly_variable_genes_seurat_v3, which says this is the method used in SelectIntegrationFeatures from Seurat.
Originally posted by @ivirshup in https://github.com/theislab/scanpy/pull/1715#discussion_r736690390
@jlause commented:
I agree that exposing multiple options could make sense here. Any opinion @gokceneraslan and @adamgayoso which ones we should implement / which one should be the default?
I just copied this part from the seurat_v3 batch integration, so I don't have an expert opinion - but if I remember correctly, the other flavors use dispersions_norm to break ties instead of using the median rank. If I read the code correctly, this is the within-batch dispersion averaged over batches.
We could also do something similar here: Compute residual variance within each batch, take the average across batches, and use that to break ties instead of using median rank.
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 existing batch aggregation logic and compare it with the code block in _highly_variable_genes_seurat_v3, which follows Seurat's SelectIntegrationFeatures. Investigate the discussion around median rank, dispersions_norm, and averaged residual variance. Done means agreeing on supported aggregation methods, selecting a default, and exposing the choice through a keyword argument.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- bioinformatics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100