common-workflow-language / cwl-utils

Python utilities for CWL

Home Page:https://cwl-utils.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Convert v1.0 to v1.2

BJWiley233 opened this issue · comments

Hi,

I was referred to the repo by DNAnexus that there may be tools here to convert my CWL from v1.0 to v1.2, however I don't see any hard documentation for a conversion here, only the parsers on the markdown. Is there documentation for converting CWL versions?

Brian

Found the normalizer script. Ran it and got error below for a custom type entry:

`type` field is not valid because: Expected one of ('record',) 
invalid field
`items`, expected one of: `fields`,
`type`, `label`, `doc`, `name`,
`inputBinding`

Here is the input:

custom_annotations:
        type:
            - "null"
            - type: array
              items: ../types/vep_custom_annotation.yml#vep_custom_annotation
              label: "custom type, check types directory for input format"
              inputBinding:
                  valueFrom: |
                       ${
                           return [self.annotation.check_existing ? '--check_existing' : '',
                             '--custom',
                             [self.annotation.file.path,
                             self.annotation.name,
                             self.annotation.data_format,
                             self.method,
                             self.force_report_coordinates ? 1 : 0,
                             self.annotation.vcf_fields ? self.annotation.vcf_fields : ''
                             ].filter(String).join(',')
                           ].filter(String)
                       }
                  position: 6

ok cool, I will try, thanks

The normalizer script calls cwl-upgrader, so I'll take a look.

cwl-upgrader worked on that tool and type! quick question, is there a plan to add an indentation argument to cwl-upgrader with respect to how many spaces ruamel will indent with yml.indent?

So I see the .pylintrc sets 4 spaces:

# String used as indentation unit. This is usually "    " (4 spaces) or "\t" (1
# tab).
indent-string='    '

but only got 2 spaces.

Is there a way maintain the folder structure? --dir just puts it all in the same folder. (Should I make an enhancement request for this?)

Lastly the upgrader converted 1.0 to 1.1 but I need 1.2. Do I have to convert to 1.1 first and then from 1.1 to 1.2?

UPDATE: The only file that was converted to v1.2 was the input pipeline file to cwl-upgrader, all the subworkflows and tools under that were only updated to v1.1. This happens to all recursive files, i.e. only the file given as the input and none of the files under that tree is upgraded to v1.2 and all subitems under that tree go to v1.1. (Should I make an enhancement request for this?)

Should I make an enhancement request for this?)

That is an error, so please open a new issue for that, thanks

--dir just puts it all in the same folder. (Should I make an enhancement request for this?)

Sure, but that won't be a high priority item for me