How to specify enum symbols in record type definition?
1
0
Entering edit mode
6.0 years ago
ionox0 ▴ 390

I like to use SchemaDefRequirements to define parameter groups for our tools. Is it possible to include the symbols field under the record fields that have type enum? Thank you!

name: vcf2maf_params
type: record
fields:
  species:
    type: enum?
    # This doesn't pass validation:
#    symbols: [homo_sapiens, mus_musculus]

  ncbi_build:
    type: enum?
#    symbols: [GRCh37, GRCh38, GRCm38]
cwl • 1.4k views
ADD COMMENT
2
Entering edit mode
6.0 years ago

Hello @ionox0, in CWL v1.0 inline enums & the ? shortcut aren't combinable, you have to use the long syntax.

Additionally, because of a bug in the CWL reference runner (found while researching your issue; thanks!), you'll need to give those enums names

cwlVersion: v1.0
class: CommandLineTool
requirements:
  SchemaDefRequirement:
    types:
      - name: vcf2maf_params
        type: record
        fields:
          species:
              - "null"
              - type: enum
                name: species
                symbols: [homo_sapiens, mus_musculus]
          ncbi_build:
              - "null"
              - type: enum
                name: build
                symbols: [GRCh37, GRCh38, GRCm38]
baseCommand: echo
outputs: []
inputs: []
ADD COMMENT
0
Entering edit mode

With the newly released version 1.0.20181201184214 of cwltool the above is now simpler:

cwlVersion: v1.0
class: CommandLineTool
requirements:
  SchemaDefRequirement:
    types:
      - name: vcf2maf_params
        type: record
        fields:
          species:
              - "null"
              - type: enum
                symbols: [homo_sapiens, mus_musculus]
          ncbi_build:
              - "null"
              - type: enum
                symbols: [GRCh37, GRCh38, GRCm38]
baseCommand: echo
outputs: []
inputs: []
ADD REPLY
1
Entering edit mode

Thank you for the help and improvements!

ADD REPLY

Login before adding your answer.

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