Repository navigation
Build the benchmark workflow on runEach, and score the run - #3
Merged
Merged
Conversation
run_benchmark was hand-written Nextflow: one process per stage, a `case` block choosing a method, and a shell call into `target/executable/...`. One invocation covered one method combination, and nothing collected the results - the metric h5ads were published and a separate script harvested them afterwards. It is now the OpenProblems `runEach` / `fromState` / `toState` idiom. A state threads down the chain carrying the files produced so far and a `steps` list recording which component produced each, and the workflow ends in a scoring stage that writes every metric value with the chain that produced it. Two things in the components had to change first, and neither was visible while the workflow called executables: - No component declared a `nextflow` runner, only `executable`. Viash cannot emit a component as a Nextflow module without one, so composing modules was not possible at all. The failure does not say so: `viash ns build` reports the workflow's 21 dependencies as *missing*. - No output file argument declared an `example`. Viash takes the extension of an auto-generated output filename from `example`; without one the file gets no extension, and `np.save` appends `.npy` to a path that lacks it. The component wrote `...output_image.npy` while the module looked for `...output_image` and reported it missing. The old workflow passed explicit paths that already carried the extension, which is why this never showed. One invocation now runs many chains, and which ones is an argument rather than an outer bash loop. `--default_methods` names the baseline, one method per step, and a method that is not a default is only combined with the defaults - so each non-baseline chain differs from the baseline in exactly one step, which is what makes a difference in a metric attributable to a single choice. With the shipped defaults that is 10 chains rather than the 162 a cross-product would give. Per-method parameters are no longer workflow arguments. The 40-argument config collapses to the method-selection lists plus the three metric arguments that depend on the antibody panel; everything else comes from the component defaults, or from `--method_parameters_yaml`, which can also sweep one parameter across values. `--viash_engine` is gone with the shell calls: the engine is now a Nextflow profile. `file_score.yaml` stops requiring `dataset_id`, `normalization_id` and `method_id`. A metric here cannot know them - the result comes from a chain of five methods and the file a metric reads carries no record of the four steps before the last. The workflow attaches them instead, which is the only place that has them. The file now describes what metrics do write, and the six metric contracts merge it into their `--output`. Verified end to end on a 512x512 crop of exemplar-001 under the native engine: 10 chains x 6 metric families = 60 score records over 82 distinct metric ids. The axes separate as they do on the full image - `n_cells` 239 for threshold against 293 for watershed, `qc_pass_rate` 1.00 / 0.91 / 0.55 across the three QC methods, and `variance_explained_by_covariate_counts` 0.788 for `sum` against 0.035 for `mean`. Chains differing only in normalization report identical segmentation metrics, as they must when normalization is per-cell. A separate run exercised `--method_parameters_yaml`: the `default` block reached every variant and each swept value reached its own run. `viash ns test --engine native`: 21/21 SUCCESS. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
3 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run_benchmark was hand-written Nextflow: one process per stage, a
caseblock choosing a method, and a shell call intotarget/executable/.... One invocation covered one method combination, and nothing collected the results - the metric h5ads were published and a separate script harvested them afterwards.It is now the OpenProblems
runEach/fromState/toStateidiom. A state threads down the chain carrying the files produced so far and astepslist recording which component produced each, and the workflow ends in a scoring stage that writes every metric value with the chain that produced it.Two things in the components had to change first, and neither was visible while the workflow called executables:
nextflowrunner, onlyexecutable. Viash cannot emit a component as a Nextflow module without one, so composing modules was not possible at all. The failure does not say so:viash ns buildreports the workflow's 21 dependencies as missing.example. Viash takes the extension of an auto-generated output filename fromexample; without one the file gets no extension, andnp.saveappends.npyto a path that lacks it. The component wrote...output_image.npywhile the module looked for...output_imageand reported it missing. The old workflow passed explicit paths that already carried the extension, which is why this never showed.One invocation now runs many chains, and which ones is an argument rather than an outer bash loop.
--default_methodsnames the baseline, one method per step, and a method that is not a default is only combined with the defaults - so each non-baseline chain differs from the baseline in exactly one step, which is what makes a difference in a metric attributable to a single choice. With the shipped defaults that is 10 chains rather than the 162 a cross-product would give.Per-method parameters are no longer workflow arguments. The 40-argument config collapses to the method-selection lists plus the three metric arguments that depend on the antibody panel; everything else comes from the component defaults, or from
--method_parameters_yaml, which can also sweep one parameter across values.--viash_engineis gone with the shell calls: the engine is now a Nextflow profile.file_score.yamlstops requiringdataset_id,normalization_idandmethod_id. A metric here cannot know them - the result comes from a chain of five methods and the file a metric reads carries no record of the four steps before the last. The workflow attaches them instead, which is the only place that has them. The file now describes what metrics do write, and the six metric contracts merge it into their--output.Verified end to end on a 512x512 crop of exemplar-001 under the native engine: 10 chains x 6 metric families = 60 score records over 82 distinct metric ids. The axes separate as they do on the full image -
n_cells239 for threshold against 293 for watershed,qc_pass_rate1.00 / 0.91 / 0.55 across the three QC methods, andvariance_explained_by_covariate_counts0.788 forsumagainst 0.035 formean. Chains differing only in normalization report identical segmentation metrics, as they must when normalization is per-cell. A separate run exercised--method_parameters_yaml: thedefaultblock reached every variant and each swept value reached its own run.viash ns test --engine native: 21/21 SUCCESS.Describe your changes
Checklist before requesting a review
I have performed a self-review of my code
Check the correct box. Does this PR contain:
Proposed changes are described in the CHANGELOG.md
CI Tests succeed and look good!