Skip to content

Split up rank_genes_groups and highly_variable_genes #4305

Description

@Intron7

What kind of feature would you like to request?

Additional function parameters / changed functionality / changed defaults?

Please describe your wishes

We should think about splitting rank_genes_groups into all its methods having on function or each. This would make API handling easier and allow for more parameter for each function. eg add a split_by or return_u for wilcoxon

Activity

  1. added
    Triage 🩺
    on Aug 18, 2026
  2. removed
    Triage 🩺
    on Aug 24, 2026
  3. zboldyga commented on Oct 5, 2026

    @zboldyga
    Contributor

    hey Severin ( @Intron7 ), I've been working on this module this year and will be proposing a cleanup PR shortly, mainly targeted at tech debt and antipatterns like the shared state. There may be overlap in your proposed idea here so I'm curious to understand this before I move forward.

    Which pain points / problems do you imagine solving with the split up? / Could you provide an example or two of what you have in mind?

    I'm also digging in and going thru the history of discussions around the file -- it seems a fair amount is in github Issue/PR history.

  4. Intron7 commented on Oct 8, 2026

    @Intron7
    MemberAuthor

    I think your PR does this fairly well already. I think we can add more nuonced kwards to each spefic or all functions

    1. return_u: Wilcoxon already computes the U statistic, so storing it (or AUROC = U / (n1·n2)) gives users an effect size at no extra compute cost.
    2. logreg kwargs: Logistic regression currently gets its settings through untyped **kwds passed straight to sklearn, so a separate function could list C, penalty, solver and max_iter as real, documented parameters that are checked when you call it.
    3. split_by: this one is more general basicall internalizing some loop. each sample or batch keeps clusters that come mostly from one donor from producing batch effects that look like markers.
  5. flying-sheep commented on Oct 26, 2026

    @flying-sheep
    Member

    HVG might need this even more, so many flavors

  6. Intron7 commented on Oct 26, 2026

    @Intron7
    MemberAuthor

    Yes please

  7. changed the title [-]Split up rank_genes_groups[/-] [+]Split up rank_genes_groups and highly_variable_genes[/+] on Oct 27, 2026
  8. flying-sheep commented on Nov 10, 2026

    @flying-sheep
    Member

    @grst on zulip:

    I have a strong opinion on not using rank_genes_groups for any comparison that's between groups of samples. But I also agree that pseudo-bulk+pydeseq2 is not the best way for identifying marker genes.

    rank_genes_groups might work reasonably well, but is there really not anything better? E.g. there's cosg, but it hasn't gained a lot of traction.

    I wonder if the distinction between finding marker genes and comparing between samples could be made clearer from an API perspective, e.g. tl.compare_clusters vs. tl.compare_groups?

  9. flying-sheep commented on Nov 10, 2026

    @flying-sheep
    Member

    there’s a huge draft in #4400. I agree with Ilan that the deseq part needs to go from it, but the marker splitting part is similar to what we want.

  10. ilan-gold commented on Nov 10, 2026

    @ilan-gold
    Contributor

    And also, just my two cents, similar to neighbors, the current code is unreadable. We should take this opportunity to rectify this.

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions