datirium / scidap

Scientific Data Analysis Platform
https://scidap.com/
Apache License 2.0
0 stars 3 forks source link

Empty string instead of null for workflow input #10

Open michael-kotliar opened 4 years ago

michael-kotliar commented 4 years ago

When you click on an automatically generated form to set value for input extension_size or write and remove this value, the generated job will have "" for this input and workflow will fail.

extension_size:
  type:
    - "null"
    - int[]
  label: "Read's extension size"

Workflow to test https://github.com/datirium/workflows/blob/3ab3053ab80f477198c009bbc7e929f474dfaff1/workflows/rgt-thor.cwl#L102

michael-kotliar commented 4 years ago

A similar situation happens with the following input from the same rgt-thor.cwl pipeline

  pvalue_cutoff:
    type: float?
    label: "P-value cutoff for peak detection"
    doc: "P-value cutoff for peak detection. Call only peaks with p-value lower than cutoff. [default: 0.1]"
    'sd:layout':
      advanced: true

If the correspondent field on a form is updated (clicked, removed), the value is set to 0

carcassona commented 4 years ago
  pvalue_cutoff:
    type: float?
    default: 0.1
    label: "P-value cutoff for peak detection"
    doc: "P-value cutoff for peak detection. Call only peaks with p-value lower than cutoff. [default: 0.1]"
    'sd:layout':
      advanced: true

The code looks liked this now, and the question is, if 0 is forbidden should we have kind a range param for the value?

michael-kotliar commented 4 years ago

Is it a good idea to use regex expressions for this additional range param in the workflow input? It would be useful to have it also for all string inputs to catch :, / etc, that user might type in the fields that are used for generating the output filenames. In case of regex expression is not satisfied, use null for this input or completely remove it from the job.

FYI: Currently, removing the value for threads input in the web form results in using "threads": 0 in the generated job, which causes STAR to fail.