Skip to content

Instantly share code, notes, and snippets.

@johnbradley
Created January 17, 2019 16:53
Show Gist options
  • Save johnbradley/4190503d8348783c5f55ece8f5ed9e54 to your computer and use it in GitHub Desktop.
Save johnbradley/4190503d8348783c5f55ece8f5ed9e54 to your computer and use it in GitHub Desktop.
{
"$graph": [
{
"class": "Workflow",
"doc": "Reverse the lines in a document, then sort those lines.",
"requirements": [
{
"class": "ScatterFeatureRequirement"
}
],
"inputs": [
{
"type": {
"type": "array",
"items": "File"
},
"doc": "The input file to be processed.",
"id": "#main/input"
},
{
"type": "boolean",
"default": true,
"doc": "If true, reverse (decending) sort",
"id": "#main/reverse_sort"
}
],
"outputs": [
{
"type": {
"type": "array",
"items": "File"
},
"outputSource": "#main/sorted/output",
"doc": "The output with the lines reversed and sorted.",
"id": "#main/output"
}
],
"steps": [
{
"in": [
{
"source": "#main/input",
"id": "#main/rev/input"
}
],
"out": [
"#main/rev/output"
],
"scatter": "#main/rev/input",
"run": "#revtool.cwl",
"id": "#main/rev"
},
{
"in": [
{
"source": "#main/rev/output",
"id": "#main/sorted/input"
},
{
"source": "#main/reverse_sort",
"id": "#main/sorted/reverse"
}
],
"scatter": "#main/sorted/input",
"out": [
"#main/sorted/output"
],
"run": "#sorttool.cwl",
"id": "#main/sorted"
}
],
"id": "#main"
},
{
"class": "CommandLineTool",
"doc": "Reverse each line using the `rev` command",
"requirements": [
{
"class": "DockerRequirement",
"dockerPull": "debian:stretch-slim"
},
{
"class": "InlineJavascriptRequirement"
}
],
"inputs": [
{
"type": "File",
"inputBinding": {},
"id": "#revtool.cwl/input"
}
],
"outputs": [
{
"type": "File",
"outputBinding": {
"glob": "$('reversed-' + inputs.input.basename)"
},
"id": "#revtool.cwl/output"
}
],
"baseCommand": "rev",
"stdout": "$('reversed-' + inputs.input.basename)",
"id": "#revtool.cwl"
},
{
"class": "CommandLineTool",
"doc": "Sort lines using the `sort` command",
"requirements": [
{
"class": "DockerRequirement",
"dockerPull": "debian:stretch-slim"
},
{
"class": "InlineJavascriptRequirement"
}
],
"inputs": [
{
"id": "#sorttool.cwl/reverse",
"type": "boolean",
"inputBinding": {
"position": 1,
"prefix": "--reverse"
}
},
{
"id": "#sorttool.cwl/input",
"type": "File",
"inputBinding": {
"position": 2
}
}
],
"outputs": [
{
"id": "#sorttool.cwl/output",
"type": "File",
"outputBinding": {
"glob": "$('sorted-' + inputs.input.basename)"
}
}
],
"baseCommand": "sort",
"stdout": "$('sorted-' + inputs.input.basename)",
"id": "#sorttool.cwl"
}
],
"cwlVersion": "v1.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment