Skip to content

n_bins not respected in highly_variable_genes(..., flavour='cell_ranger') #888

Open

Description

@flying-sheep

This code creates the range [10, 15, …, 100], which is 19 values. Taking those percentiles together with -inf and +inf creates 20 bins (from 21 bin borders), understood.

https://github.com/theislab/scanpy/blob/e6e08e51d63c78581bb9c86fe6e302b80baef623/scanpy/preprocessing/_highly_variable_genes.py#L90

But 1. why start at 10% and 2. why is n_bins ignored and there are always 20 bins created?

@Koncopd @falexwolf you introduced this in #330, is this what cellranger does?

Activity

  1. davidhbrann commented on Oct 30, 2019

    @davidhbrann
    Contributor

    We also tried to address this in #572 and #624 but neither of those PRs have been merged since they're not fully backwards compatible.

  2. flying-sheep commented on Oct 30, 2019

    @flying-sheep
    MemberAuthor

    Well, we really need to get that release out of the door.

    But on the other hand, as @gokceneraslan said the current behavior is a bug, so we can change it now!

    Gökçen, do you still plan on consolidating those PRs?

  3. flying-sheep commented on Jan 19, 2024

    @flying-sheep
    MemberAuthor

    5 years later, this is still not fixed … where is the decision recorded that they shouldn’t be merged?

  4. Zethson commented on Nov 17, 2026

    @Zethson
    Member

    I'd say 2.0 is a good time?
    Fix is in #4530 - should we put this behind a 2.0 flag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions