Icon

02. Workflow Control

Workflow Control

"Workflow Control" exercise for advanced Life Science User Training - Handle and write groups of data to separate sheets in an Excel file - Read and concatenate many sheets using a loop - Activate a workflow branch based on a user selection



Step 1Use the CASE SwitchStart node and selectas input port type"Data". In theconfiguration dialogcontrol the PortIndexby the Flow Variable"plot-type (index)" fromthe Single SelectionConfiguration node. Step 2Use the CASESwitch Endnode to end theswitch case. Activity I: Group Looping - Read the file: CHEMBLID228_SERT_ligands.table - Group over all the AssayIDs with a group loop - Write each AssayID to a separate sheet in an Excel file Step 1Use the Table Reader node toload theChEMBLID228_SERT_ligands.table Step 2Use the Group LoopStart node to groupand iterate over eachassay_chmebl_id Step 3Use the Excel Writer node to writeeacht AssayID data table to aseparate sheet on Excel file. Thesheet name should be the AssayIDfor the current iteration (Hint: Passthe current AssayID as a sheetname in the Flow Variable tab) Step 4Use the Variable Loop End nodeto end the loop. Step 3Use the Excel Readernode and connect theFlow Variable port fromthe Table Row to VariableLoop Start. Use the flowvariable created by theTable Row to VariableLoop node to control thesetting sheet_name in theFlow Variable tab Activity II: Reading Many Sheets - Use Read Excel Sheet Names to list all sheet names in an Excel file - Iterate over that list of sheets with a Table Row to Variable Loop, and aggregate them into a single KNIME table Step 2Use the Table Row toVariable Loop Start nodeto iterate over all sheets inthe list Step 1Use the Read ExcelSheet Names node to geta list of all sheet in the file"data/temp/assays.xlsx". Step 4Use the Loop End nodeto end the loop. Payattention: the combineddata from all loops isavailable in the output portof the node. Activity III: If Switch Extend the workflow below with a switch to select the kind of visualisation. - Use a Single Selection Configuration node to let a user choose the values "Parallel Coordinates Plot" or "Scatter Plot", use the flowvariable "port index" as output port - Use a CASE Switch Start node to create either a parallel coordinate plot or a scatter plot depending on the input. - Use Column Rename node to rename the plot selection column in both branches "Selection" - Combine the two paths with a CASE Switch End node and use a Row Filter node to filter only the selected compounds List all sheet names from an Excel fileCHEMBLID228_SERT_ligands.tableNode 297Node 298Node 299Node 300Node 301Node 302Node 303Node 304Node 305Node 306Node 307RDKit DescriptorCalculation ParallelCoordinates Plot Scatter Plot Single SelectionConfiguration Column Rename Column Rename Row Filter Read ExcelSheet Names Table Reader Table Reader Group Loop Start Excel Writer Variable Loop End Excel Reader Table Row ToVariable Loop Start Excel Reader Loop End CASE Switch Start Table Reader CASE Switch End Step 1Use the CASE SwitchStart node and selectas input port type"Data". In theconfiguration dialogcontrol the PortIndexby the Flow Variable"plot-type (index)" fromthe Single SelectionConfiguration node. Step 2Use the CASESwitch Endnode to end theswitch case. Activity I: Group Looping - Read the file: CHEMBLID228_SERT_ligands.table - Group over all the AssayIDs with a group loop - Write each AssayID to a separate sheet in an Excel file Step 1Use the Table Reader node toload theChEMBLID228_SERT_ligands.table Step 2Use the Group LoopStart node to groupand iterate over eachassay_chmebl_id Step 3Use the Excel Writer node to writeeacht AssayID data table to aseparate sheet on Excel file. Thesheet name should be the AssayIDfor the current iteration (Hint: Passthe current AssayID as a sheetname in the Flow Variable tab) Step 4Use the Variable Loop End nodeto end the loop. Step 3Use the Excel Readernode and connect theFlow Variable port fromthe Table Row to VariableLoop Start. Use the flowvariable created by theTable Row to VariableLoop node to control thesetting sheet_name in theFlow Variable tab Activity II: Reading Many Sheets - Use Read Excel Sheet Names to list all sheet names in an Excel file - Iterate over that list of sheets with a Table Row to Variable Loop, and aggregate them into a single KNIME table Step 2Use the Table Row toVariable Loop Start nodeto iterate over all sheets inthe list Step 1Use the Read ExcelSheet Names node to geta list of all sheet in the file"data/temp/assays.xlsx". Step 4Use the Loop End nodeto end the loop. Payattention: the combineddata from all loops isavailable in the output portof the node. Activity III: If Switch Extend the workflow below with a switch to select the kind of visualisation. - Use a Single Selection Configuration node to let a user choose the values "Parallel Coordinates Plot" or "Scatter Plot", use the flowvariable "port index" as output port - Use a CASE Switch Start node to create either a parallel coordinate plot or a scatter plot depending on the input. - Use Column Rename node to rename the plot selection column in both branches "Selection" - Combine the two paths with a CASE Switch End node and use a Row Filter node to filter only the selected compounds List all sheet names from an Excel fileCHEMBLID228_SERT_ligands.tableNode 297Node 298Node 299Node 300Node 301Node 302Node 303Node 304Node 305Node 306Node 307RDKit DescriptorCalculation ParallelCoordinates Plot Scatter Plot Single SelectionConfiguration Column Rename Column Rename Row Filter Read ExcelSheet Names Table Reader Table Reader Group Loop Start Excel Writer Variable Loop End Excel Reader Table Row ToVariable Loop Start Excel Reader Loop End CASE Switch Start Table Reader CASE Switch End

Nodes

Extensions

Links