dockstore / dockstore

An app store for scientific workflows, tools, notebooks, and services
https://dockstore.org/
Apache License 2.0
119 stars 27 forks source link

Unhelpful error message with missing CWL parameter names #570

Closed denis-yuen closed 7 years ago

denis-yuen commented 7 years ago

Feature Request

Desired behaviour

The following leads to an unhelpful NullPointerException

#!/usr/bin/env cwl-runner

cwlVersion: v1.0

class: CommandLineTool

id: "ConsensusCalling"

label: "ConsensusCalling"

description: |

    This is the ConsensusCalling tool used in the PCAWG project.

    VariantBam was created by Jonathan Dursi (jonathan.dursi@sickkids.ca).

    This CWL wrapper was created by Solomon Shorser.

    For more information about ConsensusCalling, see: https://github.com/ljdursi/consensus_call_docker

dct:creator:

    foaf:name: "Solomon Shorser"

    foaf:mbox: "solomon.shorser@oicr.on.ca"

dct:contributor:

  foaf:name: "Jonathan Dursi"

  foaf:mbox: "jonathan.dursi@sickkids.ca"

requirements:

    - class: DockerRequirement

      dockerPull: pancancer/consensus_call

    - class: InlineJavascriptRequirement

inputs:

    - id: "#variant_type"

      type: string

      inputBinding:

        position: 1

    - id: "#broad_input_file"

      type: File

      inputBinding:

        position: 2

        prefix: "-b"

    - id: "#dkfz_embl_input_file"

      type: File

      inputBinding:

        position: 3

        prefix: "-d"

    - id: "#muse_input_file"

      type: File

      inputBinding:

        position: 4

        prefix: "-m"

    - id: "#sanger_input_file"

      type: File

      inputBinding:

        position: 5

        prefix: "-s"

    - id: "#output_file_name"

      type: string

      inputBinding:

        position: 6

        prefix: "-o"

outputs:

    - type: File

      outputBinding:

          glob: "*$(input.output_file_name)"

baseCommand: consensus
{

    "broad_input_file": {

        "path": "/home/sshorser/workspaces/OxoG/dockstore-tools/consensus-calling-for-dockstore/data/ee02368e-f1b2-11e5-b843-cb11c0d1e6cc/81bc7f0c-865d-4801-a935-2ab04170df53_annotated_broad_SNV.vcf.gz",

        "class": "File"

    },

    "dkfz_embl_input_file": {

        "path": "/home/sshorser/workspaces/OxoG/dockstore-tools/consensus-calling-for-dockstore/data/ee02368e-f1b2-11e5-b843-cb11c0d1e6cc/81bc7f0c-865d-4801-a935-2ab04170df53_annotated_dkfz_embl_SNV.vcf.gz",

        "class": "File"

    },

    "muse_input_file": {

        "path": "/home/sshorser/workspaces/OxoG/dockstore-tools/consensus-calling-for-dockstore/data/ee02368e-f1b2-11e5-b843-cb11c0d1e6cc/81bc7f0c-865d-4801-a935-2ab04170df53_annotated_muse_SNV.vcf.gz",

        "class": "File"

    },

    "sanger_input_file": {

        "path": "/home/sshorser/workspaces/OxoG/dockstore-tools/consensus-calling-for-dockstore/data/ee02368e-f1b2-11e5-b843-cb11c0d1e6cc/81bc7f0c-865d-4801-a935-2ab04170df53_annotated_sanger_SNV.vcf.gz",

        "class": "File"

    },

    "output_file_name": "/home/sshorser/workspaces/OxoG/dockstore-tools/consensus-calling-for-dockstore/consensus.snv.vcf",

    "variant_type": "snv"

}

Exact filenames are not relevant Generate a more helpful message

See also @SolomonShorser-OICR

Environment (Browser or OS and Dockstore version)

Dockstore 1.1.1

denis-yuen commented 7 years ago

To add more information here:

The outputs should look more like

outputs:
   outputParameterName:
      type: File
      outputBinding:
        glob: "*$(input.output_file_name)"

The example that @SolomonShorser-OICR provided should result in a non-helpful error message currently. Create JUnit test that triggers the error message (you might be able to just use the above directly) and then fix the error by providing a better error message.

denis-yuen commented 7 years ago

Looks better now on staging.dockstore.org Outputs

$ dockstore tool convert cwl2json --cwl Dockstore.cwl --json test.json
problems running command: cwltool --non-strict --validate Dockstore.cwl
stderr for command:
        /usr/local/bin/cwltool 1.0.20170217172322
        Resolved 'Dockstore.cwl' to 'file:///media/dyuen/Data/large_volume/testing/570/Dockstore.cwl'
        Tool definition failed validation:
        Dockstore.cwl:3:1: Object `Dockstore.cwl` is not valid because
                             tried `CommandLineTool` but
        Dockstore.cwl:101:1:     the `outputs` field is not valid because
        Dockstore.cwl:103:7:       item is invalid because
                                     missing required field `id`

Thanks @k-cao FYI @SolomonShorser-OICR

SolomonShorser-OICR commented 7 years ago

:+1: