Repository navigation
Fix highly variable gene selection with duplicate names - #4417
Open
thirumurugan-2006 wants to merge 4 commits into
Open
thirumurugan-2006 wants to merge 4 commits into
thirumurugan-2006 wants to merge 4 commits into
Conversation
Author
|
can i merge it |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4417 +/- ##
==========================================
- Coverage 83.78% 0 -83.79%
==========================================
Files 134 0 -134
Lines 12691 0 -12691
==========================================
- Hits 10633 0 -10633
+ Misses 2058 0 -2058
Flags with carried forward coverage won't be shown. Click here to find out more. |
Author
|
is the benchmark will take longer time |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5 of 6 tasks
Author
|
The failing CI run appears to be unrelated to my documentation changes. The failure is in |
5 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<!--
Thanks for opening a PR to scanpy!
Please be sure to follow the guidelines in our contribution guide (https://scanpy.scverse.org/page/dev/) to familiarize yourself with our workflow and speed up review.
-->
LLM usage
LLM or coding agent used: GitHub Copilot via VS Code
If one was used, I, a human, have reviewed, understood and tested every changed line
Closes
highly_variable_genes(flavor="seurat_v3")flags more thann_top_genesgenes whenvar_namescontain duplicates #4405Tests included
Release notes not necessary because: this is a focused bug fix with no API change
No milestones
Summary
scanpy.pp.highly_variable_genes(flavor="seurat_v3")could select more thann_top_geneswhenadata.var_namescontained duplicate gene names.The previous implementation used label-based
.locassignment after sorting. Duplicate labels could cause multiple rows to be marked as highly variable, exceeding the requested number.This change uses positional row selection for the final assignment, ensuring that selection is based on individual rows rather than gene-name labels.
Tests
n_top_genes=30.seurat_v3and selection-consistency tests.git diff --checkand Python syntax checks.Release notes
No release note is necessary because this is a focused bug fix with no public API change.