Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of programmatic CWL creation #70

Merged
merged 1 commit into from
Apr 9, 2021
Merged

Example of programmatic CWL creation #70

merged 1 commit into from
Apr 9, 2021

Conversation

mr-c
Copy link
Member

@mr-c mr-c commented Apr 9, 2021

Addresses #57

@codecov
Copy link

codecov bot commented Apr 9, 2021

Codecov Report

Merging #70 (6519118) into main (3387a34) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #70   +/-   ##
=======================================
  Coverage   23.82%   23.82%           
=======================================
  Files          14       14           
  Lines       19277    19277           
=======================================
  Hits         4593     4593           
  Misses      14684    14684           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3387a34...6519118. Read the comment docs.

stdin="$(inputs.file1.path)",
stdout="output",
)
print(yaml.main.round_trip_dump(cat_tool.save()))
Copy link
Member Author

@mr-c mr-c Apr 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Target file:

#!/usr/bin/env cwl-runner

class: CommandLineTool
cwlVersion: v1.2

inputs:
  file1: File

outputs:
  output:
    type: File
    outputBinding: { glob: output }

baseCommand: [cat]

stdin: $(inputs.file1.path)
stdout: output

Produced by this script:

class: CommandLineTool
inputs:
- id: file1
  type: File
outputs:
- id: output
  type: File
  outputBinding:
    glob: output
cwlVersion: v1.2
baseCommand: cat
stdin: $(inputs.file1.path)
stdout: output

After running cwl-format

#!/usr/bin/env cwl-runner

cwlVersion: v1.2
class: CommandLineTool

inputs:
- id: file1
  type: File

outputs:
- id: output
  type: File
  outputBinding:
    glob: output
stdout: output

baseCommand: cat
stdin: $(inputs.file1.path)

These are all equivalent

@tetron tetron merged commit 53d415c into main Apr 9, 2021
@tetron tetron deleted the cwl_example branch April 9, 2021 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants