-
Notifications
You must be signed in to change notification settings - Fork 21
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
warn annotation loss with resolution change #977
Changes from 5 commits
14d61a7
d740156
72816ab
622baee
daae0d4
b0399ac
69f0bcb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,10 +9,9 @@ import { | |||||||||||||||||||||||||||
import { saveProcessingSettings } from 'redux/actions/experimentSettings'; | ||||||||||||||||||||||||||||
import { loadBackendStatus } from 'redux/actions/backendStatus'; | ||||||||||||||||||||||||||||
import { loadEmbedding } from 'redux/actions/embedding'; | ||||||||||||||||||||||||||||
import { runCellSetsClustering } from 'redux/actions/cellSets'; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const runOnlyConfigureEmbedding = async (experimentId, embeddingMethod, dispatch) => { | ||||||||||||||||||||||||||||
await dispatch(saveProcessingSettings(experimentId, 'configureEmbedding')); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
dispatch({ | ||||||||||||||||||||||||||||
type: EXPERIMENT_SETTINGS_DISCARD_CHANGED_QC_FILTERS, | ||||||||||||||||||||||||||||
payload: {}, | ||||||||||||||||||||||||||||
|
@@ -28,6 +27,21 @@ const runOnlyConfigureEmbedding = async (experimentId, embeddingMethod, dispatch | |||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const runOnlyClustering = async (experimentId, resolution, dispatch) => { | ||||||||||||||||||||||||||||
dispatch({ | ||||||||||||||||||||||||||||
type: EXPERIMENT_SETTINGS_DISCARD_CHANGED_QC_FILTERS, | ||||||||||||||||||||||||||||
payload: {}, | ||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// Only configure embedding was changed so we run loadEmbedding | ||||||||||||||||||||||||||||
dispatch( | ||||||||||||||||||||||||||||
runCellSetsClustering( | ||||||||||||||||||||||||||||
experimentId, | ||||||||||||||||||||||||||||
resolution, | ||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// Question for review, I thought of implementing this function for all the URLs here | ||||||||||||||||||||||||||||
// (extracting all the URLs into one single place and using constants to | ||||||||||||||||||||||||||||
// define which url I am trying to access) | ||||||||||||||||||||||||||||
|
@@ -42,12 +56,27 @@ const runQC = (experimentId) => async (dispatch, getState) => { | |||||||||||||||||||||||||||
const { processing } = getState().experimentSettings; | ||||||||||||||||||||||||||||
const { changedQCFilters } = processing.meta; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (changedQCFilters.size === 1 && changedQCFilters.has('configureEmbedding')) { | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With changedQCFilters.size === 1 removed, now that means that if there's more than one changed filter, running it with changed embedding or clustering in the last step will discard them all and run only embedding / clustering? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I cant test in staging because i dont have an hms account but what i see is that now this will be run even if there are other There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you send me an email I'll create an account for you to test. Here is why it doesn't run if there are other steps changed: const otherChanged = [...changedQCFilters].some((value) => value !== 'embeddingSettings' && value !== 'clusteringSettings'); This checks to see if there are other settings changed. If there are not, then the below conditional block runs. See added comments to hopefully clarify: if (!otherChanged) {
// this runs because exactly embedding or clustering or both has changed (but nothing else)
await dispatch(saveProcessingSettings(experimentId, 'configureEmbedding'));
if (embeddingChanged) {
runOnlyConfigureEmbedding(
experimentId,
processing.configureEmbedding.embeddingSettings.method,
dispatch,
);
}
if (clusteringChanged) {
runOnlyClustering(
experimentId,
processing.configureEmbedding.clusteringSettings.methodSettings.louvain.resolution,
dispatch,
);
}
// we return because we are in the !otherChanged block so nothing else changed and we don't re-run QC
return;
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh alright sorry There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not at all -- thank you -- always good to have a careful review :) |
||||||||||||||||||||||||||||
runOnlyConfigureEmbedding( | ||||||||||||||||||||||||||||
experimentId, | ||||||||||||||||||||||||||||
processing.configureEmbedding.embeddingSettings.method, | ||||||||||||||||||||||||||||
dispatch, | ||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||
const embeddingChanged = changedQCFilters.has('embeddingSettings'); | ||||||||||||||||||||||||||||
const clusteringChanged = changedQCFilters.has('clusteringSettings'); | ||||||||||||||||||||||||||||
const otherChanged = [...changedQCFilters].some((value) => value !== 'embeddingSettings' && value !== 'clusteringSettings'); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// if only embedding or clustering changed | ||||||||||||||||||||||||||||
if (!otherChanged) { | ||||||||||||||||||||||||||||
await dispatch(saveProcessingSettings(experimentId, 'configureEmbedding')); | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also if you move back the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The problem with this is that it will run the conditional block if there are other changes to Data Processing in addition to an embedding or clustering change. I want the condition to run if there is only an embedding or clustering change (or both but nothing else). Embedding and clustering will be run after the pipeline finishes if there are any other changes so I don't want to call embedding/clustering in those cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
happy to move the line back if you have a preference. I moved it out so that it wasn't duplicated between the two functions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was only thinking in case we want to use the |
||||||||||||||||||||||||||||
if (embeddingChanged) { | ||||||||||||||||||||||||||||
runOnlyConfigureEmbedding( | ||||||||||||||||||||||||||||
experimentId, | ||||||||||||||||||||||||||||
processing.configureEmbedding.embeddingSettings.method, | ||||||||||||||||||||||||||||
dispatch, | ||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
if (clusteringChanged) { | ||||||||||||||||||||||||||||
runOnlyClustering( | ||||||||||||||||||||||||||||
experimentId, | ||||||||||||||||||||||||||||
processing.configureEmbedding.clusteringSettings.methodSettings.louvain.resolution, | ||||||||||||||||||||||||||||
dispatch, | ||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
return; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
@@ -57,7 +86,6 @@ const runQC = (experimentId) => async (dispatch, getState) => { | |||||||||||||||||||||||||||
const stepConfig = processing[stepKey]; | ||||||||||||||||||||||||||||
processingConfigDiff[stepKey] = stepConfig; | ||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
try { | ||||||||||||||||||||||||||||
// We are only sending the configuration that we know changed | ||||||||||||||||||||||||||||
// with respect to the one that is already persisted in dynamodb | ||||||||||||||||||||||||||||
|
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.
Why only the first changed from the diff and not the whole
Object.keys(diff)
?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.
Each of the diffs is a single object where the top level key is either going to be
embeddingSettings
orclusteringSettings
. This just extracts that key.