This topic describes how to use a Scripting Node with an existing script. The script or executable does the following:
- Reads the node_args.json file
- Reads the exported text files
- Depending on what the script does, writes a node_response.json file when results are presented in the application
For information about modifying scripts to use with the Scripting Node, see Integrate your script into a Post-Processing Scripting Node.
Primarily, the Scripting Node is used as a post-processing node in the consensus workflow. Depending on the Scripting Node’s function, you can add it to a processing workflow or a consensus workflow. (The application’s default workflows do not include the Scripting Node.)
Procedure
- If the latest release of the language that the script was written in is not already installed on the computer running the Proteome Discoverer application, install it.
- Many of these languages are available for download, for example:
- For R, navigate to https://www.r-project.org
- For Python, navigate to https://www.python.org
- Do one of the following in the Proteome Discoverer application:
- Select Window > Workflow Editor.
- Within a study, select the Workflows tab.
- In the Post-Processing section of the Workflow Nodes pane, select the Scripting Node, and drag it into the Post-Processing Nodes space of the Workflow Tree pane.
- Select the Parameters of ‘Scripting Node’ tab.
- The Scripting Node parameters appear.
- For Path to Executable, enter the path to run the script from the command line, or select Browse and select the executable.
- For example:
- For RScript.exe, the default location is the
C:\Program Files\R\R-
version\bin
. - For Python.exe, the default location is
C:\Python
version. - For the Command Line Arguments parameter, enter the full path of the script executed followed by "%NODEARGS%".
- The Scripting Node replaces the %NODEARGS% text with the full path to the node_args.json file.
- You can send additional arguments to the script. Add them after the %NODEARGS% argument in space-separated format. The Scripting Node will pass the additional arguments to the external executable, and it will be up to the script to recognize them.
- For information on the contents and location of this file, see Integrate your script into a Post-Processing Scripting Node.
- For the Requested Tables and Columns parameter, select the Browse button.
- The Requested Tables and Columns dialog opens.
- The Requested Tables and Columns parameter sends the results from the Proteome Discoverer analysis to the script. Refer to any instructions provided with the script regarding the specific tables and the associated columns to select.
- Do one of the following:
- Select Load File to open Windows Explorer.
- Enter the tables and the columns into the dialog box or by loading a file that contains them.
- Use the following format:
- Follow each table by a ":" and a comma-separated list of column names.
- (Spaces after commas are supported.)
- To use more than one table name, use the ";" separator between the last column name from the previous table and the next table name.
- To export all of the columns from a table, use the table name without the ":" symbol or column headers.
Table 1:Column 1, Column 2, Column 3; Table 2:Column 1, Column 2, Column 3; Table 3
- The following example contains four columns from the Proteins table, 1 column from the Peptide Groups table, and all columns from the PSMs table for input into the script.
Proteins:Accession,Description,Adjusted Ratio P-Value,Abundance Ratio; Peptide Groups:Sequence,Abundance Ratio P-Value;PSMs
- Columns such as Abundance Ratio P-Value might contain any number of subcolumns depending on how many ratios were selected for a given analysis. The Scripting Node sends all subcolumns to the script. (Selecting a subset of subcolumns is not supported.)
NOTE
The order of tables and columns is important for the script.
NOTE
Any typographic errors in the names of the tables or columns results in failure to send that column to the script.
- See Table name and column name listing, for a listing. Also, refer to the media’s Scripting Node folder for an Excel file that contains this information.
- For the Use R-Friendly Columns parameter, select True.
- The parameter specifies whether to convert symbols such as # (as in # of Unique Peptides), % (as in % Sequence Coverage), and separators such as parenthesis or brackets. This setting allows the downstream scripting languages that use symbols for programming tasks to correctly parse the text.
- For the Archive Datafiles parameter, select True.
- This parameter is useful for debugging scripts and for exporting results from the application. The option creates a zip file in the study folder. The zip file contains the text files for each table sent to the script and the JSON files used to send information between the Scripting Node and the script.