I would appreciate advice on how to create a workflow model from a document that contains an array of workflows.
There is an example below of this type of document.
When I create the model I can see the customProps.$graph populated. I would like to construct a graph using #main as the entry point.
{
"cwlVersion": "v1.0",
"$graph": [
{
"class": "CommandLineTool",
"baseCommand": "dbfetch_lwp.pl",
"hints": [
{
"dockerPull": "psafont/ebitools:20170602",
"class": "DockerRequirement"
}
],
"inputs": [
{
"type": "File",
"doc": "List of accessions to be retrieved as sequences.",
"inputBinding": {
"loadContents": true,
"valueFrom": "$(self.contents)",
"position": 3
},
"id": "#dbfetch.cwl/accessions"
},
{
"type": "string",
"doc": "Database to be searched.",
"inputBinding": {
"position": 2
},
"default": "uniprot",
"id": "#dbfetch.cwl/database"
},
{
"type": "string",
"doc": "Type of command-line interface.",
"inputBinding": {
"position": 1
},
"default": "fetchBatch",
"id": "#dbfetch.cwl/method"
},
{
"type": "string",
"doc": "Format of the output",
"inputBinding": {
"position": 4
},
"default": "fasta",
"id": "#dbfetch.cwl/outformat"
},
{
"type": "string",
"doc": "Style of the output",
"inputBinding": {
"position": 5
},
"default": "raw",
"id": "#dbfetch.cwl/outstyle"
}
],
"outputs": [
{
"type": "stdout",
"id": "#dbfetch.cwl/sequences"
}
],
"id": "#dbfetch.cwl"
},
{
"class": "CommandLineTool",
"baseCommand": "sh",
"hints": [
{
"dockerPull": "psafont/ebitools:20170602",
"class": "DockerRequirement"
}
],
"inputs": [
{
"type": "File",
"doc": "File with proteins accessions whose sequences are to be retrieved.",
"inputBinding": {
"position": 1
},
"id": "#idsFordbfetch.cwl/accessions_file"
},
{
"type": "string",
"inputBinding": {
"position": 0
},
"default": "/usr/src/ebitools/idsFordbfetch.sh",
"id": "#idsFordbfetch.cwl/command"
},
{
"type": "string",
"doc": "Maximum number of records to fetch",
"inputBinding": {
"position": 2
},
"default": "20",
"id": "#idsFordbfetch.cwl/numberAccessions"
}
],
"outputs": [
{
"type": "stdout",
"id": "#idsFordbfetch.cwl/accessions"
}
],
"id": "#idsFordbfetch.cwl"
},
{
"label": "Retrieve biological records",
"doc": "Retrieve biological records by accession identifier",
"class": "Workflow",
"inputs": [
{
"label": "File with identifiers",
"doc": "File with identifiers",
"type": "File",
"id": "#main/accessions"
},
{
"label": "Number of records to retrieve",
"doc": "Number of records to retrieve starting from the top.",
"type": [
"null",
"string"
],
"id": "#main/numberAccessions"
}
],
"outputs": [
{
"label": "Biological records",
"doc": "Output file with retrieved biological records",
"type": "File",
"outputSource": "#main/fetch/sequences",
"id": "#main/sequences"
}
],
"steps": [
{
"label": "Dbfetch",
"doc": "Retrieve biological records from identifiers",
"run": "#dbfetch.cwl",
"in": [
{
"source": "#main/format/accessions",
"id": "#main/fetch/accessions"
}
],
"out": [
"#main/fetch/sequences"
],
"id": "#main/fetch"
},
{
"label": "Get X top identifiers",
"doc": "Filter the X top identiers",
"run": "#idsFordbfetch.cwl",
"in": [
{
"source": "#main/accessions",
"id": "#main/format/accessions_file"
}
],
"out": [
"#main/format/accessions"
],
"id": "#main/format"
}
],
"id": "#main"
}
]
}