You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
equal_frequency bins in highly_variable_genes #415
Using Seurat, in their variable gene function I've had some success using the equal_frequency option, where each bin contains an equal number of genes. Would it possible to implement this option in scanpy?
If you'd like I could submit a PR to implement this feature. I think it could be as simple as using pd.qcut instead of pd.cut or you could use a similar style as in the cell_ranger flavor with pd.cut(df['mean'], np.r_[-np.inf, np.percentile(df['mean'], np.arange(10, 105, 5)), np.inf]). I don't know how useful it would be, but I could also add the option to have more bins in the cell_ranger flavor by replacing np.arange(10,105,5) with np.linspace(10, 100, n_bins - 1).
Activity
falexwolf commentedon Jan 8, 2019
These appear to be consistent, simple changes and I assume they would be covered by this test: https://github.com/theislab/scanpy/blob/master/scanpy/tests/test_highly_variable_genes.py
If you have any doubts about this, let's discuss before making a PR. Otherwise, I'm happy if you move forward with it.
flying-sheep commentedon May 8, 2025
Pretty sure this is fixed now