rabix / composer

Visual and code editor for Common Workflow Language
http://rabix.io/
Apache License 2.0
301 stars 72 forks source link

Does Rabix support exclusive parameters? #432

Open lfaller-zymergen opened 5 years ago

lfaller-zymergen commented 5 years ago

I have a toy example that requires an exclusive parameter and a regular parameter and it seems to run fine when I try cwl-runner (see copied below). I would like to adapt a tool in Rabix to use the same logic for the input files but it complains:

document.inputs[0].type: should be equal to one of the allowed values: null,boolean,int,long,float,string,File,Directory

I believe it is not happy with type: record

What is the best way to implement exclusive parameters in Rabix?

$> cat exclusive_params.yml
exclusive_parameters:
  input_file_2:
    class: File
    path: ./two_file.txt
another_parameter: just_a_string_for_a_parameter

$> cat exclusive_params.cwl
cwlVersion: v1.0
class: CommandLineTool
inputs:
  exclusive_parameters:
    type:
      - type: record
        name: input_file_1
        fields:
          input_file_1:
            type: File
            inputBinding:
              prefix: -file-one
            label: this is a file of type 1
      - type: record
        name: input_file_2
        fields:
          input_file_2:
            type: File
            inputBinding:
              prefix: -file-two
            label: this is a file of type 2
  another_parameter:
    type: string
    id: input_another_parameter
    inputBinding:
      position: 1
      prefix: -another_parameter
    label: This is a regular string parameter.
outputs: []
baseCommand: echo

$> cwl-runner exclusive_params.cwl exclusive_params.yml
/Users/lfaller/playground/venv/bin/cwl-runner 1.0.20181012180214
Resolved 'exclusive_params.cwl' to 'file:///Users/lfaller/playground/exclusive_params.cwl'
[job exclusive_params.cwl] /private/tmp/docker_tmpA5dP3M$ echo \
    -file-two \
    /private/var/folders/vg/0brt5dt962j9p26_rhxn8_4w0000gn/T/tmpDeAbeL/stge33acf73-7edc-40d4-bd55-46ad2d7dc987/two_file.txt \
    -another_parameter \
    just_a_string_for_a_parameter
-file-two /private/var/folders/vg/0brt5dt962j9p26_rhxn8_4w0000gn/T/tmpDeAbeL/stge33acf73-7edc-40d4-bd55-46ad2d7dc987/two_file.txt -another_parameter just_a_string_for_a_parameter
[job exclusive_params.cwl] completed success
{}
Final process status is success

Edited to add my code in Rabix:

class: CommandLineTool
cwlVersion: v1.0
$namespaces:
  sbg: 'https://sevenbridges.com'
inputs:
  - exclusive_parameters:
    type:
      - type: record
        name: input_fasta_file_1
        fields:
          input_fasta_file_1:
            type: File
            inputBinding:
              position: 0
              prefix: -file1-raw
              secondaryFiles: []
            label: primary fasta reads
            'sbg:fileTypes': 'FASTA, FA, FASTQ, FQ, FASTA.GZ, FA.GZ, FASTQ.GZ, FQ.GZ'
      - type: record
        name: input_fasta_file_2
        fields:
          input_fasta_file_2:
            type: File
            inputBinding:
              position: 0
              prefix: -file2-raw
              secondaryFiles: []
            label: secondary fasta reads
            'sbg:fileTypes': 'FASTA, FA, FASTQ, FQ, FASTA.GZ, FA.GZ, FASTQ.GZ, FQ.GZ'
ghost commented 5 years ago

@bogdang989 would have some idea? Thanks!

pvanheus commented 5 years ago

Is there any update on this? I am facing the same error when trying to edit a tool with exclusive parameters in Rabix Composer 1.0.1.