Icon

04.2 Workflow Control

Workflow Control

"Workflow Control" exercise for advanced Life Science User Training
- Handle groups of data in separate iterations where the groups are defined by values in one or more columns
- Read and concatenate many files
- Activate a workflow branch based on a user selection

Activity I: Group Looping - Read the file: CHEMBLID228_SERT_ligands.table - Group over all the AssayIDs with a group loop - For each group, write a new KNIME table to your KNIME Workspace. For that, create an appropriate file name in the String manipulation(Variable) node and use this as input for the Create File Name node. (Hint: the Group loop start creates a variable for each group). Use the Activity II: Reading Many Files - Use List files to find the file names of the files created in exercise 1 - Iterate over that list of files with a Table Row to Variable Loop, and aggregate them into a single KNIME table 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 Data (Start) 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" 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 String Manipulation(Variable) node to create a filename consisting of "Assay_" andthe assay_chembl_id.The Create File Name nodecreates individual file_paths foreach AssayID table Step 4Use the Table Writer node to writeeach AssayID data table to aseparate file. Connect the FlowVariable from the Create File Pathnode and select as output locationthe Flow Variabel "filePath".Use the Variable Loop End nodeto end the loop. Step 1Use the List Files node toget a list of all files in thefolder "data/temp/". Step 2Use the Table Row toVariable Loop Start nodeto iterate over all files infile list Step 3Use the Table Readernode and connect theFlow Variable port fromthe Table Row to VariableLoop Start. As inputlocation select the FlowVariable "URL". Step 4Use the Loop End nodeto end the loop. Payattention: the combineddata from all loops isavailable in the output portof the node. Step 1Use the CASE SwitchData (Start) node andcontrol the PortIndexby the Flow Variable"plot-type (index)" fromthe Single SelectionConfiguration node. Step 2Use the CASESwitch Data(End) node toend the switchcase. Generate the nameof the file to writeList all filesin the directorydata/CHEMBLID228_SERT_ligands.table Create FileName (legacy) String Manipulation(Variable) RDKit DescriptorCalculation Parallel CoordinatesPlot (JavaScript) Scatter Plot(JavaScript) Single SelectionConfiguration Column Rename(deprecated) Column Rename(deprecated) Row Filter List Files/Folders Table Reader Activity I: Group Looping - Read the file: CHEMBLID228_SERT_ligands.table - Group over all the AssayIDs with a group loop - For each group, write a new KNIME table to your KNIME Workspace. For that, create an appropriate file name in the String manipulation(Variable) node and use this as input for the Create File Name node. (Hint: the Group loop start creates a variable for each group). Use the Activity II: Reading Many Files - Use List files to find the file names of the files created in exercise 1 - Iterate over that list of files with a Table Row to Variable Loop, and aggregate them into a single KNIME table 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 Data (Start) 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" 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 String Manipulation(Variable) node to create a filename consisting of "Assay_" andthe assay_chembl_id.The Create File Name nodecreates individual file_paths foreach AssayID table Step 4Use the Table Writer node to writeeach AssayID data table to aseparate file. Connect the FlowVariable from the Create File Pathnode and select as output locationthe Flow Variabel "filePath".Use the Variable Loop End nodeto end the loop. Step 1Use the List Files node toget a list of all files in thefolder "data/temp/". Step 2Use the Table Row toVariable Loop Start nodeto iterate over all files infile list Step 3Use the Table Readernode and connect theFlow Variable port fromthe Table Row to VariableLoop Start. As inputlocation select the FlowVariable "URL". Step 4Use the Loop End nodeto end the loop. Payattention: the combineddata from all loops isavailable in the output portof the node. Step 1Use the CASE SwitchData (Start) node andcontrol the PortIndexby the Flow Variable"plot-type (index)" fromthe Single SelectionConfiguration node. Step 2Use the CASESwitch Data(End) node toend the switchcase. Generate the nameof the file to writeList all filesin the directorydata/CHEMBLID228_SERT_ligands.table Create FileName (legacy) String Manipulation(Variable) RDKit DescriptorCalculation Parallel CoordinatesPlot (JavaScript) Scatter Plot(JavaScript) Single SelectionConfiguration Column Rename(deprecated) Column Rename(deprecated) Row Filter List Files/Folders Table Reader

Nodes

Extensions

Links