A formula is a set of functions, numbers, operators, and fields arranged together to compute the expected result.
The result of a Custom Calculation must always be a 'single value'. A value is a result of type integer (number without decimal such as 1 or 2), double (number with decimal such as 1.2 or 16.989), string (text such as abcdef) or boolean (true or false).
A function manipulates values or lists, and returns a value, a list or an object.
In Custom Calculation language, an object is a sequence, an injection, a sample, a signal, a peak, a timed group, a named group, or a calibration curve.
In the function description, the syntax explains how to use the functions and what the function returns.
From a given object, you can access another object when there is only one object or a list of objects.
For example, from an injection, you can access its parent "sequence" object. From a sequence, you can access the list of its injections.
Use the '.' notation after an object to access functions, fields, or custom calculations that are available at the level of this object.
Object |
Field or function to access |
Syntax |
Comment |
---|---|---|---|
CurrentSequence |
Sequence_Name |
CurrentSequence.Sequence_Name |
Return the name of the current sequence |
CurrentInjection |
AllIdentifiedPeaks |
CurrentInjection.AllIdentifiedPeaks |
Return the list of all identified peaks in the current injection. |
CurrentPeakOrGroup |
Peak_Area |
CurrentPeakOrGroup.Peak_Area |
Return the area of the current peak |
PeakOrGroupByName (name as a string) |
Peak_Height |
PeakOrGroupByName("Benzene").Peak_Height | Return the height of the Peak named 'Benzene'. |
If you want to access a Custom Calculation available on a specific object, use the following syntax:
Object | Custom Calculation to access name | Custom Calculation type |
Syntax |
---|---|---|---|
CurrentSequence |
MyCC |
double |
CurrentSequence.GetDoubleCC("MyCC") |
The following functions available at Peak or group level must be called directly. These functions are available only at the Peak or group scope and available for the current Peak or group only. You cannot call them after PeakOrGroupByName.
For example:
AllMatchingPeaksAndGroups
MatchingPeak
GetConstant