From 4bea0b85e1992a01dd36d32c8b2c68a497c6d001 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 5 Nov 2021 12:10:06 +0530 Subject: doc: Document reuse of external CWL workflows. * doc/ccwl.skb (Cookbook): New chapter. * doc/external-cwl-workflow.scm, doc/echo.cwl: New files. * .gitignore: Add !doc/echo.cwl. --- doc/ccwl.skb | 16 ++++++++++++++++ doc/echo.cwl | 12 ++++++++++++ doc/external-cwl-workflow.scm | 12 ++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 doc/echo.cwl create mode 100644 doc/external-cwl-workflow.scm (limited to 'doc') diff --git a/doc/ccwl.skb b/doc/ccwl.skb index 57fa225..c460ab4 100644 --- a/doc/ccwl.skb +++ b/doc/ccwl.skb @@ -249,6 +249,22 @@ following output.]) ,(file "d2f19c786fcd3feb329004c8747803fba581a02d") and ,(file "0d2eaa5619c14b43326101200d0f27b0d8a1a4b1") respectively.])))) + (chapter :title [Cookbook] + (section :title [Reuse external CWL workflows] + (p [Even though you may be a ccwl convert (hurrah!), others may +not be. And, you might have to work with CWL workflows written by +others. ccwl permits easy reuse of external CWL workflows, and free +mixing with ccwl commands. Here is a workflow to find the string +length of a message, where one of the commands, ,(code "echo"), is +defined as an external CWL workflow. External CWL workflows are +referenced in ccwl using ,(code "cwl-workflow"). The identifiers and +types of the inputs/outputs are read from the YAML specification of +the external CWL workflow.] + (scheme-source "doc/external-cwl-workflow.scm") + [,(file "echo.cwl") is defined as] + ;; TODO: Syntax highlight doc/external-cwl-workflow.cwl. + (prog :line #f (source :file "doc/echo.cwl"))))) + (chapter :title [Contributing] (p [ccwl is developed on GitHub at ,(ref :url "https://github.com/arunisaac/ccwl"). Feedback, suggestions, diff --git a/doc/echo.cwl b/doc/echo.cwl new file mode 100644 index 0000000..6ecd530 --- /dev/null +++ b/doc/echo.cwl @@ -0,0 +1,12 @@ +cwlVersion: v1.2 +class: CommandLineTool +baseCommand: echo +arguments: ["-n"] +inputs: + message: + type: string + inputBinding: + position: 1 +outputs: + output: + type: stdout diff --git a/doc/external-cwl-workflow.scm b/doc/external-cwl-workflow.scm new file mode 100644 index 0000000..36c3172 --- /dev/null +++ b/doc/external-cwl-workflow.scm @@ -0,0 +1,12 @@ +(define echo + (cwl-workflow "echo.cwl")) + +(define string-length + (command #:inputs file + #:run "wc" "--chars" + #:outputs (length #:type stdout) + #:stdin file)) + +(workflow ((message #:type string)) + (pipe (echo #:message message) + (string-length #:file output))) -- cgit v1.2.3