Pack a CWL workflow and output a file
pack_to_file(input, output)
input | Path to the input CWL file |
---|---|
output | Path to the output CWL file |
input <- system.file("example/remote-cwl/wf1.cwl", package = "sbpack") output <- tempfile(fileext = ".cwl") pack_to_file(input, output) cat(readLines(output), sep = "\n")#> class: Workflow #> cwlVersion: v1.0 #> inputs: #> - id: in1 #> type: {items: boolean, label: A boolean array, name: my_boolean_array, type: array} #> outputs: #> - {id: out1, outputSource: s2/out1, type: string} #> requirements: #> InlineJavascriptRequirement: {} #> SubworkflowFeatureRequirement: {} #> steps: #> s1: #> in: {in1: in1} #> out: [out1] #> run: #> arguments: #> - {valueFrom: $(runtime)} #> baseCommand: echo #> class: CommandLineTool #> cwlVersion: v1.0 #> inputs: #> in1: #> inputBinding: {position: 1, valueFrom: 'A_$(inputs.in1)_B_${return inputs.in1}_C_$(inputs.in1)'} #> type: {items: boolean, label: A boolean array, name: my_boolean_array, type: array} #> outputs: #> out1: #> outputBinding: {glob: out.txt, loadContents: true, outputEval: $(self)_D_$(runtime)} #> type: string #> requirements: #> InlineJavascriptRequirement: {} #> stdout: out.txt #> s2: #> in: {in1: s1/out1} #> out: [out1] #> run: #> arguments: #> - {valueFrom: $(runtime)} #> baseCommand: echo #> class: CommandLineTool #> cwlVersion: v1.0 #> inputs: #> in1: #> inputBinding: {position: 1, valueFrom: 'A_$(inputs.in1)_B_${return inputs.in1}_C_$(inputs.in1)'} #> type: string #> outputs: #> out1: #> outputBinding: {glob: out.txt, loadContents: true, outputEval: $(self)_D_$(runtime)} #> type: string #> requirements: #> InlineJavascriptRequirement: #> expressionLib: ["var foo = function(x) {\n return 2 * x\n}\n\nvar bar #> = function(n, x) {\n return `{n} engineers walk into a {x}`\n}"] #> stdout: out.txtinput <- "https://raw.githubusercontent.com/rabix/sbpack/master/tests/wf2.cwl" output <- tempfile(fileext = ".cwl") pack_to_file(input, output) cat(readLines(output), sep = "\n")#> class: Workflow #> cwlVersion: v1.0 #> inputs: #> in1: #> type: {items: boolean, label: A boolean array, name: my_boolean_array, type: array} #> in2: #> type: #> label: A required enum #> name: my_enum #> symbols: [a, b, c] #> type: enum #> outputs: #> out1: {outputSource: s2/out1, type: string} #> requirements: #> InlineJavascriptRequirement: {} #> SubworkflowFeatureRequirement: {} #> steps: #> s1: #> in: #> - {id: in1, source: in1} #> out: [out1] #> run: #> class: Workflow #> cwlVersion: v1.0 #> inputs: #> - id: in1 #> type: {items: boolean, label: A boolean array, name: my_boolean_array, type: array} #> outputs: #> - {id: out1, outputSource: s2/out1, type: string} #> requirements: #> InlineJavascriptRequirement: {} #> SubworkflowFeatureRequirement: {} #> steps: #> s1: #> in: {in1: in1} #> out: [out1] #> run: #> arguments: #> - {valueFrom: $(runtime)} #> baseCommand: echo #> class: CommandLineTool #> cwlVersion: v1.0 #> inputs: #> in1: #> inputBinding: {position: 1, valueFrom: 'A_$(inputs.in1)_B_${return #> inputs.in1}_C_$(inputs.in1)'} #> type: {items: boolean, label: A boolean array, name: my_boolean_array, #> type: array} #> outputs: #> out1: #> outputBinding: {glob: out.txt, loadContents: true, outputEval: $(self)_D_$(runtime)} #> type: string #> requirements: #> InlineJavascriptRequirement: {} #> stdout: out.txt #> s2: #> in: {in1: s1/out1} #> out: [out1] #> run: #> arguments: #> - {valueFrom: $(runtime)} #> baseCommand: echo #> class: CommandLineTool #> cwlVersion: v1.0 #> inputs: #> in1: #> inputBinding: {position: 1, valueFrom: 'A_$(inputs.in1)_B_${return #> inputs.in1}_C_$(inputs.in1)'} #> type: string #> outputs: #> out1: #> outputBinding: {glob: out.txt, loadContents: true, outputEval: $(self)_D_$(runtime)} #> type: string #> requirements: #> InlineJavascriptRequirement: #> expressionLib: ["var foo = function(x) {\n return 2 * x\n}\n\nvar #> bar = function(n, x) {\n return `{n} engineers walk into a #> {x}`\n}"] #> stdout: out.txt #> s2: #> in: {in1: s1/out1} #> out: [out1] #> run: #> arguments: #> - {valueFrom: $(runtime)} #> baseCommand: echo #> class: CommandLineTool #> cwlVersion: v1.0 #> inputs: #> in1: #> inputBinding: {position: 1, valueFrom: 'A_$(inputs.in1)_B_${return inputs.in1}_C_$(inputs.in1)'} #> type: string #> outputs: #> out1: #> outputBinding: {glob: out.txt, loadContents: true, outputEval: $(self)_D_$(runtime)} #> type: string #> requirements: #> InlineJavascriptRequirement: #> expressionLib: ["var foo = function(x) {\n return 2 * x\n}\n\nvar bar #> = function(n, x) {\n return `{n} engineers walk into a {x}`\n}"] #> stdout: out.txt