Icon

01. Flow Variable - solution

Flow Variables Solution

Solution for "Flow Variable" exercise for advanced Life Science User Training
- Filtering rows by an attribute value
- Filtering rows by an attribute value that fulfils a condition and that is updated automatically
- substructure search based on a drawn reference molecule


Annotations and comments
  • Filtering by Selection In this exercise, we will use Flow Variables to overwrite node configurations.
  • Activity I: Flow Variables - Filter the compound data to 1. contain the compounds that were tested in the highest number of assays 2. contain only compounds tested for AssayID "CHEMBL853187"
  • Step 1 Use the Table Reader node to load the ChEMBLID228_SERT_ligands.table
  • Step 1.2 Use the GroupBy node to group all the assay for each compound. Groupby "molecule_chembl_id" and count the "assay_chembl_id". Use the Sorter node to sort by count of assays in a descending order.
  • Step 1.3 Use the Table Row to Variable node convert the first row of the table to Flow Variables
  • Step 1.4 Use the Row Filter node with Column to Test set to "molecule_chembl_id" and select the Flow Variable "molecule_chembl_id" to use as pattern matching.
  • Step 2.2 Use the Value Selection Configuration node and set the Default Column to "assay_chembl_id"
  • Step 2.3 Use the Row Filter node and connect the Flow Variable port from the Value Selection Configuration node with the Flow Variable port of the Row Filter node. - Column to Test: "assay_chembl_id" - use pattern matching: "value-selection"
  • Step 2.4 Create a Component containing the Value Selection Configuration node and the Row Filter node
  • Activity II: Using Flow Variable for Substructure Search The goal of this exercise is to find all compounds from the dataset that match a certain substurcture and prepare the dataset within an interactive view including molecule highlighting. Write the found molecules into an Excel file, which contains the execution time in the file name.
  • The RDKit Substructure Filter node expects a SMARTS to be entered to do the search. Use the Molecular Sketcher component and the Table Row to Variable node to pass the the chemical structure drawn in the Molecular Sketcher component to the RDKit Substructure Filter node as a variable Output. To do so, go to the Flow Variable Tab in the RDKit Substructure Filter node and select as smarts value your variable Output. Hint: KNIME-verified components can be found on the Hub or on the Example Server.
  • Step 1 Use the Table Row to Variable node convert the drawn molecule to a Flow Variable
  • Step 3 Create a flow variable with the execution date (Date&Time Configuration node) Tip: Select "Date" for the setting option type and activate the checkbox "Use execution time".
  • Step 4 Create a Path flow variable to save the filtered product file in a directory of your choice (Create File/Folder Variables node) Tip: select the base location, enter the file extension and provide the filename as a flow variable.
  • Step 2 Pass the Flow Variable "Output" to the "smarts_value" in the Flow Variable Tab
  • Step 5 Write the filtered table into a XLSX file (Excel Writer node) Tip: Use the Path flow variable that you created in 5
  • Select the Sketcher output
  • Select the second output
  • Add SMARTS to create a substructure search
  • add execution time to file name
  • CHEMBLID228_SERT_ligands.table
  • Action needed: Select some compounds!

Nodes

Extensions

Links