{"_id":"56429e85e75d700d008de10e","githubsync":"","parentDoc":null,"project":"55faf11ba62ba1170021a9a7","__v":30,"category":{"_id":"55faf95fa8a7770d00c2c0c0","__v":6,"pages":["56268b91c2781f0d00364bc2","56268ba3ad42230d00c3ea33","5637e6cffbe1c50d008cb076","56429e77f49bfa0d002f54e5","56429e85e75d700d008de10e","5642a57b5846360d000cfe26"],"project":"55faf11ba62ba1170021a9a7","version":"55faf11ba62ba1170021a9aa","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-17T17:33:19.476Z","from_sync":false,"order":18,"slug":"edit-an-app","title":"EDIT AN APP"},"user":"554290cd6592e60d00027d17","version":{"_id":"55faf11ba62ba1170021a9aa","project":"55faf11ba62ba1170021a9a7","__v":40,"createdAt":"2015-09-17T16:58:03.490Z","releaseDate":"2015-09-17T16:58:03.490Z","categories":["55faf11ca62ba1170021a9ab","55faf8f4d0e22017005b8272","55faf91aa62ba1170021a9b5","55faf929a8a7770d00c2c0bd","55faf932a8a7770d00c2c0bf","55faf94b17b9d00d00969f47","55faf958d0e22017005b8274","55faf95fa8a7770d00c2c0c0","55faf96917b9d00d00969f48","55faf970a8a7770d00c2c0c1","55faf98c825d5f19001fa3a6","55faf99aa62ba1170021a9b8","55faf99fa62ba1170021a9b9","55faf9aa17b9d00d00969f49","55faf9b6a8a7770d00c2c0c3","55faf9bda62ba1170021a9ba","5604570090ee490d00440551","5637e8b2fbe1c50d008cb078","5649bb624fa1460d00780add","5671974d1b6b730d008b4823","5671979d60c8e70d006c9760","568e8eef70ca1f0d0035808e","56d0a2081ecc471500f1795e","56d4a0adde40c70b00823ea3","56d96b03dd90610b00270849","56fbb83d8f21c817002af880","573c811bee2b3b2200422be1","576bc92afb62dd20001cda85","5771811e27a5c20e00030dcd","5785191af3a10c0e009b75b0","57bdf84d5d48411900cd8dc0","57ff5c5dc135231700aed806","5804caf792398f0f00e77521","58458b4fba4f1c0f009692bb","586d3c287c6b5b2300c05055","58ef66d88646742f009a0216","58f5d52d7891630f00fe4e77","59a555bccdbd85001bfb1442","5a2a81f688574d001e9934f5","5b080c8d7833b20003ddbb6f"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-11T01:48:53.965Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"Workflows are chains of connected tools. You can edit any of the publicly available workflows hosted on the CGC by changing the way that the tools in them are connected, and modifying the way that they run by setting their parameters in the CGC **Workflow Editor**. Additionally, you can [use the CGC **Workflow Editor**](create-a-workflow) to build a workflow from scratch.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"On this page:\",\n  \"body\": \"* [Expose tool parameters for configuration](#section-expose-tool-parameters-for-configuration)\\n* [Set the order in which tool inputs are handled](#section-set-the-order-in-which-tool-inputs-are-handled)\\n* [Create one job per input using scatter](#section-create-one-job-per-input-using-scatter)\"\n}\n[/block]\n## Expose tool parameters for configuration\nExposing a tool parameter makes it configurable when you run the workflow. You can expose parameters of tools in a workflow using the **Workflow Editor**.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"If you are running a tool on its own, not in a workflow, you should expose its parameters by leaving these values empty in the **Tool Editor** description. For details, see the CGC documentation on editing a tool.\"\n}\n[/block]\nTo expose parameters of a tool in a workflow:\n\n1. Open your project.\n2. Click the **Apps** tab.\n3. Click the ellipsis menu next to the workflow name.\n4. Click **Edit**, which will open the Tool Editor. Alternatively click **Edit with Rabix Composer** to edit the tool with our desktop editor - [learn more](http://docs.rabix.io/rabix-composer-home).\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If the workflow you want to edit is a public workflow, you should first copy it to your project.\",\n  \"title\": \"Copying a public workflow\"\n}\n[/block]\nThe Workflow Editor is shown below:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/5IMjAmiQXaFuYb05qNtT_Screen%20Shot%202016-04-12%20at%203.02.32%20PM.jpeg\",\n        \"Screen Shot 2016-04-12 at 3.02.32 PM.jpeg\",\n        \"2744\",\n        \"1442\",\n        \"#1a528f\",\n        \"\"\n      ],\n      \"caption\": \"The Workflow Editor\",\n      \"border\": true\n    }\n  ]\n}\n[/block]\n5. Click on a tool whose parameters you want to be able to edit with each execution.\n6. Select the panel marked **PARAMS** on the right hand side of the **Workflow Editor**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/j8XDdo5XTEuYozA7m8Zm_Screen%20Shot%202016-04-12%20at%203.01.41%20PM.jpeg\",\n        \"Screen Shot 2016-04-12 at 3.01.41 PM.jpeg\",\n        \"2752\",\n        \"1436\",\n        \"\",\n        \"\"\n      ],\n      \"caption\": \"Tool parameters\",\n      \"border\": true\n    }\n  ]\n}\n[/block]\n7. You will see a list of parameter names, with fields next to them. In the example above, the fields are **nogroup, nano, kmers, format,** and **cassava**.\n  * By each parameter name is a lock icon <img src=\"https://files.readme.io/O7g6EcWkTruuqhvw8luJ_Screen%20Shot%202016-04-12%20at%203.07.08%20PM.png\"\nheight=\"15px\" width=\"auto\" align=\"inline\" style=\"margin:1px\"/>. Click the lock icon to **expose** the parameter. This will make the parameter configurable from the **Draft Task** page. \n  * There is also a slider <img src=\"https://files.readme.io/gzMWl8IbRBWJcZ8GPqC8_Screen%20Shot%202015-11-13%20at%2015.16.58.png\"\nheight=\"20px\" width=\"auto\" align=\"inline\" style=\"margin:1px\"/> next to each parameter name. Use the slider to add an **input port **for the parameter. This allows you to pipe in values for the parameter from another tool in the workflow. \n  * To set the parameter value now, so that it cannot be altered at runtime, simply enter the value in the field, as shown.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/5VwGgFywSSmMMiakPISs_Screen%20Shot%202015-11-13%20at%2015.21.17.png\",\n        \"Screen Shot 2015-11-13 at 15.21.17.png\",\n        \"676\",\n        \"596\",\n        \"#904c04\",\n        \"\"\n      ],\n      \"border\": true\n    }\n  ]\n}\n[/block]\nYou can set the value for the parameter using a check box, drop-down list, or free form, depending on what kind of value the parameter takes (a boolean value, a string, etc).\n\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n## Additional tool options\nWhen you select a tool in a workflow, the following additional icons are displayed above the tool:\n\n* <img src=\"https://files.readme.io/dd80f02-remove_node.png\"\nheight=\"20px\" width=\"auto\" align=\"inline\" style=\"margin:1px\"/> Click this icon to remove the node from the workflow. This also removes all inputs and outputs connected to and from the tool.\n* <img src=\"https://files.readme.io/0f5dafa-additional_options_node.png\"\nheight=\"20px\" width=\"auto\" align=\"inline\" style=\"margin:1px\"/> Click this icon to do the following:\n    * **INFO** tab:\n         * See detailed tool information and description added by the tool's creator/publisher on the CGC.\n    * **INPUTS** tab:\n         * [Set the order in which tool inputs are handled](#section-set-the-order-in-which-tool-inputs-are-handled)\n         * [Create one job per input using scatter](#section-create-one-job-per-input-using-scatter)\n    * **CHANGE ID** tab:\n         * Change the port's ID.\n    * **HINTS** tab:\n         * [Set execution hints for the tool within the workflow](doc:set-execution-hints-at-node-level)\n* <img src=\"https://files.readme.io/bb6f446-update_node.png\"\nheight=\"20px\" width=\"auto\" align=\"inline\" style=\"margin:1px\"/> This icon is displayed only if the tool has been updated and you are using an unedited copy of the tool in your workflow. By clicking the icon you synchronize the tool with its latest version.\n\n## Add suggested files for an input\n\nWhen editing a workflow, you can set suggested files from **Public projects** for any of the workflow's file inputs. This will allow anyone who runs the workflow to set the suggested files as inputs in a single click, and only have to add the remaining input files manually.\n\nTo set suggested files for a workflow:\n\n1. Click an input node in the workflow editor.\n2. In the pane on the right, click the folder icon next to the **Input suggested files** field. You can now set suggested files for the input node.\n3. Navigate through **Public projects** or use the search fields to find the file(s) you want to set as suggested.\n4. Mark the checkboxes next to the file(s).\n5. Click **Pick** in the bottom-right corner.\n\nOnce you have saved the workflow, the selected files will be automatically suggested as inputs when the workflow is run on the CGC. Please note that suggested files can currently be defined only for **sbg:draft-2** workflows.\n\n##Set the order in which tool inputs are handled\nThe **Workflow Editor** lets you can pipe multiple incoming data streams into the same port of a tool. For instance, in the example below the app 'my-app' has one port with ID 'input_1'. There are two input nodes that feed data into this port: 'Input_1' and 'Input_1_1':\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/gnCuIQV8QpG5Nl07YmnY_Screen%20Shot%202016-02-10%20at%2012.00.06.png\",\n        \"Screen Shot 2016-02-10 at 12.00.06.png\",\n        \"1112\",\n        \"1076\",\n        \"#2c5177\",\n        \"\"\n      ],\n      \"border\": true\n    }\n  ]\n}\n[/block]\nWhen you have multiple inputs to a single input port, the order in which the data is analyzed might be important. To set this order, click on the green info icon for the node to see further information about it. Then click the tab labeled **INPUTS**.\n\nNext to each input node's name, is an icon with three horizontal lines. Click this to drag and drop the names of the input nodes to match the order in which you want their inputs analyzed. In the example below, inputs from input node 'Input_1' will be handled before those from 'Input_1_1'.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/arkVB9SDOcFE5us3VQgG_new%20we1.jpg\",\n        \"new we1.jpg\",\n        \"2304\",\n        \"1271\",\n        \"#234d75\",\n        \"\"\n      ],\n      \"caption\": \"Order the inputs to a tool.\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##Create one job per input using scatter\nIf you are inputting a list to a node, you can set the tool to iterate through the list and run one job per list element. This is known as \"scattering\". \n\nScatter is a \"parallel map\" or \"for-each\" construct, since only one input is iterated over while the rest remain fixed. It is the equivalent of \"currying\" the node with all other inputs, and running a parallel map over the input marked as scatter. Note that this input needs to be a list.\n\nIf you instruct a tool to scatter on an *n* element list, it will perform *n* jobs, and output an *n*-element array.\n\nTo instruct the tool to scatter over a list:\n\n1. Select your tool in the workflow editor.\n2. Click the green info icon on the tool whose inputs you want to scatter on. This will bring up an information box for the tool, as shown below.\n3. Select the tab marked **Inputs**, and you will see the names of the tool's input nodes. \n4. Check the box marked **scatter** next to a node that takes in lists in order to iterate though its items.\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Example\",\n  \"body\": \"For example, **STAR** has a single reference file and a single GTF file. However, it has multiple reads files. In this case, you should scatter only on **reads**, as shown below.  Note that you must supply a list of input files on the **reads** port.\\n\\nThis creates a job for each file in the list of input files. Each output port of **STAR** becomes a list assembled from the outputs of individual jobs.\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/mesKifwRsWR5MubwXQSv_new%20ew2.jpg\",\n        \"new ew2.jpg\",\n        \"2188\",\n        \"1397\",\n        \"#215177\",\n        \"\"\n      ],\n      \"caption\": \"Scatter over reads.\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>","excerpt":"<a name=\"top\"></a>","slug":"the-pipeline-editor","type":"basic","title":"Edit a workflow"}

Edit a workflow

<a name="top"></a>

Workflows are chains of connected tools. You can edit any of the publicly available workflows hosted on the CGC by changing the way that the tools in them are connected, and modifying the way that they run by setting their parameters in the CGC **Workflow Editor**. Additionally, you can [use the CGC **Workflow Editor**](create-a-workflow) to build a workflow from scratch. [block:callout] { "type": "warning", "title": "On this page:", "body": "* [Expose tool parameters for configuration](#section-expose-tool-parameters-for-configuration)\n* [Set the order in which tool inputs are handled](#section-set-the-order-in-which-tool-inputs-are-handled)\n* [Create one job per input using scatter](#section-create-one-job-per-input-using-scatter)" } [/block] ## Expose tool parameters for configuration Exposing a tool parameter makes it configurable when you run the workflow. You can expose parameters of tools in a workflow using the **Workflow Editor**. [block:callout] { "type": "success", "body": "If you are running a tool on its own, not in a workflow, you should expose its parameters by leaving these values empty in the **Tool Editor** description. For details, see the CGC documentation on editing a tool." } [/block] To expose parameters of a tool in a workflow: 1. Open your project. 2. Click the **Apps** tab. 3. Click the ellipsis menu next to the workflow name. 4. Click **Edit**, which will open the Tool Editor. Alternatively click **Edit with Rabix Composer** to edit the tool with our desktop editor - [learn more](http://docs.rabix.io/rabix-composer-home). [block:callout] { "type": "info", "body": "If the workflow you want to edit is a public workflow, you should first copy it to your project.", "title": "Copying a public workflow" } [/block] The Workflow Editor is shown below: [block:image] { "images": [ { "image": [ "https://files.readme.io/5IMjAmiQXaFuYb05qNtT_Screen%20Shot%202016-04-12%20at%203.02.32%20PM.jpeg", "Screen Shot 2016-04-12 at 3.02.32 PM.jpeg", "2744", "1442", "#1a528f", "" ], "caption": "The Workflow Editor", "border": true } ] } [/block] 5. Click on a tool whose parameters you want to be able to edit with each execution. 6. Select the panel marked **PARAMS** on the right hand side of the **Workflow Editor**. [block:image] { "images": [ { "image": [ "https://files.readme.io/j8XDdo5XTEuYozA7m8Zm_Screen%20Shot%202016-04-12%20at%203.01.41%20PM.jpeg", "Screen Shot 2016-04-12 at 3.01.41 PM.jpeg", "2752", "1436", "", "" ], "caption": "Tool parameters", "border": true } ] } [/block] 7. You will see a list of parameter names, with fields next to them. In the example above, the fields are **nogroup, nano, kmers, format,** and **cassava**. * By each parameter name is a lock icon <img src="https://files.readme.io/O7g6EcWkTruuqhvw8luJ_Screen%20Shot%202016-04-12%20at%203.07.08%20PM.png" height="15px" width="auto" align="inline" style="margin:1px"/>. Click the lock icon to **expose** the parameter. This will make the parameter configurable from the **Draft Task** page. * There is also a slider <img src="https://files.readme.io/gzMWl8IbRBWJcZ8GPqC8_Screen%20Shot%202015-11-13%20at%2015.16.58.png" height="20px" width="auto" align="inline" style="margin:1px"/> next to each parameter name. Use the slider to add an **input port **for the parameter. This allows you to pipe in values for the parameter from another tool in the workflow. * To set the parameter value now, so that it cannot be altered at runtime, simply enter the value in the field, as shown. [block:image] { "images": [ { "image": [ "https://files.readme.io/5VwGgFywSSmMMiakPISs_Screen%20Shot%202015-11-13%20at%2015.21.17.png", "Screen Shot 2015-11-13 at 15.21.17.png", "676", "596", "#904c04", "" ], "border": true } ] } [/block] You can set the value for the parameter using a check box, drop-down list, or free form, depending on what kind of value the parameter takes (a boolean value, a string, etc). <div align="right"><a href="#top">top</a></div> ## Additional tool options When you select a tool in a workflow, the following additional icons are displayed above the tool: * <img src="https://files.readme.io/dd80f02-remove_node.png" height="20px" width="auto" align="inline" style="margin:1px"/> Click this icon to remove the node from the workflow. This also removes all inputs and outputs connected to and from the tool. * <img src="https://files.readme.io/0f5dafa-additional_options_node.png" height="20px" width="auto" align="inline" style="margin:1px"/> Click this icon to do the following: * **INFO** tab: * See detailed tool information and description added by the tool's creator/publisher on the CGC. * **INPUTS** tab: * [Set the order in which tool inputs are handled](#section-set-the-order-in-which-tool-inputs-are-handled) * [Create one job per input using scatter](#section-create-one-job-per-input-using-scatter) * **CHANGE ID** tab: * Change the port's ID. * **HINTS** tab: * [Set execution hints for the tool within the workflow](doc:set-execution-hints-at-node-level) * <img src="https://files.readme.io/bb6f446-update_node.png" height="20px" width="auto" align="inline" style="margin:1px"/> This icon is displayed only if the tool has been updated and you are using an unedited copy of the tool in your workflow. By clicking the icon you synchronize the tool with its latest version. ## Add suggested files for an input When editing a workflow, you can set suggested files from **Public projects** for any of the workflow's file inputs. This will allow anyone who runs the workflow to set the suggested files as inputs in a single click, and only have to add the remaining input files manually. To set suggested files for a workflow: 1. Click an input node in the workflow editor. 2. In the pane on the right, click the folder icon next to the **Input suggested files** field. You can now set suggested files for the input node. 3. Navigate through **Public projects** or use the search fields to find the file(s) you want to set as suggested. 4. Mark the checkboxes next to the file(s). 5. Click **Pick** in the bottom-right corner. Once you have saved the workflow, the selected files will be automatically suggested as inputs when the workflow is run on the CGC. Please note that suggested files can currently be defined only for **sbg:draft-2** workflows. ##Set the order in which tool inputs are handled The **Workflow Editor** lets you can pipe multiple incoming data streams into the same port of a tool. For instance, in the example below the app 'my-app' has one port with ID 'input_1'. There are two input nodes that feed data into this port: 'Input_1' and 'Input_1_1': [block:image] { "images": [ { "image": [ "https://files.readme.io/gnCuIQV8QpG5Nl07YmnY_Screen%20Shot%202016-02-10%20at%2012.00.06.png", "Screen Shot 2016-02-10 at 12.00.06.png", "1112", "1076", "#2c5177", "" ], "border": true } ] } [/block] When you have multiple inputs to a single input port, the order in which the data is analyzed might be important. To set this order, click on the green info icon for the node to see further information about it. Then click the tab labeled **INPUTS**. Next to each input node's name, is an icon with three horizontal lines. Click this to drag and drop the names of the input nodes to match the order in which you want their inputs analyzed. In the example below, inputs from input node 'Input_1' will be handled before those from 'Input_1_1'. [block:image] { "images": [ { "image": [ "https://files.readme.io/arkVB9SDOcFE5us3VQgG_new%20we1.jpg", "new we1.jpg", "2304", "1271", "#234d75", "" ], "caption": "Order the inputs to a tool." } ] } [/block] <div align="right"><a href="#top">top</a></div> ##Create one job per input using scatter If you are inputting a list to a node, you can set the tool to iterate through the list and run one job per list element. This is known as "scattering". Scatter is a "parallel map" or "for-each" construct, since only one input is iterated over while the rest remain fixed. It is the equivalent of "currying" the node with all other inputs, and running a parallel map over the input marked as scatter. Note that this input needs to be a list. If you instruct a tool to scatter on an *n* element list, it will perform *n* jobs, and output an *n*-element array. To instruct the tool to scatter over a list: 1. Select your tool in the workflow editor. 2. Click the green info icon on the tool whose inputs you want to scatter on. This will bring up an information box for the tool, as shown below. 3. Select the tab marked **Inputs**, and you will see the names of the tool's input nodes. 4. Check the box marked **scatter** next to a node that takes in lists in order to iterate though its items. [block:callout] { "type": "success", "title": "Example", "body": "For example, **STAR** has a single reference file and a single GTF file. However, it has multiple reads files. In this case, you should scatter only on **reads**, as shown below. Note that you must supply a list of input files on the **reads** port.\n\nThis creates a job for each file in the list of input files. Each output port of **STAR** becomes a list assembled from the outputs of individual jobs." } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/mesKifwRsWR5MubwXQSv_new%20ew2.jpg", "new ew2.jpg", "2188", "1397", "#215177", "" ], "caption": "Scatter over reads." } ] } [/block] <div align="right"><a href="#top">top</a></div>