Skip to content

cwltool --pack generates an invalid json when input contains a nested optional multi-type schema #2126

@alexiswl

Description

@alexiswl

Summary

The workflow provided (when packed), fails to resolve the imports for bam-input and cram-input.
These schemas are nested and imported by the schema dragen-wgts-dna-options-variant-calling-stage__4.4.4.yaml.

There are two imports for both bam-input and cram-input. One under 'alignment_data', which is a mandatory field in the variant calling stage, and the other is under tumor_alignment_data, which is not a mandatory field (since this workflow aims to handle both germline and somatic data inputs).

If I remove the tumor_alignment_data record, then bam-input and cram-input are imported successfully. I have also tried importing both schemas in the workflow and tool but with no success.

I am not blocked on this entirely since this workflow is actually a subworkflow in a larger workflow that is packed by cwltool directly.
I just prefer the workflow graphs generated by a packed image as opposed to those generated by a standard Workflow file.

type: record
name: dragen-wgts-dna-options-variant-calling-stage
fields:
  # Data inputs
  alignment_data:
    label: alignment data
    doc: |
      The data from the alignment stage
    type:
      - {"$import": "../../bam-input/1.0.0/bam-input__1.0.0.yaml#bam-input"}
      - {"$import": "../../cram-input/1.0.0/cram-input__1.0.0.yaml#cram-input"}
  tumor_alignment_data:
    label: tumor alignment data
    doc: |
      The data from the tumor alignment stage (optional)
    type:
      - "null"
      - {"$import": "../../bam-input/1.0.0/bam-input__1.0.0.yaml#bam-input"}
      - {"$import": "../../cram-input/1.0.0/cram-input__1.0.0.yaml#cram-input"}
  ref_tar:
    label: ref tar
    doc: |
      Specifies the tarball containing the reference hash table. If the reference is not already loaded into the DRAGEN card, the option automatically loads the reference.
      Note that the actual dragen command is '--ref-dir' but we first need to download and extract the tarball.
    type: File
  ...

Data

dragen-wgts-dna-variant-calling-stage__4.4.4.zip

workflow.packed.json

Source

https://github.com/umccr/cwl-ica/blob/main/workflows/dragen-wgts-dna-variant-calling-stage/4.4.4/dragen-wgts-dna-variant-calling-stage__4.4.4.cwl

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions