Importing Spectrum Parameters |
(Not available in Mnova Lite) The 'Importing Spectrum Parameters' feature will allow Mnova users to include any variable into the Parameters Table from the raw data file. In addition, the users will be able to create 'Parameters Templates' in order to obtain the same parameters in all of their processed spectra. Before this feature was implemented, only standard spectrum parameters could be included in the corresponding table. The user will easily be able to add, create, remove or modify any spectrum parameter or even to create templates in order to obtain the same parameters in any processed spectra. To customize the parameters table just follow the menu: View/Parameters and click on the ‘Customize’ icon to display the 'Customize Parameters’ dialog box.
Clicking on the 'More>>' button will display the 'Current Spectrum Parameters' window, as you can see in the picture below. The user will be able to obtain any parameter from any raw data file (procs, acqus, title, etc...) by selecting the desired file on the 'File/Block' box (see the picture below):
In the 'Customize Parameters' dialog box, the user will see an ‘Experimental Parameters Template’ (red square in the picture above) which will be common for 1D and 2D (with information about: Title, Origin, Owner, Solvent, Temperature, etc.) and the ‘Dimensional Parameters Template' (green square in the picture above) with information about the 'Spectrometer Frequency', ''Acquired Size', 'Spectral Width', etc.). Both sections have blank rows in their last position to allow for addition of further parameters.
You can easily add any existing parameter from the raw data. Start by selecting the location of the parameter in the Experimental or Dimensional Parameters Template by clicking on the relevant cell of the 'Template' column on the table (cell number 25 in the screenshot below). Once this has been selected, double click on the desired parameter (from the 'Current Spectrum Parameters' box; procpar in the example below). This will add the chosen parameter (CF in the screenshot below) to the template.
Let´s see now how to add the title from the ‘parm.txt’ file (Bruker):
1st: Select the location of the parameter in the Experimental Parameter Template. 2nd: Select ‘parm.txt’ in the ‘Current Spectrum Parameters’ combo box. 3rd: Double click on the desired parameter (NAME, in this case). 4th: Click on ‘OK’ to add the parameter to the template.
Then, you will obtain the title on the parameters table:
Finally you will be able to add the Parameters Table to the spectrum by just clicking on the ‘Report’ button (highlighted in red in the picture above).
You can use the first line of a title which contains several lines. To do it, just type this function under the parameter Title template: =(function(aTitle){return aTitle.split("\n")[0];})(title())
This is the way to add the ‘easy’ parameters to the ‘Parameters Table’. However, there are other parameters which need a different procedure to be added from the ‘parm.txt’ file to the table. For example, some parameters with the same name i.g. for 2D can be written two times (for example the Spectral Frequency for f1 and for f2). Also some parameters have units. The syntax of the parm.txt file parsing allows handling both situations (allowing either to get a number, or a number with the units, or even only the units).
Please bear in mind that the syntax of the ‘parm.txt’ parsing is:
Let´s see how it works with a real example where we want to include the Spectral Frequency value for f1 and f2. As you can see in the picture below there are two values for the parameter ‘SF’ in the parm.txt file (one for f2 and another for f1):
We can not follow the same procedure that we followed a few pages before to insert the title on the parameters table, because now, we have two different parameters (one for f2 and another for f1) with the same name (SF).
For this reason we need to use the syntax of the parm.txt parsing, typing in the ‘f2 Template’ cell: parm.txt(SF;1;1;1) where SF is the name of the parameter, the first number (‘1’) indicates the order of appearance (The f2 parameter appears before in the parm.txt file than the f1). The second and the third number indicate the first word and the number of words of the string, respectively. In this case, the parameter has two words: the value (500.1299707) and the unit (MHz), but we are not interested in getting the units, so type (SF;1;1;1). If we were interested in also include the units, we must type: (SF;1;1;2).
In the ‘f1 Template’ cell; we would type: parm.txt(SF;2;1;1), because the SF parameter for f1 appears in the second position (after the SF value for f2):
Similar procedure will be followed, for example, to include the LB parameter for f2 and f1, as you can see in the picture below:
And here it is the result:
Imagine, that you have a parameter which appears in the middle of another parameters. For example the 'Mixing Time' parameter of a NOESY spectrum (from Bruker); which appears in the acqus file with this format:
##$D= (0..63) 3e-06 0.9643645 0 0 0 0 0 0 0 0.06 0 0.03 2e-05 3e-06 0 0 0.0002 0 0 0.00025 1e-05 1e-05 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
You want to display in this case, the D9, so you will need to type acqus($D[9]) in the Parameters template list as it is shown in the picture below:
The user will also be able to add his/her own parameters by double clicking on the table and typing the corresponding parameter name (between "quotation marks") and value. In the picture below, we have added manually the text "January, 15th, 2018" in the field: 'Original Name' and 'Date' as the 'Visible Name' The user will also be able to introduce formulas (available in the script) by typing an equal symbol followed by the desired formula (numbers or parameters), for example: =sum(a, b), or =div(acqus($TD), 2). Please note that formulas are case sensitive and should be lower case. For example, by default, the Acquired Size value is obtained by dividing the TD value by 2 (as TD is the total number of real and imaginary points), so we are using this template for the calculation =Utl.div(acqus($TD), 2) but if for some reason, you want to display just the TD value as Acquired size (instead of dividing the TD value by 2), you can leave the template as this: acqus($TD) The following example shows the procedure to show the ‘Time Delay’ in seconds. Firstly, we need to double click on the desired parameter in the ‘Current Spectrum Parameters’ list to add it to the ‘Parameters Template’:
By default the Time Delay is showed in milliseconds, so we need to divide the value by 1000 to obtain it in seconds. So, the user will need to type ‘=div(acqus($DE),1000)’ in the ‘Parameters Template’ to get the division. In this way the user will obtain the ‘Time Delay’ value in seconds in the Parameters Table, as you can see in the picture below:
To get the 'Experiment Time' in a Varian dataset; obtained by adding the 'd1' plus the 'at' and multiplying the result by the 'nt', we could use this function: =(function(d1, at, nt){return (parseFloat(d1) + parseFloat(at))*parseFloat(nt);})(procpar(d1), procpar(at), procpar(nt)) The parameters will be hidden in the table display if the user removes the corresponding tick mark on the 'Visible' Column. The user can also delete any parameters from the table by highlighting each of them and clicking on the 'Delete' button. The 'Restore' button is used to recover the default template. The user will be able to save his/her own template by clicking on the 'Save Template' icon . To load a template, just click on the 'Open Template' button . Clicking on 'OK' will save the template in the registry and Mnova will remember it for futures uses. The 'Apply' button is used to view the effect of any changes directly on the parameters table without needing to close the 'Customize Parameters' dialog box. You can also use the scripting engine to parse any parameter from any other file of the raw dataset. For example, the script below will be useful to parse the ICON-NMR user from the audita.txt file: "use strict"; var newPath = aFilePath.replace(/\\/g, "/"), f, str, audita = "", re=/^\s*ICON-NMR User ID:\s+(.+)$/gm, result; f = new File(newPath); f.open(File.ReadOnly); str = new TextStream(f); audita = str.readAll(); f.close(); result = re.exec(audita); if (result && result.length>1) { return result[1]; } return ""; }
To use it, copy the script into one of your folders in your hard disk. Next run Mnova, follow the menu ‘File/Preferences/Scripting’ and add that folder to the scripting directories:
Next, restart Mnova, load your NMR dataset and click on the ‘Customize’ button of your Parameters Table to add the new Parameter with this template:
Click on the OK button and you will find the new parameter added to your table:
See also: |