Record inputs definition
1
1
Entering edit mode
7.6 years ago

Hi,

Section "2.10 Record inputs" in the UserGuide is a bit unclear to me. "dependent_parameters" is used as an id and as a name. Which is the actual keyword and which is an arbitrary name that I can change ?

The example shows how to make one set of dependent parameters. How can I make more than one set ? E.g.: itemA pairs with itemB and itemD pairs with itemE.

thanks Wolfgang

cwl • 1.8k views
ADD COMMENT
1
Entering edit mode
7.6 years ago

Hello Wolfgang,

Neither usage of dependent_parameters is a keyword, in fact there is an error in the v1.0 spec related to custom records and the name field: https://github.com/common-workflow-language/common-workflow-language/issues/394

You can have as many dependent parameters as you want, just follow the pattern: custom record type with two or more fields.

Here's a real example that may help:

External definition of custom record type for re-use:

type: record
name: model
fields:
  - name: main
    type: File
  - name: prob_forward
    type: File
    label: Forward probability model
[…]

(From https://github.com/ProteinsWebTeam/ebi-metagenomics-cwl/blob/f8bb388/tools/FragGeneScan-model.yaml)

Import of the custom record type in the tool definition

requirements:
  SchemaDefRequirement:
    types:
      - $import: FragGeneScan-model.yaml
[…]

(From https://github.com/ProteinsWebTeam/ebi-metagenomics-cwl/blob/f8bb388/tools/FragGeneScan1_20.cwl#L21)

Use of the custom record type in that tool's inputs:

inputs:
  […]
  model: FragGeneScan-model.yaml#model

(From https://github.com/ProteinsWebTeam/ebi-metagenomics-cwl/blob/f8bb388/tools/FragGeneScan1_20.cwl#L51)

And likewise, using that tool in a workflow. First import the same custom type:

requirements:
 […]
 - class: SchemaDefRequirement
   types: 
    - $import: ../tools/FragGeneScan-model.yaml
    # other imports for other tool's custom types go here

(from https://github.com/ProteinsWebTeam/ebi-metagenomics-cwl/blob/f8bb388/workflows/emg-pipeline-v3.cwl#L9)

As needed reference it -- for example in the workflow level inputs:

inputs:
  […]
  fraggenescan_model: ../tools/FragGeneScan-model.yaml#model

(From https://github.com/ProteinsWebTeam/ebi-metagenomics-cwl/blob/f8bb388/workflows/emg-pipeline-v3.cwl#L18)

Thank you for your question, this part of the user guide is confusing and needs rewording. There is an open issue to remind the team to clarify and demonstrate this better: https://github.com/common-workflow-language/common-workflow-language/issues/438

ADD COMMENT
1
Entering edit mode

Ok thanks, I think I understand it now. Dependent parameters are all defined by putting them in one record (embedded or using a pointer to a file). Exclusive parameters are separated by using an array of records. The example in the user guide shows that, but I did not immediately notice the array notation. It might be helpful to point this out in the documentation with one sentence.

ADD REPLY

Login before adding your answer.

Traffic: 1802 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6