Generate alternatives#113
Open
aaronstrachardt wants to merge 26 commits into
Open
Conversation
Translates node status (Keep/Ban/Vary) and edge status (chain/break) into APE constraint objects and assembles the full synthesis config JSON including I/O EDAM tuples, tool taxonomy paths, and generation parameters.
…e initialization Handles CWL file upload via POST /alternatives/parse, builds the ReactFlow graph from the parsed DAG, and initialises all tool nodes to Keep status (§4.3 conservative strategy). Node clicks cycle through Keep/Vary/Ban; edge clicks toggle chain/break constraints.
… modal Shows active Keep/Ban/Chain/Break constraints, APE synthesis parameters (min/max length, timeout, solutions), a generate button with loading state, and a modal to inspect the generated APE config JSON.
…w, and synthesis Shows a drag-and-drop CWL upload zone before a file is loaded, then switches to a ReactFlow graph with a filename pill overlay. Builds the APE synthesis config from the current constraint state and navigates to /explore/results after successful synthesis.
…aStore Accepts a pre-built APE config object and an optional input tool sequence string. After synthesis, filters out any solution whose descriptive_name matches the input workflow's tool sequence to ensure all returned alternatives genuinely differ from the uploaded workflow.
Call GET /ape/alternatives/warm when GenerateAlternatives mounts. Show a full-page spinner while the backend loads the EDAM ontology; show an error state if loading fails. Upload zone renders only after warm-up completes.
EDAM loading is handled transparently by the backend on the first /parse request. No explicit frontend warm-up needed.
APE generates step names from a tool's label, but use_m/not_use_m/connected_op constraints must reference the taxonomy id, which differs for some tools (e.g. mzRecal -> mzrecal1, Sage -> Sage-proteomics, idconvert -> two ids). Add LABEL_TO_TOOL_IDS to map each label to its id(s); unknown labels fall back to the label itself.
Convert runSynthesisWithRawConfig to async/await, retry the synthesis call once on failure (1.5s delay), and include the response body in the error so transient backend issues surface clearly. Add ExploreDataStore tests for the post-filtering of identical tool sequences.
Two-line tool cards with a clipped accent bar for status; compact dashed data nodes for inputs/outputs. Dagre now uses separate dimensions per node type (tool 210x70, data 180x38) for correct automatic layout.
InfoTooltip renders configurable contextual help on the graph canvas, the active-constraints panel, and the APE-settings panel. The Show-JSON modal highlights the generated config without an external dependency. Canvas height now scales with the viewport.
Author
|
@eladrion And here is the corresponding PR for the frontend. Tagging you directly again due to missing assignment permissions. |
eladrion
reviewed
Jun 29, 2026
eladrion
reviewed
Jun 29, 2026
Author
Contributor
|
@aaronstrachardt No worries, that's what reviews are for. I looked a bit into the RestApe PR and left you comments. When we have streamlined that one a bit, I can test on the internal instance. |
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.
Overview
This PR adds the user interface and client-side logic for the "Alternative Workflows" prototype component. It allows users to upload a CWL file, interact with it as a graph, and generate structural alternatives. It is designed to work together with the new
/alternatives/parseendpoint introduced in the correspondingrestapePR.Changes
Alternative Workflowscomponent usingReactFlowfor the graph visualization anddagrefor automated top-down layoutingMobX) to handle cyclic node and edge interactions (Keep/Vary/Ban and Chain/Break)generateApeConfig) to translate the visual UI markers directly into APE JSON constraints on the client sideLABEL_TO_TOOL_IDS) to resolve discrepancies between tool labels and EDAM taxonomy IDsTesting
The code has been tested via the added unit tests in Jest. I also tested the complete end-to-end flow manually on my local machine by running this branch against the updated
restapebackend branch.Checklist