CWL: Make Enum optional (CommandInputEnumSchema)
1
0
Entering edit mode
7.1 years ago
eduardo ▴ 10

Is it possible to make an Enum optional?

  outfmt:
      type:
          type: enum
          symbols:
            - clustal
            - clustal_num
            - fa
            - msf
            - nexus
            - phylip
            - selex
            - stockholm
            - vienna
          inputBinding:
            position: 13
            prefix: --outfmt

I have tried enum? but then it is not recognised as CommandInputEnumSchema.

cwl • 3.0k views
ADD COMMENT
1
Entering edit mode

? is just a shorthand for [ <T>, "null"]. Try the latter.

ADD REPLY
0
Entering edit mode

Could you provide an example? I have tried a few alternatives with null but I couldn't make it work.

ADD REPLY
3
Entering edit mode
ADD COMMENT
0
Entering edit mode

Any idea on how to make the enum an array?

The following breaks:

type:
  - "null"
  - type: enum[]

The only way I found is custom type as the example mentioned by Michael R. Crusoe

https://github.com/EBI-Metagenomics/ebi-metagenomics-cwl/blob/master/tools/InterProScan5.21-60.cwl#L38

ADD REPLY
0
Entering edit mode
type:
  - "null"
  - type: array
    items:
      type: enum
      symbols: [none, apply, calculate]

Yes, as you found, it is easier when we give names to our custom types

ADD REPLY
1
Entering edit mode

Awesome! Thank you very much!

ADD REPLY

Login before adding your answer.

Traffic: 1985 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