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
Split up rank_genes_groups and highly_variable_genes #4305
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
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.
I think your PR does this fairly well already. I think we can add more nuonced kwards to each spefic or all functions
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.
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.
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.
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?
Activity
zboldyga commentedon Oct 5, 2026
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.
Intron7 commentedon Oct 8, 2026
I think your PR does this fairly well already. I think we can add more nuonced kwards to each spefic or all functions
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.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.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.flying-sheep commentedon Oct 26, 2026
HVG might need this even more, so many flavors
Intron7 commentedon Oct 26, 2026
Yes please
[-]Split up rank_genes_groups[/-][+]Split up rank_genes_groups and highly_variable_genes[/+]flying-sheep commentedon Nov 10, 2026
@grst on zulip:
flying-sheep commentedon Nov 10, 2026
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.
ilan-gold commentedon Nov 10, 2026
And also, just my two cents, similar to
neighbors, the current code is unreadable. We should take this opportunity to rectify this.