Resources – Scripting node
One of the new features in Compound Discoverer 3.1 (as well as Proteome Discoverer 2.4) is the Scripting node. This node allows users to enhance their workflows by adding custom calculations in the form of e.g. R- or Python scripts. Result tables from Compound Discoverer can easily be exported, read and processed by a script and the results can be returned as new columns or new tables into Compound Discoverer. Please find below the manual as well as examples.
This manual was written for Proteome Discoverer but the same concepts also apply to Compound Discoverer. Download
BY DOWNLOADING ANY SOFTWARE, SCRIPTS, TEMPLATES, DOCUMENTATION AND/OR OTHER MATERIALS (COLLECTIVELY “MATERIALS”) FROM THIS WEBSITE, YOU AND ANY COMPANY OR INSTITUTION YOU REPRESENT (COLLECTIVELY “YOU”) ACKNOWLEDGE AND AGREE AS FOLLOWS: (1) THE MATERIALS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, AND (2) THERMO FISHER SCIENTIFIC INC., ITS AFFILIATES AND EMPLOYEES WILL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING FROM YOUR USE OF THE MATERIALS, INCLUDING BUT NOT LIMITED TO DAMAGES ASSOCIATED WITH LOSS OR CORRUPTION OF DATA, INACCURATE RESULTS, AND/OR DIMINISHED INSTRUMENT PERFORMANCE.
1.) Hello World (sort of, in R). A very simple example that demonstrates how to export a table (Compounds), read the Molecular Weight column, add a value (+H) and return the result as a new column to CD.
This example also shows how to register a node as a “standalone” scripting node, so that it appears in the list of the nodes like a “regular” node. Multiple scripting nodes can be installed that way and the usage can be simplified for the end user by hiding the underlying scripting mechanism.
2.) CheckMark (R). An example how to use Options for Columns, here PositionAfter and SpecialCellRenderer. This script creates a column with green check marks for all compounds with molecular weight < 400. The new column will be positioned right after the Molecular Weight column in the Compounds table.
3.) Calculate mass difference for Features (Python). This example script in Python calculate the mass difference between Molecular Weight and m/z * charge in the Features table. The result is returned as a new column.