Skip to content

Take n_bins into account for the cell_ranger flavor of highly_variable_genes #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

e-sollier
Copy link

@e-sollier e-sollier commented Apr 26, 2019

I've changed one line in the highly_variable_genes function, so that n_bins is taken into account with the cell_ranger flavor (currently only the seurat flavor uses this parameter).

Additionally, I have noticed that, in the current version, the bins are slightly offset: after -INF, it starts at 10, instead of 5, which results in the first bin containing twice as many genes as the other bins. I don't know if this is intentional (for example, to exactly reproduce the results of cell ranger) or not.
In the version that I suggest, I have removed this offset. As a consequence, with the default parameter of n_bins=20, my new version does not exactly reproduce the results of the previous version. In order to exactly reproduce the current results, we would have to keep this offset by doing range(2,n_bins+1) instead of range(1,n_bins).

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (86b85ee) 72.72% compared to head (f233d75) 72.72%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #624   +/-   ##
=======================================
  Coverage   72.72%   72.72%           
=======================================
  Files         111      111           
  Lines       12384    12384           
=======================================
  Hits         9006     9006           
  Misses       3378     3378           
Files Coverage Δ
scanpy/preprocessing/_highly_variable_genes.py 96.17% <ø> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants