-
Notifications
You must be signed in to change notification settings - Fork 3
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
Function: group_classes (OR logic for rules) #8
Comments
I thought more about the API. I think the most intuitive is a group argument in the rule function: More thoughts:
This feature might be fun to implement! I'll save it for a rainy day, and then I'll be like |
Don't forget this check:
|
One more requirement: has to be compatible with grouping existing labels, see #16 . That probably means an argument to "rule" alone does not cut it, I'll need a separate function, right? Something like this: |
I feel this might still be a relevant feature and should start collecting use-cases. Any ideas, anyone? |
Currently all rules are combined with AND, but there might be cases where OR is useful.
Motivation
Use-case 1: For example, markers a1 and a2 might have nice but imperfect overlap, and both mark cell type A. If A has subtypes it may well be we'd want to set the subtype's parent to either a1 OR a2. For this, introducing a group called "A" as a kind of virtual class (no own rules) would help.
Use-case 2: for plotting, we might want to have all myeloid cells in the same colors. Introducing the "myeloid" class could achieve this:
Since mono and DC have no common parent, this can not be achieved without the group_classes function.
How to implement
obj$classes currently has "class" and "parent" columns. parent is either a class name or the special key word "..root..". I propose to create the second key word "..group.." and the slot obj$class_groups; this could be a named list (name is group name, elements are classes belonging to the group.
The text was updated successfully, but these errors were encountered: