How to import external variables
To import external variables click 'Add external variables' in the menu 'File' or the shortcut 'External variables' in the tool bar. This option becomes active only after calculation of some molecular descriptors or loading of a Dragon project.
First the user is required to select the ASCII file containing the variables to be uploaded, and then the window 'Add external variables' appears. This window is organized into two main sections. One section is relative to the general information required for reading the user-defined variable file (i.e., the type of field delimiter and the code for missing values). The other section is relative to the selection of variables to be imported. Here a preview of the first 30 lines of the file is provided, which allows checking whether or not the file has been read correctly by the program.
Once all the import options have been set, complete the import procedure by clicking the 'Import' button.
The line containing the variable labels will be automatically guessed by Dragon and highlighted in gray-green colour. The user can change this selection, by clicking on the heading of the line of interest and, then, clicking 'Variable ID'.
String variables are automatically detected and highlighted in light blue.
To include/exclude variables, click the column heading and then select 'Include Column' or 'Exclude Column'. Excluded variables and records are highlighted in gray.
Note that it is assumed that all the data records of interest are consecutive. Moreover, when the field delimiter is SPACE only one space between two fields is allowed, if the checkbox 'Consider consecutive delimiters as one' has not been checked.
Dragon automatically uses the name of the loaded file as the name for the external variable block. Anyway, this can be changed by writing a new text in the text box 'Block Name'.
The number of data records must agree with the number of processed molecules, otherwise a warning message is shown and external variables will not be uploaded.
If at least one value of a variable is a text value (different from the missing value code), then the variable is automatically recognised as a string variable and accordingly highlighted in light blue.
If the variable labels are missing, then Dragon produces default labels.
Delimiters in the ASCII file
In the upper part of the window 'Add external variables', it is possible to select the delimiters used in the ASCII file. It is possible to consider consecutive delimiters as one by choosing the corresponding check box, i.e., two consecutive commas (,,) can be considered as a single delimiter.
The code used for missing values in the imported file can be set in the corresponding text box. In this way Dragon will be able to detect the presence of missing values in the loaded variables.
If external user-defined variables are added to the Dragon descriptors, these variables will be stored in a new block with the name specified in the 'Block Name' text field. The user can choose the name of the block of imported variables. By default, the name of the uploaded file is settled as the block name.
A preview of the first 30 lines of the imported ASCII file is provided, allowing the user to check if the file information has been correctly interpreted. This is the case when the first row contains the variable labels and the data records immediately follow. In the preview, the row containing the variable labels (Variable ID) is colored in green. If at least one value of a column is a text value (different from missing code), then that variable is automatically recognized as a text variable and its column is colored in blue.
Columns recognized as numerical variables are colored in white, while all the entries of the file that will not be imported are colored in gray (see the next figure as an example).
How to set the variable ID
The row containing the variable labels (Variable ID) is colored in green. Variable labels will be used by Dragon as the names of the imported external variables. Dragon tries to automatically recognize the row containing the variable labels; however, this can be set in the following way:
1. point the mouse on the heading of the row that you want to set as the row containing the variable labels;
2. click the left button of the mouse;
3. choose 'Variable ID'; the color of the chosen row will change in green.
If the variable labels are missing in the import file (e.g. the import file contains just
numerical values), Dragon produces default labels of type VARxx, where xx is the sequential number of the imported variables.
How to include/exclude columns
Columns of the import file that are not of interest can be excluded from the import
procedure in the following way:
1. point the mouse on the heading of the column that you want to exclude;
2. click the left button of the mouse;
3. choose 'Exclude Column'; the color of the chosen column will change in gray.
In order to include columns that were previously excluded, follow the same procedure and select 'Include Column'.
Information on the import procedure and automatic check
At the bottom of the window 'Add external variables', information on the import procedure are given. The number of detected lines in file, the selected records (rows) and the number of molecules previously loaded in Dragon are shown. Note that the number of data records must agree with the number of molecules, otherwise the 'Import' button is disabled. A colored icon placed on the left bottom of the window shows the import status.