EccClientGa4ghWesRunCreate Component
Overview
The ecc-client-ga4gh-wes-run-create component provides a form for submitting new workflow runs to a WES endpoint. It has two modes:
- Raw mode (default): the user enters the workflow URL, type, version and
workflow_paramsas JSON. - Schema mode (with
ioSchemaandtrsToolVersion): the user fills in the input form of the workflow's I/O Schema instead, and the component builds the run request from the schema, the values and the TRS tool version (see Run requests).
Usage
Basic Create Form
This example shows the basic form for creating a new workflow run.
NEXT_PUBLIC_WES_URL set to your own WES endpoint (see Live previews), or use the code in the other tabs.Schema mode
With an IO schema and the TRS tool version to run, the form shows the workflow's inputs (ecc-client-ga4gh-wes-io-form) instead of the raw fields, and the workflow that will run: its type and language version (from the schema's x-ga4gh-workflow, else the first version of the TRS tool version that the service runs, else the first version of the TRS tool version) and the workflow URL (the plain primary descriptor in TRS). It says when the WES service doesn't run the workflow's type or version (from its service-info; if that can't be loaded, schema mode doesn't submit), and submits only valid values. When ioSchema is replaced, the values of the old form are dropped and the run can be submitted once the new form has valid values. A new provider object loads service-info again (giving up after serviceInfoTimeout) and blocks submission until it arrives, so keep the provider stable (e.g. useMemo in React). The I/O form element is loaded on demand; if it can't be loaded, the error shows in the form's error area.
On submit, the values are translated into workflow_params by the profile's engine binding for the descriptor type (NFL, SMK, WDL, CWL); values that the binding refuses (e.g. a file reference with a scheme that isn't allowed) are shown as <JSON Pointer>: <message>, and ecc-run-create-failed is fired with that text. The engine parameters (a JSON object of strings), tags (unique keys) and attachments of the advanced section are added; each click submits one run. If the schema, the TRS tool version, the engine profile, the allowed schemes or the provider change while a run is prepared, nothing is submitted (and a run submitted meanwhile doesn't reset the replaced form). An engineProfile then adapts the request to a particular WES server.
This preview uses a provider that submits nothing and shows the request instead:
Engine profiles
Some WES servers need more than the profile's binding gives. An engine profile (EngineProfile from @elixir-cloud/wes/utils) takes the built request and returns the request for one server; it is kept out of the generic builder. The package has one:
conquestEngineProfile: Conquest (opens in a new tab) runs workflows from public GitHub repositories at a full commit SHA. The profile setsworkflow_urlto the repository and adds the engine parametersrevisionand the path of the main workflow file (main_scriptfor Nextflow,snakefilefor Snakemake,main_workflow_pathfor WDL), all taken fromtrsToolVersion.primaryDescriptorUrl: theurlof the TRS descriptor, araw.githubusercontent.comorgithub.com/.../blob/...URL at a commit. It refuses CWL, branches and tags, and a request whoseworkflow_typeisn't the context's descriptor type.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
provider | WesProvider | null | Data provider for submitting the run (see Providers) |
ioSchema | object | undefined | An IO schema (GA4GH IO Schema Profile 0.3.0); switches to schema mode |
trsToolVersion | TrsToolVersionRef | undefined | The TRS tool version to run in schema mode: trsUrl, toolId, versionId, and optionally primaryDescriptorPath (as TRS lists it; else the schema's primary_descriptor_path), descriptorTypeVersions (of the tool version) and primaryDescriptorUrl (for engine profiles) |
engineProfile | EngineProfile | undefined | Adapts the built request to a WES server, e.g. conquestEngineProfile |
serviceInfoTimeout | number | 30000 | Milliseconds to wait for the service's service-info before reporting it as not loaded; attribute service-info-timeout |
allowedSchemes | string[] | ['drs', 'https'] | URI schemes that file references may have in schema mode, in the I/O form and in the built request; attribute allowed-schemes, separated by spaces or commas, in any case |
Events
| Event Name | React Event Name | Detail Type | Description |
|---|---|---|---|
ecc-run-submitted | onEccRunSubmitted | { runId: string, request: RunRequest } | Fired when a workflow run is successfully submitted, with the submitted request. |
ecc-run-create-failed | onEccRunCreateFailed | { error: string } | Fired when run submission fails; in schema mode, values that the binding refuses come as <JSON Pointer>: <message> (/ for the root). |
