-
Notifications
You must be signed in to change notification settings - Fork 1
Color by selection mapping #186
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
Conversation
ThomasKroes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a nice addition!
From an architectural point of view, I would argue that we should try to avoid too much bespoke (niche) solution for individual viewers in bread-and-butter plugins. Having said that, doing it here now is logical, as the core does not facilitate more advanced color mapping schemes. There are several other types of viewers that can benefit from mapping schemes with more room to maneuver, so I will put this on the long-term agenda.
* WIP: color by selection mapping * Add explanations * Delay check * Better be safe * Add Reverse mapping as well * Fix false parent * Move new functions to own file * Centralize & inline check * Simpler return types and checks * Single swap * WIP: map means to HSNE embedding * Fix mapping from source of position to color by linked data * Remove debug prints * Delay surjection check for faster UI response
Follow-up to #185
Currently points in the scatterplot can be recolored based on other data if the other data...
a. has the same number of points
b. is derived from a parent that has the same number of points (e.g. for HSNE embeddings)
This PR adds:
c. data which has a fully-covering selection mapping (linked data)
For mapping the colors from the color data to the point data we use in (b) the global indices and in (c) the linked data.
There are several possible mappings handled and checked in this order:
This new feature is required for the Basal Ganglia project, specifically for recoloring HSNE and UMAP embeddings with means on cluster expression (these are the linked data).
Implementing mappings for opacity and size could be done similarly, but would not be nicely contained like here, since the opacity and size values are extracted in a different way at a different location in code.