-
Notifications
You must be signed in to change notification settings - Fork 0
Add PCA (dimensionality reduction) compute and plot #1504
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds a new dimensionality reduction computation plugin and enhances the scatterplot visualization to support computed variables in backend requests. The implementation follows the pattern of similar plugins like beta diversity.
- Adds a
dimensionalityReductioncomputation plugin with PCA axis support - Introduces
sendComputedVariablesInRequestoption to control whether computed variable descriptors are sent to the backend - Registers the new plugin in the computation plugins index
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| packages/libs/eda/src/lib/core/components/visualizations/implementations/ScatterplotVisualization.tsx | Adds sendComputedVariablesInRequest option and uses it to conditionally send computed X/Y axis descriptors to backend |
| packages/libs/eda/src/lib/core/components/computations/plugins/index.ts | Registers the new dimensionalityreduction plugin |
| packages/libs/eda/src/lib/core/components/computations/plugins/dimensionalityReduction.tsx | New computation plugin for dimensionality reduction (PCA) with configuration UI and computed axis details |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
For the differential expression notebook.
This PR works with PR 75 in
service-eda. Can use qa mbio to test and see example requests in that PR.Tasks
Notes:
Can't use the scatterplot straight up because the dim red plot needs to set its own x/y axes with the computed variable (in beta div, the client doesn't set x/y. it just gets only that stuff from the backend). So I used the
Optionsfeature to have the new computedimensionalityReductiontellScatterplotVisualizationthat it wants to use these computed variables and that these computed vars need to be used in the request to the backend. We could have done it more simply with some hard coding but this will make it easier for us to add the ability to choose which principle coordinate the user wants for each axis. The backend is already prepped for this new feature, so the frontend might as well be, too.Testing (updated 11/04/25)
yarn ... /eda).IMPORTANT - do not merge with index.ts still including this compute. The backend has mbio approved for this compute because we need it for data testing. We can merge all this work but we must take it out of index.ts first so that it doesn't accidentally show up on the mbio live site someday on accident 😬