Icon

01_Exercise

Data Manipulation

Solution to "Manipulation Data" exercise for basic Life Science User Training
- Concatenate data from two different sources
- Modify String values
- Join data from multiple tables
- Remove duplicates in the data

URL: Advaced ETL Functionalities and Machine Learning based Pre-Processing https://youtu.be/IEAsUTN8q68
URL: Joining Data Tables https://youtu.be/6BigLM6vbhs
URL: Joining Data Tables - Inner Join https://youtu.be/9uV99ByH-TA
URL: Concatenate https://youtu.be/VzH2lHbDAg0
URL: Concatenate Node https://youtu.be/ku6SyEZ1Pv8
URL: Data Manipulation: Numbers, Strings, and Rules https://youtu.be/mJrBXmLQ4ko
URL: Slides for KNIME Analytics Platform Course (L1-LS) https://www.knime.com/form/material-download-registration

Annotations and comments
  • EXERCISE Try to follow the instructions in each box. Bold words give you a hint on which node to use. In case you get lost, have a sneak peek to the 02_Solution workflow. Tip: Check and familiarize yourself with the output table of each node, to see how the data changed in comparison to the previous step and to see how it still deviates from how you want it to look like.
  • REOS rules -- "MW" if AMW is smaller than 100 or greater than 700 -- "Complexity" if NumHeavyAtoms is smaller than 5 or greater than 50 or NumRotatableBonds is greater or equal to 12 -- "HBond" if NumHBD is greater than 5 or NumHBA is greater than 10 -- "logP" if SlogP is smaller -5 or greater than 7.5 -- "Pass" for all other cases
  • 1. This node is pre-configured. Just execute it and inspect the output table.
  • 5. Filter out the rows with missing values in the Pf3D7_pEC50 column using the Missing Value node. Chose "Remove Row" in the Column Settings Tab.
  • 8. Use the String Manipulation node to upper case all sample IDs. Try to assemble the expression yourself by selecting the method "upperCase" and double-click on it, and double-click on the column "Sample" to insert it into the brackets. In case that doesn't work, copy-paste upperCase($Sample$) into the expression field.
  • 19. Select all nodes in this box, right-click on one of them and create a component. Explore and select some data for export.
  • 6. Concatenate the data from the Missing Value node and the Excel Reader. Notice the data types of all columns. Connect the output of the Concatenate node to the Column Expressions node.
  • 7. This node is pre-configured. Just execute it and inspect the output table. Look at the Sample column. Is there a inconsistency you notice?
  • 2. Use the Excel Reader to import the malariahts_experiment_no-hits.xlsx from the data folder. TIP: just drag and drop the file from the KNIME Explorer on the left side
  • 17. Assign colours to the Pf3D7_pEC50 column using the Color Manager node. Connect its input port to the RDKit Molecule to SVG node.
  • 18. Visualize the data using the Scatter Plot node. - select the axes/columns to plot in the options tab (green vs red) - give a title in the General Plot Options tab - make sure it interacts with other view nodes in the View Controls tab under Selection
  • 13. This Joiner node is pre-configured and joins the table with the assay data with the table containing the molecule data
  • 14. Use the Row Filter or Row Splitter node to exclude rows with missing values in the column Pf3D7_pEC50. The Row Splitter allows you to inspect the excluded data, the Row Filter doesn't. Make sure to select "Exclude rows by attribute value"
  • 15. Use the Column Filter node to exclude the column NumSaturatedRings.
  • 16. This two nodes are pre-configured, just execute them. Check the output table of the RDKit Molecule to SVG node. The molecular structures are now rendered to images, so we can use them in the interactive view.
  • 20. Define locations you want to export the data to.
  • 3. Use the SDF Reader to read in the molecules and their properties. Set knime://knime.workflow/../data/malariahts_molecules.sdf as path. Extract the Mol Block. Remember to extract the properties in the Property Handling tab.
  • 9. Use the Joiner node to join the tables from the SDF Reader and the Table Reader. Add a matching criterion and join based on the Sample column. Stay with the inner join. Exclude the sample column from the bottom input table in the Column Selection tab to avoid having it twice.
  • 10. Let's clean up the data table using the Table Manipulator node. - exclude the ExactMW column - rename the AverageMolecularWeight column to AMW - change the data type of NumRotatableBond and NumHeavyAtoms from String to Integer
  • 11. This node is pre-configured and will create a new column this REOS rule tags based on the rules stated above.
  • 12. Exclude all the rows that are duplicate using the Duplicate Row FIlter node. Detect duplicates based on the columns Sample and Mol Block.
  • 4. Use the Table Reader to import the malariahts_molecules_feature.table from the data folder. Use a workflow relative path to navigate to the table.
  • 21. Use the Sorter node and connect it to the Row Filter/Splitter node from step 14. Sort according to highest pEC50.
  • 22. Use the Table Row to Variable node to make the content of the first row available as flow variable. Select the InChI Key.
  • 23. Connect the flow variable from above with a String Manipulation node. Join the string from the table creator with the flow variable containing the InChI Key. Replace the chemblidURL column.
  • 24. Configure a GET Request node to use the URL in the chemlidURL column that we assembled in the prevous step.
  • 25. Parse the output of the GET Request node with the XPath node. In the configuration dialogue, scroll through the XML Cell Prview, click the blue items and Add XPath. Extract the - assa_chembl_id - assay_description - standard_type - standard_units - standard_value When adding the XPath, choose Multiple Rows
  • malariahts_experiment_hits.csv
  • correct column type
  • exclude "selected" column
  • Products <-> CustomerKey
  • Demographics and History from SAS file
  • Sentiment Rating + Sentiment Description
  • Web Activity (Old)
  • extract ChEMBL ID / parsing the output
  • External Model
  • convert the Mol to InChI Key
  • Keep Selected
  • create REOS rules
  • Web Activity (New)
  • construct activity URL
  • base URL ChEMBL
  • activity URL ChEMBL
  • Sentiment Evaluation from KNIME
  • KNIME-native format

Nodes

Extensions

Links