DataAnalysis Script Reference Manual
DataAnalysis Script Reference Manual
COPYRIGHT
Copyright 2005
Bruker Daltonik GmbH
All other trademarks are the sole property of their respective owners.
Document History
DataAnalysis Script Reference Manual, Version 3.3 (April 2005)
Part #: 223451 DataAnalysis Script Reference Manual
First edition: March 2004
Printed in Germany
Warranty
The information contained in this document is subject to change without notice.
Bruker Daltonik GmbH makes no warranty of any kind with regard to this material,
including, but not limited to, the implied warranties of merchantability and fitness for a
particular purpose.
Bruker Daltonik GmbH shall not be liable for errors contained herein or for incidental or
consequential damages in connection with the furnishing, performance or use of this
material.
Bruker Daltonik GmbH assumes no responsibility for the use or reliability of its software
on equipment that is not furnished by Bruker Daltonik GmbH.
CONTENTS
1 PREFACE ............................................................................................................................. 1-1
1.1 What's New in DataAnalysis 3.3 Automation ?.......................................................... 1-1
1 PREFACE
The Bruker Daltonics DataAnalysis 3.3 application (in the following ‘DataAnalaysis’)
can be controlled programmatically by manipulating it through Automation (formerly
OLE Automation). For example, in a Visual Basic Script, you can control an open ana-
lysis by manipulating its corresponding Analysis object.
The DataAnalysis object model enables you to automate analysis processing tasks.
This object model consists of the hierarchy of DataAnalysis objects, and their asso-
ciated properties, methods and events.
This manual describes each object, along with its properties, methods and events.
related to the other objects. It is used to control the VBScripting form in the Automation-
Engine and in DataAnalysis.
The "has-a" tree is shown below. For example, the Analyses object has, as one of its
properties, an Analysis object.
Application
Application (Application is its own parent)
Analyses
Analysis
Properties
Chromatograms (for "Chromatogram" analysis types)
Chromatogram
Definition (gets a ChromatogramDefinition object)
Compounds (for "Chromatogram" analysis types)
Compound
Spectrum
MSPeakList
MSPeak
Variables
Variable
LibrarySearchResults
LibrarySearchResult
Spectra (for "MassSpectrum" analysis types and averaged
spectrum entries in the Compound Mass List)
Spectrum
MSPeakList
MSPeak
Variables
Variable
LibrarySearchResults
LibrarySearchResult
ChromatogramDefinition___
GenerateFormulaParameters
MSFilter
SumFormula
Form
Implied objects
The Analysis, the Application, and the Form objects are the topmost objects for a
script running in DataAnalysis. These objects are implicitly available in the VBScript in
DataAnalysis. The Form object is the topmost object in the AutomationEngine. This
object is also implicitly available in the VBScript in the AutomationEngine.
The Analyses object has the following objects, properties and methods:
Objects
Properties
ActiveAnalysis
Count
Methods
Item
Open
The Analyses object is a collection object that contains all Analysis objects. To find a
particular object, iterate through the collection by using the Analyses object of the
Application object. Consider the following code snippet from a DataAnalysis Script.
Dim myAnalysis
set Application = GetObject("",
"BDal.DataAnalysis.Application")
For Each myAnalysis in Application.Analyses
' Access myAnalysis here.
' For example:
MsgBox myAnalysis.Name
Next
See Also
Analysis object
The Analysis object has the following objects, properties and methods:
Objects
Chromatograms Properties
Compounds Spectra
Properties
Active Path
FullName ScriptVarable
IsChromatographicAnalysis Type
Name
Methods
AddChromatogramRangeSelection Print
ClearChromatogramRangeSelections PrintToPDF
ClearResults RecalibrateExternal
Close RecalibrateInternal
DeleteScriptTable RunScipt
FindAutoMSn Save
FindDissect SendReport
FindMSn SetScriptTableCellText
LoadMethod SetScriptTableColumnHeader
MascotSearch
The Application object has the following objects, properties and methods:
Objects
Analyses
Properties
Active Path
FullName Version
Logging Visible
Name
Methods
Activate Show
Hide
The Chromatogram object has the following objects, properties and methods:
Objects
Properties
Definition MinimumIntensity
FirstRetentionTime Name
Intensity RetentionTime property
LastRetentionTime Size
MaximumIntensity
Methods
AddRangeSelection FindCompounds
AverageMassSpectrum IntegrateOnly
ChromatogramData Noise
ClearRangeSelections RelatedCompounds
Export Smooth
See Also
Chromatograms object
There exist several different ChromatogramDefinition objects, each for a specific type
of chromatogram trace. These are:
TICChromatogramDefinition for Total Ion Chromatograms
EICChromatogramDefinition for Extracted Ion Chromatograms
BPCChromatogramDefinition for Base Peak Chromatograms
CNLChromatogramDefinition for Constant Neutral Loss Chromatograms
MassPosChromatogramDefinition for Mass Position Chromatograms
UVChromatogramDefinition for 1D UV Chromatograms
UV2DChromatogramDefinition for extracted chromatograms of a 2D UV data
file
VARChromatogramDefinition for Acquisition Parameter Chromatograms
Methods
ChromatogramDefiniton objects are used in two situations: First to define a new chro-
matogram and to add it to the analysis and second to get information about an existing
chromatogram.
Example
The following example first adds a single TIC and then a set of three traces, another
TIC, a BPC, and an acquisition variable trace to the list of loaded and displayed traces
in DataAnalysis:
Dim TIC, BPC, UV, Var
Dim Chroms(3) ' define an array of four chromatogram
definitions
BPC.MSFilter.Type = daMSFilterAllMSMS
BPC.ScanMode = daScanModeFullScan
BPC.Polarity = daPositive
BPC.BackgroundType = daBgrdTypeSpectral
BPC.Range = "200-500; 700; 800-1000"
BPC.WidthLeft = 0.8
BPC.WidthRight = 1.0
Set Chroms(1) = BPC
The Chromatograms object has the following objects, properties and methods:
Objects
Properties
Count
Methods
Add FindsCompounds
AddChromatogram IntegrateOnly
AddChromatograms Item
BaselineSubtract Smooth
Clear
The Chromatograms object is a collection object that contains all Chromatogram
objects. To find a particular object, iterate through the collection by using the Chroma-
tograms object of the Analysis object. Consider the following code snippet from an
AutomationEngine Script:
Example
Dim DataAnalysis, myAnalysis, Chrom
Set DataAnalysis = GetObject("",
"BDal.DataAnalysis.Application")
Set myAnalysis = DataAnalysis.Analyses.Open "C:\Data
Files\Demo\Sample.d\Analysis.yep"
For Each Chrom in myAnalysis.Chromatograms
' Access Chrom here.
' For example:
Chrom.IntegrateOnly
Next
See Also
Chromatogram object
The Compound object has the following objects, properties and methods:
Objects
LibrarySearchResult Variables
Properties
Area MSFilter
BaselineEndIntensity Name
BaselineStartIntensity PeakEndIntensity
Chromatogram PeakStartIntensity
Count RetentionTime
HasLibrarySearchResults RetentionTimeEnd
Height RetentionTimeStart
Intensity SeparationType
Molweight SignalToNoise
Methods
Deconvolute Item
Export
All defined compounds belong to the Compounds collection represented by the Com-
pounds object. You can find a particular compound by iterating through this collection.
Example
In the following sample cmpd is the first compound and ms2 is the second spectrum of
this compound:
dim cmpd, ms2
set cmpd = Analysis.Compounds(0)
set ms2 = cmpd(2)
The following sample code exports every second spectrum of all compounds in BSC
format:
For i = 1 to Analysis.Compounds.Count
Analysis.Compounds(i)(2).Export CStr(i), daBSC
Next
See Also
Compounds object
The Compounds object has the following objects, properties and methods:
Objects
Properties
Count
Methods
Clear Identify
Deconvolute Item
DeleteCompound MassListClear
Export MassListFind
The Compounds object is a collection object that contains all Compound objects. To
find a particular object, iterate through the collection by using the Compounds object
of the Analysis object. Consider the following code snippet from a DataAnalysis Script:
Example
Dim Cmpd
For Each Cmpd in Analysis.Compounds
' Access Cmpd here.
' For example:
Cmpd.Deconvolute
Next
See Also
Compound object
Properties
Methods
Caption Maximize
Close Minimize
DoEvents Restore
Enable Show
Hide ShowMenu
HideMenu
Properties
ApplyNitrogenRule HCRatioMinimum
AutoSearchMonoIsotopicPeak LowerBoundaryFormula
Charge NumberOfFormula
DoubleBondEquivalenceMaximum SearchMass
DoubleBondEquivalenceMinimum SearchRange
ElectronConfiguration Tolerance
HCRatioMaximum UpperBoundaryFormula
Methods
Example
Dim GFP
Set GFP =
CreateObject("DataAnalysis.GenerateFormulaParameters")
GFP.Charge = +1
GFP.DoubleBondEquivalenceMinimum = 3
GFP.DoubleBondEquivalenceMaximum = 8
GFP.LowerBoundaryFormula = "C5H5Fe0"
GFP.UpperBoundaryFormula = "C30H30Fe3"
GFP.NumberOfFormula = 50
GFP.Tolerance = 0.001
GFP.SearchMass = 186
GFP.SearchRange = 0.5
See Also
GenerateFormula method
The LibrarySearchResult object has the following objects, properties and methods:
Objects
Properties
CASRegistryNumber HasIdentifiedPositivePolarity
CompoundComment LibraryNames
CompoundName MolWeight
Fit Purity
Formula RetentionTime
HasIdentifiedMS RFit
HasIdentifiedMSMS SpectrumComment
HasIdentifiedNegativePolarity SpectrumInfo
Methods
See Also
LibrarySearchResults object
The LibrarySearchResults object has the following objects, properties and methods:
Objects
Properties
Count
Methods
Item
Example
The following example displays a message box with the library search result for the first
compound:
dim Results
set Results = Analysis.Compounds(1).LibrarySearchResults
dim i
dim output
for i = 1 to Results.Count
output = output + vbLf + " " + Results(i).CompoundName +
", Purity = " + CStr(Results(i).Purity)
next
See Also
LibrarySearchResult object
The MSFilter object has the following objects, properties and methods:
Objects
Properties
FragmentationPath
Type
Methods
Example
Dim TIC
Set TIC =
CreateObject("DataAnalysis.TICChromatogramDefinition")
TIC.MSFilter.Type = daMSFilterMSMS
TIC.MSFilter.FragmentationPath = "490.8/300.5"
Analysis.Chromatograms.AddChromatogram TIC
See Also
ChromatogramDefinition objects
The MSPeak object has the following objects, properties and methods:
Objects
Properties
Algorithm PeakEnd
Area PeakEndIntensity
ChargeState PeakStart
DeconvolutedMolweight PeakStartIntensity
DeconvolutionComponent SignalToNoise
Intensity Width
m_over_z
Methods
See Also
MSPeakList object
The MSPeakList object has the following objects, properties and methods:
Objects
Properties
Count
Methods
DeletePeak
The MSPeakList object is a collection object that contains all MSPeak objects of a
mass spectrum. To find a particular object, iterate through the collection by using the
MSPeakList object of the Spectrum object. Consider the following code snippet from a
DataAnalysis Script:
Example
Dim Peak
For Each Peak in Spectrum.MSPeakList
' Access Peak here.
' For example:
MsgBox Peak.m_over_z
Next
See Also
MSPeak object
Spectrum object
The Properties object has the following objects, properties and methods:
Objects
Properties
Comment InstrumentName
DateCreated SampleInfo
Methods
Example
The following example displays a message box with analysis properties:
Dim Properties
Dim CR
CR = chr(13)
Properties = "Analysis name: " + Analysis.Name + CR
Properties = Properties + " Comment: " +
Analysis.Properties.Comment + CR
Properties = Properties + " Date created: " +
Analysis.Properties.DateCreated + CR
Properties = Properties + " Instrument name: " +
Analysis.Properties.InstrumentName + CR
Properties = Properties + " Sample info: " +
Analysis.Properties.SampleInfo + CR
MsgBox Properties
The Spectra object has the following objects, properties and methods:
Objects
Properties
Count
Methods
BaselineSubtract Item
Deconvolute MassListClear
Export MassListFind
GenerateFormula Smooth
Identify
The Spectra object is a collection object that contains all Spectrum objects. To find a
particular object, iterate through the collection by using the Spectra object of the Ana-
lysis object.
See Also
Spectrum object
Properties
BackgroundType MinimumIntensity
FirstMass MSFilter
HasLibrarySearchResults MSPeakList
Intensity Name
LastMass Polarity
Mass ScanMode
MaximumIntensity Size
Methods
Export MassListFind
ExportMassList RecalibrateInternal
GenerateFormula Smooth
Identify SpectrumData
MassListClear
For a spectrum analysis all defined spectra belong to the Spectra collection repre-
sented by the Spectra object. For a chromatogram analysis all defined spectra belong
to the Compound collection represented by the Compound object; the Compound
object is in turn a collection of the Compounds object. You can find a particular spec-
trum by iterating through this collection.
See Also
Spectra object
Compound object
Objects
Properties
AverageMass MonoIsotopicMass
ElementalCounts NominalMass
Formula
Methods
Add Pattern
ElementalComposition Subtract
Example
The following example calculates and displays the average mass of the singly charged
ion of Ethanol (C2H5OH) and also displays the hill-sorted sum formula of Ethanol:
dim SF
set SF = CreateObject("DataAnalysis.SumFormula")
SF.Formula = "C2H5OH"
MsgBox SF.AverageMass(+1)
MsgBox SF.Formula
Objects
Properties
Group Unit
Name Value
Methods
Example
The following example displays the accumulation time of the first spectrum of
compound 1 for an esquire analysis:
dim i, var, Variables
set Variables = Analysis.Compounds(1)(1).Variables
for i = 1 to Variables.Count
set var = Variables(i)
if var.Group = "Trap" and var.Name = "Accumulation Time"
then
MsgBox "The accumulation time is "+var.Value+"
"+var.Unit
exit for
end if
next
See Also
Variables object
Objects
Properties
Count
Methods
Item
Example
The following example displays the number of variables of the first spectrum of com-
pound 1:
dim Cmpd, nVars
set Cmpd = Analysis.Compounds(1)
nVars = Cmpd(1).Variables.Count
msgbox "The first spectrum of compound """+Cmpd.Name+"""
contains "+CStr(nVars)+" variables."
See Also
Spectrum object
Variable object
3 AUTOMATION PROPERTIES
Properties are characteristics of objects. For example, analysis objects have Name and
Path properties. These properties correspond to the name and path of an analysis. For
examples of using properties, see the macro samples provided with DataAnalysis.
object.
Group Gets the group string value of a Variable object.
GroupName Gets or sets the group name of a Chromato-
gramDefinition object.
HasIdentifiedMS Gets the condition of a LibrarySearchResult
object if the compound has been identified by its
precursor spectra.
HasIdentifiedMSMS Gets the condition of a LibrarySearchResult
object if the compound has been identified by its
fragment spectra.
HasIdentifiedNegativePolarity Gets the condition of a LibrarySearchResult
object if the compound has been identified by
negative polarity spectra.
HasIdentifiedPositivePolarity Gets the condition of a LibrarySearchResult
object if the compound has been identified by
positive polarity spectra.
HasLibrarySearchResults Gets the condition of a Compound or Spectrum
object if has been identified.
IsChromatographicAnalysis Gets the condition of an Analysis object if the
analysis is a chromatogram analysis.
LastMass Gets the last mass of a Spectrum object.
LastRetentionTime Gets the last retention time value of a Chroma-
togram object in seconds.
LibraryNames Gets the names of the mass-spectral library of a
LibrarySearchResult object.
Logging Turns on/off logging of all incoming automation
calls.
LowerBoundaryFormula Gets or sets the lower boundary formula of sum
formulas to be generated of a GenerateFormu-
laParameters object.
m_over_z Gets the m/z value of an MSPeak object.
Mass Gets the m/z value at defined index of a Spec-
trum object.
MaximumIntensity Gets the maximum intensity of a Chromatogram
or Spectrum object.
MinimumIntensity Gets the minimum intensity of a Chromatogram
or Spectrum object.
of a LibrarySearchResult object.
RetentionTimeEnd Gets the retention time at which the Compound
object ends.
RetentionTimeOffset Gets or sets the retention time offset of a UV
type ChromatogramDefinition object.
RetentionTimeStart Gets the retention time at which the Compound
object starts.
RFit Gets the effective RFit score of a
LibrarySearchResult object.
ScanMode Gets or sets the scan mode of an MS type
ChromatogramDefinition object or Spectrum
object.
ScriptVariable Gets and sets a string value to a variable of an
Analysis object.
SearchMass Gets or sets the search mass of a Generate-
FormulaParameters object to be looked for in a
mass spectrum.
SearchRange Gets or sets the range of a GenerateFormula-
Parameters object within the search mass
should be searched in a mass spectrum.
SeparationType Gets the type of separation of a Compound
object.
SequenceNumbers Gets the sequence numbers which contributed to
a Spectrum object.
SignalToNoise Gets the signal to noise ratio of a Compound or
MSPeak object.
Size Gets the number of data points of a Spectrum
object.
SpectrumComment Gets the spectrum comment text of a Library-
SearchResult object.
SpectrumInfo Gets the spectrum information text of a Library-
SearchResult object.
Type Gets the type of a ChromatogramDefinition
object.
Unit Gets the unit string value of a Variable object.
UpperBoundaryFormula Gets or sets the upper boundary formula of sum
formulas to be generated of a GenerateFormu-
laParameters object.
Syntax
object.Active [=boolean]
Parameters
object An expression that evaluates to an Application object. When you access
the Active property of the Application object, you can omit object
because the name of the Application object is implied when you access
its properties and methods.
boolean A Boolean that sets the state of the object. Possible values are:
True Activates the object.
False Deactivates the object.
Return Values
The Active property returns one of the following values:
• True The object is active.
• False The object is not active.
Remarks
The Active property has the Boolean type.
Example
The following example browses all open analyses for the analysis named MyAnalysis.
If the analysis is found, it becomes the active analysis.
Dim myAnalysis
set Application = GetObject("",
"BDal.DataAnalysis.Application")
For Each myAnalysis in Application.Analyses
If myAnalysis.Name = "MyAnalysis" Then
myAnalysis.Active = True
End If
Next
Syntax
object.Area
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Syntax
object.Charge
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Example
The following example sets/gets the auto-search mono-isotopic peak option of a
GenerateFormulaParameters object and displays it in a message box.
Dim GFP
Set GFP = CreateObject("DataAnalysis.GenerateFormulaParameters")
GFP.AutoSearchMonoIsotopicPeak = true
MsgBox GFP.AutoSearchMonoIsotopicPeak
Syntax
object.AverageMass charge
Parameters
object An expression that evaluates to a SumFormula object.
charge Charge state for which the m/z value should be calculated.
Example
The following example calculates and displays the average mass of Ethanol (C2H5OH):
dim SF
set SF = CreateObject("DataAnalysis.SumFormula")
SF.Formula = "C2H5OH"
MsgBox SF.AverageMass(0)
Syntax
object.BackgroundType
Parameters
object An expression that evaluates to one of the objects in the Applies
To list above.
BackgroundType = daBgrdTypeNone no background subtraction
daBgrdTypeConstant background subtraction of a constant,
previously defined Background Mass
Spectrum
daBgrdTypeSpectral two dimensional, spectral background
subtraction
Example
The following example sets the background type of TICChromatogramDefinition:
TIC.BackgroundType = daBgrdTypeSpectral
Syntax
object.BaselineStartIntensity
Parameters
object An expression that evaluates to a Compound object.
Syntax
object.CASRegistryNumber
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.Charge
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Example
The following example sets/gets the charge of a GenerateFormulaParameters object
and displays it in a message box.
Dim GFP
Set GFP = CreateObject("DataAnalysis.GenerateFormulaParameters")
GFP.Charge = -5
MsgBox GFP.Charge
Syntax
object.ChargeState
Parameters
object An expression that evaluates to an MSPeak object.
Syntax
object.Chromatogram
Parameters
object An expression that evaluates to a Compound object.
Syntax
object.Comment
Parameters
object An expression that evaluates to a Properties object.
Example
MsgBox Analysis.Properties.Comment
Syntax
object.CompoundComment
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.CompoundName
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.Count
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Remarks
The Count property has the Long type.
Use the Count property, for example, to get the number of analyses in the Analyses
collection.
Example
The following example prints each analysis in the Analyses collection:
For i = 1 to Application.Analyses.Count
Application.Analyses.Item(i).Print("Chromatogram
Report.layout")
Next
Syntax
object.DateCreated
Parameters
object An expression that evaluates to a Properties object.
Example
MsgBox Analysis.Properties.DateCreated
Syntax
object.DeconvolutedMolweight
Parameters
object An expression that evaluates to an MSPeak object.
Syntax
object.DeconvolutionComponent
Parameters
object An expression that evaluates to an MSPeak object.
Syntax
object.Definition
Parameters
object An expression that evaluates to a Chromatogram object.
Example
The following example gets the definition and displays the name of each chromato-
gram:
Dim Definition
For each Chromatogram in Analysis.Chromatograms
MsgBox Chromatogram.Definition.Name
If Chromatogram.Definition.Type = daTICChromType Then
MsgBox "This is a TIC"
End If
next
Syntax
object.DoubleBondEquivalenceMaximum
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Example
Dim GFP
Set GFP = CreateObject("DataAnalysis.GenerateFormulaParameters")
GFP.DoubleBondEquivalenceMaximum = 13
MsgBox GFP.DoubleBondEquivalenceMaximum
Syntax
object.DoubleBondEquivalenceMinimum
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Example
Dim GFP
Set GFP = CreateObject("DataAnalysis.GenerateFormulaParameters")
GFP.DoubleBondEquivalenceMinimum = 4
MsgBox GFP.DoubleBondEquivalenceMinimum
Syntax
object.ElectronConfiguration
Parameters
object An expression that evaluates to a GenerateFormulaPara-
meters object.
ElectronConfiguration = daEven even number of electrons
daOdd odd number of electrons
daEvenOdd either even or odd number of electrons
Syntax
object.ElementalCounts symbols counts
Parameters
object An expression that evaluates to a SumFormula object.
symbols An array storing the symbols of each different element.
counts An array storing the number of occurrences of each different element.
Example
The following example gets the number of different elements and retrieves the number
of occurrences of each element.
Note: Arrays starting with index zero.
dim symbols()
dim counts()
dim SF
set SF = CreateObject("DataAnalysis.SumFormula")
SF.Formula = "C10H10Fe"
MsgBox SF.ElementalCounts symbols, counts
for n = 0 to UBound(symbols)
MsgBox symbols(n) & " " & counts(n)
next
Analysis.Chromatograms.AddChromatogram UV
function HyStarUNTFileName
n = InStrRev(Analysis.Name, ".")
HyStarUNTFileName = Left(Analysis.Name, n-1) + ".unt"
end function
Syntax
object.FirstMass
Parameters
object An expression that evaluates to a Spectrum object.
Syntax
object.FirstRetentionTime
Parameters
object An expression that evaluates to a Chromatogram object.
Example
The following example displays the retention time range of the first chromatogram
loaded:
set chrom = analysis.chromatograms(1)
msgbox "Retention time: " +
CStr(Int(chrom.FirstRetentionTime)) + " - " +
CStr(Int(chrom.LastRetentionTime))
See Also
LastRetentionTime property
Syntax
object.Fit
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.Formula
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Example
The following example displays the hill-sorted sum formula of Ethanol (C2H5OH):
dim SF
set SF = CreateObject("DataAnalysis.SumFormula")
SF.Formula = "C2H5OH"
MsgBox SF.Formula
See Also
LibrarySearchResults object
Syntax
object.FullName
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above. When you access the FullName property of the Application
object, you can omit object because the name of the Application object is
implied when you access its properties and methods.
Remarks
The FullName property has the String type.
The following table summarizes the results of using the FullName property with the
objects in the Applies To list:
Object Results
Application Gets the full path to the DataAnalysis executable, for example:
"C:\Program Files\DataAnalysis\DataAnalysis.exe"
Analysis Gets the full path to the file containing the analysis, for example:
"C:\Data Files\Demo\Sample.d\Analysis.yep"
Example
The following example displays the full path to each analysis in the Analyses collec-
tion:
set Application = GetObject("",
"BDal.DataAnalysis.Application")
dim myAnalyses
set myAnalyses = Application.Analyses
For i = 1 to myAnalyses.Count
MsgBox myAnalyses.Item(i).FullName
Next
See Also
Name property
Path property
Syntax
object.Group
Parameters
object An expression that evaluates to a Variable object.
See Also
Variable object
Variables object
Syntax
object.GroupName
Parameters
object An expression that evaluates to a VarChromatogramDefinition object.
GroupName Name of group, to which an acquisition parameter belongs, as shown in
Edit Chromatograms dialog.
Example
The following example displays the variable name:
MsgBox Var.GroupName
See Also
VariableName property
Syntax
object.HasIdentifiedMS
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.HasIdentifiedMSMS
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.HasIdentifiedNegativePolarity
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.HasIdentifiedPositivePolarity
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.HasLibrarySearchResults
Parameters
object An expression that evaluates to a Compound or Spectrum object.
See Also
LibrarySearchResults object
Syntax
object.HCRatioMaximum
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Syntax
object.HCRatioMinimum
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Syntax
object.Intensity(n)
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
n An index value for the intensity to retrieve; applies only to the Chromato-
gram, Compound and Spectrum, but not to the MSPeak object.
Remarks
When accessing numerous intensity values of a chromatogram or spectrum, the Chro-
matogramData method, resp. SpectrumData method, will be significantly faster.
Example
The following example finds and displays the maximum intensity of the first chroma-
togram.
dim chrom
set chrom = analysis.chromatograms(1)
dim i, MaxIntensity
MaxIntensity = 0
for i = 1 to chrom.size
if MaxIntensity < chrom.Intensity(i) then
MaxIntensity = chrom.Intensity(i)
end if
next
See Also
ChromatogramData method
SpectrumData method
Mass property
RetentionTime property
Syntax
object.Visible
Parameters
object An expression that evaluates to an Analysis object.
Syntax
object.LastMass
Parameters
object An expression that evaluates to a Spectrum object.
Syntax
object.LastRetentionTime
Parameters
object An expression that evaluates to a Chromatogram object.
Example
The following example displays the retention time range of the first chromatogram
loaded:
set chrom = analysis.chromatograms(1)
msgbox "Retention time: " +
CStr(Int(chrom.FirstRetentionTime)) + " - " +
CStr(Int(chrom.LastRetentionTime))
See Also
FirstRetentionTime property
Syntax
object.Logging [=boolean]
Parameters
object An expression that evaluates to an Application object.
boolean A Boolean that sets the state of the object. Possible values are:
True Activates the object.
False Deactivates the object.
Return Values
The Logging property returns one of the following values:
• True The object is active.
• False The object is not active.
Remarks
The Logging property has the Boolean type.
Example
The following example first displays a message box with the current logging status and
then turns on logging.
MsgBox(Application.Logging)
Application.Logging = true
Syntax
object.LowerBoundaryFormula
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Example
The following example sets/gets the lower boundary formula of a GenerateFormula-
Parameters object and displays it in a message box:
Dim GFP
Set GFP = CreateObject("DataAnalysis.GenerateFormulaParameters")
GFP.LowerBoundaryFormula = "C24H30N0O2S3"
MsgBox GFP.LowerBoundaryFormula
Syntax
object.m_over_z
Parameters
object An expression that evaluates to an MSPeak object.
Syntax
object.Mass(n)
Parameters
object An expression that evaluates to a Spectrum object.
n Index value for the m/z value to retrieve.
Remarks
When accessing numerous mass values of a spectrum, the SpectrumData method will
be significantly faster.
Example
The following example finds and displays the most intense m/z value of the first
spectrum in the first compound.
dim spec
set spec = Analysis.Compounds(1)(1)
for i = 1 to spec.size
if MaxIntensity < spec.Intensity(i) then
MaxIntensity = spec.Intensity(i)
MaxMass = spec.Mass(i)
end if
next
See Also
SpectrumData method
Intensity property
Syntax
object.MaximumIntensity
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Syntax
object.MinimumIntensity
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Syntax
object.MolWeight
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
See Also
LibrarySearchResults object
Parameters
object An expression that evaluates to a SumFormula object.
charge Charge state for which the m/z value should be calculated.
Example
The following example calculates and displays the monoisotopic mass of the double
charged ion of Ethanol (C2H5OH):
dim SF
set SF = CreateObject("DataAnalysis.SumFormula")
SF.Formula = "C2H5OH"
MsgBox SF.MonoIsotopicMass(+2)
Syntax
object.Name
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Remarks
The Name property has the String type.
The following table summarizes the results of using the Name property with the objects
in the Applies To list:
Object Results
Analysis Gets the name of the analysis.
Application Gets the name of the application.
Chromatogram Gets the description for the chromatogram.
Compound Gets the description for the processed mass spectrum.
Spectrum Gets the description for the mass spectrum.
ChromatogramDefinition Gets the name of chromatogram trace
The Name property does not get an analysis’ drive and directory. To get the drive and
directory use the Path or FullName property.
Example
The following example gets the name of the analysis and displays it in a message box:
MsgBox Analysis.Name
See Also
FullName property
Variable object
Variables object
Syntax
object.NominalMass charge
Parameters
object An expression that evaluates to a SumFormula object.
charge Charge state for which the m/z value should be calculated.
Example
The following example calculates and displays the nominal mass of Ethanol (C2H5OH):
dim SF
set SF = CreateObject("DataAnalysis.SumFormula")
SF.Formula = "C2H5OH"
MsgBox SF.NominalMass(0)
Syntax
object.NumberOfFormula
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Example
The following example sets/gets the number of formulas of a GenerateFormulaPara-
meters object and displays it in a message box:
GPF.NumberOfFormula = 42
MsgBox GPF.NumberOfFormula
Syntax
object.Path
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above. When you access the Path property of the Application object, you
can omit object because the name of the Application object is implied
when you access its properties and methods.
Remarks
The Path property has the String type.
The Path property does not get an object's file name and extension. To get the file
name and extension use the Name or FullName property.
The following table summarizes the results of using the Path property with the objects
in the Applies To list:
Object Results
Application Gets the path to the DataAnalysis executable, for example:
"C:\Program Files\DataAnalysis"
Analysis Gets the path to the file containing the analysis, for example: ":
"C:\Data Files\Demo\Analysis.d"
The Path property does not end the path with a backslash, unless the path has the
format "C:\."
Example
The following example gets the path to the analysis and displays it in a message box:
MsgBox Analysis.Path
Syntax
object.Polarity
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Syntax
object.Purity
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.Range
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Range = {range} combined range, e.g., "290 – 350; 400" or single value 400
Example
The following example sets the range of BPCChromatogramDefinition:
BPC.Range = "300-400"
Syntax
object.RetentionTime
object.RetentionTime(n)
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
n An index value for the retention time to retrieve; applies only to the Chro-
matogram object.
Remarks
When accessing numerous retention time values of a chromatogram, the Chromato-
gramData method will be significantly faster.
Example
The following example displays the retention time end value of the first chromatogram.
dim chrom
set chrom = analysis.chromatograms(1)
See Also
ChromatogramData method
Intensity property
LibrarySearchResults object
Syntax
object.RetentionTimeEnd
Parameters
object An expression that evaluates to a Compound object.
Parameters
object An expression that evaluates to a Compound object.
Syntax
object.RFit
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.SampleInfo
Parameters
object An expression that evaluates to a Properties object.
Example
MsgBox Analysis.Properties.SampleInfo
Syntax
object.ScanMode
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
ScanMode = daScanModeFullScan full scan mode
daScanModeMaxRes high resolution mode
daScanModeAll full scan and high resolution mode
Example
The following example sets the scan mode of TICChromatogramDefinition:
TIC.ScanMode = daScanModeFullScan
Syntax
object.ScriptVariable
Parameters
object An expression that evaluates to an Analysis object.
VariableName A unique name for the variable. Variable names are not case-sensi-
tive.
Remarks
Variables are stored in the results of an analysis. The content of a variable can be
included in a print report using the dedicated report layout component.
Example
The following example creates and sets a variable named ‘Test’ and assigns the string
value ‘15’ to it:
ScriptVariable("Test") = "15"
The following example displays the content of the variable named ‘Test’:
MsgBox ScriptVariable("Test")
Syntax
object.SearchMass
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Example
The following example sets/gets the search mass of a GenerateFormulaParameters
object and displays it in a message box:
GPF.SearchMass = 243.3
MsgBox GPF.SearchMass
Syntax
object.SearchRange
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Example
The following example sets/gets the search range of a GenerateFormulaParameters
object and displays it in a message box:
GPF.SearchRange = 0.1
MsgBox GPF.SearchRange
Syntax
object.SeparationType
Parameters
object An expression that evaluates to a Compound object.
Syntax
object.SequenceNumbers
Parameters
object An expression that evaluates to a Spectrum object.
The following drawing illustrates the Signal and the Noise values.
Syntax
object.Size
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Syntax
object.SpectrumComment
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.SpectrumInfo
Parameters
object An expression that evaluates to a LibrarySearchResult object.
See Also
LibrarySearchResults object
Syntax
object.SumIntensity
Parameters
object An expression that evaluates to a Spectrum object.
Syntax
object.Tolerance
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Example
The following example sets the tolerance to 0.01 ppm and then gets it again and dis-
plays it in a message box:
GPF.Tolerance = 0.01
MsgBox GPF.Tolerance
Syntax
object.Unit
Parameters
object An expression that evaluates to a Variable object.
See Also
Variable object
Variables object
Parameters
object An expression that evaluates to a GenerateFormulaParameters object.
Example
The following example sets/gets the upper boundary formula of a GenerateFormula-
Parameters object and displays it in a message box:
Dim GFP
Set GFP = CreateObject("DataAnalysis.GenerateFormulaParameters")
GFP.UpperBoundaryFormula = "C54H100N3O2S6"
MsgBox GFP.UpperBoundaryFormula
See Also
GroupName property
Syntax
object.Version
Parameters
object An expression that evaluates to an Application object.
Remarks
The version is formatted as "major.minor.build.sub-build", e.g., "3.2.100.0".
Example
The following example gets the version of DataAnalysis and displays it in a message
box:
MsgBox Application.Version
Syntax
object.Visible
Parameters
object An expression that evaluates to an Application object.
See Also
Hide method
Show method
Syntax
object.Width
Parameters
object An expression that evaluates to an MSPeak object.
Syntax
object.WidthLeft
object.WidthRight
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Remarks
The default values are "0.5".
Example
The following example sets the left and right width of a BPCChromatogramDefinition
object:
BPC.Range = 400.5
BPC.WidthLeft = 0.5
BPC.WidhtRight = 0.8
4 AUTOMATION METHODS
Methods are actions you take against objects. For example, to add a document to the
collection of open documents, you use the Add method of the Documents object.
For examples of using methods, see the macro sample provided with DataAnalysis.
The following methods are available:
Method Description
Activate Activates DataAnalysis
Add Adds a simple chromatogram to a Chromato-
grams object. Adds a partial sum formula
string to the formula in a SumFormula object.
AddChromatogram Adds a fully defined chromatogram to a
Chromatograms object.
AddChromatogramRangeSelection Adds a selection range to the current set of
selected ranges for the chromatograms of an
Analysis object.
AddChromatograms Adds several fully defined chromatograms at
once to a Chromatograms object.
AddRangeSelection Adds a selection range to the current set of
selected ranges for a Chromatogram object.
AverageMassSpectrum Calculates the average spectrum of the
selected range of a Chromatogram object
and creates a new Compound Mass Spectra
entry with the averaged spectrum.
BaselineSubtract Performs a baseline subtraction on spectra in
a Spectra object.
Caption Sets the caption in the script form of a Form
object.
ChromatogramData Gets the retention time and intensity vector of
a Chromatogram object.
Clear Deletes all items of a Chromatograms or
Compounds object.
ClearChromatogramRangeSelections Clears the chromatograms selection of an
Analysis object.
ClearRangeSelections Clears all selection ranges of a Chromato-
gram object. If no selected ranges are
defined, the full retention time and intensity
Syntax
object.Activate(reserved)
Parameters
object An expression that evaluates to an Application object.
reserved This parameter is ignored.
Example
The following example activates DataAnalysis without changing its current size, unless
it is minimized:
Set DA = GetObject("","BDal.DataAnalysis.Application")
DA.Activate(0)
Syntax
object.Add (ChromatogramType, MSType, range, polarity)
object.Add formula
Parameters
object An expression that evaluates to one of the objects in the
Applies To list above.
ChromatogramType = daTIC Total ion chromatogram
daEIC Extracted ion chromatogram
daBPC Base peak chromatogram
MSType = daAll, All MS and MS/MS spectra
daAllMS All MS spectra
daAllMSn All MS(n) spectra
{ions} daughter ions, e.g., "289" or "672/289")
range = {range} combined range , e.g., "290 – 350; 400"
polarity = daPositive positive polarity
daNegative negative polarity
daBoth positive and negative polarity
formula A partial formula to add to a SumFormula object.
Example
The following example adds a total ion chromatogram of all positive MS and MSn
spectra to the Chromatograms collection:
Analysis.Chromatograms.Add daTIC, daAll, "", daPositive
The following example adds a total ion chromatogram of all MS3 spectra with parent
m/z 290 in the first generation and m/z 150 in the second to the Chromatograms
collection:
Analysis.Chromatograms.Add daTIC, "290/150", "", daBoth
The following example adds a Methylen group (C2H) to Ethanol (C2H5OH) making up
Propanol and displays the hill-sorted sum formula of it:
dim SF
set SF = CreateObject("DataAnalysis.SumFormula")
SF.Formula = "C2H5OH"
SF.Add "CH2"
MsgBox SF.Formula
See Also
AddChromatogram method
AddChromatograms method
Syntax
object.AddChromatogram ChromatogramDefinition
Parameters
object An expression that evaluates to a Chromatograms object.
ChromatogramDefinition An expression that evaluates a ChromatogramDefinition
object.
This can be one the following objects:
TICChromatogramDefinition
EICChromatogramDefinition
BPCChromatogramDefinition
CNLChromatogramDefinition
MassPosChromatogramDefinition
UVChromatogramDefinition
UV2DChromatogramDefinition
VARChromatogramDefinition
Examples
The following example adds a chromatogram to the Chromatograms collection:
Dim TIC, VAR
Set TIC =
CreateObject("DataAnalysis.TICChromatogramDefinition")
Set Var =
CreateObject("DataAnalysis.VARChromatogramDefinition")
' do some definitions of TIC and Var...
Analysis.Chromatograms.AddChromatogram TIC
Analysis.Chromatograms.AddChromatogram Var
Analysis.Chromatograms.AddChromatogram UV
function HyStarUNTFileName
n = InStrRev(Analysis.Name, ".")
HyStarUNTFileName = Left(Analysis.Name, n-1) + ".unt"
end function
See Also
Add method
AddChromatograms method
ChromatogramDefinition objects
Syntax
object.AddChromatogramRangeSelection (RetTimeStart, RetTimeEnd, Intensity-
Start, IntensityEnd)
Parameters
object An expression that evaluates to an Analysis object.
RetTimeStart Start of the retention time range in minutes.
RetTimeEnd End of the retention time range in minutes.
IntensityStart (reserved for future use).
IntensityEnd (reserved for future use).
Example
The following example defines two selected ranges (10-15min and 20-22min) of the
Analysis object and runs the Find AutoMS(n) algorithm:
Analysis.AddChromatogramRangeSelection 10, 15, 0, 0
Analysis.AddChromatogramRangeSelection 20, 22, 0, 0
Analysis.AddChromatogramRangeSelection.FindAutoMSn
See Also
FindAutoMSn method
ClearChromatogramRangeSelections method
FindDissect method
Syntax
object.AddChromatograms (chroms)
Parameters
object An expression that evaluates to a Chromatograms object.
Chroms An array of ChromatogramDefinition objects.
These can be one the following objects:
TICChromatogramDefinition
EICChromatogramDefinition
BPCChromatogramDefinition
CNLChromatogramDefinition
MassPosChromatogramDefinition
UVChromatogramDefinition
UV2DChromatogramDefinition
VARChromatogramDefinition
Example
The following example adds a three chromatogram traces to Chromatograms collec-
tion at once:
Dim Chroms(3)
Dim TIC, BPC, EIC
Set TIC =
CreateObject("DataAnalysis.TICChromatogramDefinition")
Set EIC =
CreateObject("DataAnalysis.EICChromatogramDefinition")
Set BPC =
CreateObject("DataAnalysis.BPCChromatogramDefinition")
Analysis.Chromatograms.AddChromatograms(Chroms)
See Also
Add method
AddChromatogram method
ChromatogramDefinition objects
Syntax
object.AddRangeSelection (RetTimeStart, RetTimeEnd, IntensityStart, Intensity-
End)
Parameters
object An expression that evaluates to a Chromatogram object.
RetTimeStart Start of the retention time range in minutes.
RetTimeEnd End of the retention time range in minutes.
IntensityStart (reserved for future use).
IntensityEnd (reserved for future use).
Example
The following example defines two selected ranges (10-15min and 20-22min) of the
Chromatogram object of the first chromatogram loaded:
Analysis.Chromatograms(1).AddRangeSelection 10, 15, 0, 0
Analysis.Chromatograms(1).AddRangeSelection 20, 22, 0, 0
See Also
AverageMassSpectrum method
ClearRangeSelections method
FindCompounds method
IntegrateOnly method
Syntax
object. AverageMassSpectrum (bLine, bProfile)
Parameters
object An expression that evaluates to a Chromatogram object.
bLine A Boolean value. True will create an averaged line spectrum.
bProfile A Boolean value. True will create an averaged profile spectrum.
Example
The following example defines two selected ranges (10-15min and 20-22min) of the
Chromatogram object of the first chromatogram loaded and then calculates a profile
spectrum placed in the Compound Mass List.
Analysis.Chromatograms(1).AddRangeSelection 10, 15, 0, 0
Analysis.Chromatograms(1).AddRangeSelection 20, 22, 0, 0
Analysis.Chromatograms(1).AverageMassSpectrum false, true
See Also
AddRangeSelection method
ClearRangeSelections method
Syntax
object.BaseLineSubtract
Parameters
object An expression that evaluates to a Spectra object.
Example
The following example baseline subtracts each spectrum in the Spectra collection:
Analysis.Spectra.BaseLineSubtract
Syntax
object.Caption ( title )
Parameters
object An expression that evaluates to a Form object.
title A string specifying the new caption.
Example
The following example sets the caption "Demo" in the script form:
Form.Caption "Demo"
Syntax
object.ChromatogramData retentiontime_vector, intensity_vector
Parameters
object An expression that evaluates to a Chromatogram object.
retentiontime_vector A vector for the retention time values.
intensity_vector A vector for the intensity values.
Remarks
When accessing numerous retention time/intensity values of a chromatogram, this
method will be significantly faster than using the RetentionTime or Intensity proper-
ties.
The vectors being filled with retention time and intensity values are zero-based.
Example
The following example calculates the total sum intensity of an chromatogram.
dim rt()
dim intensity()
dim chrom
set chrom = Analysis.Chromatograms(1)
dim sum
sum = 0
dim i
for i = 0 to UBound(intensity)
sum = sum + intensity(i)
next
See Also
SpectrumData method
RetentionTime property
Intensity property
Syntax
object.ClearRangeSelections
Parameters
object An expression that evaluates to a Chromatogram object.
Example
The following example clears all selected of the Chromatogram object of the first
chromatogram loaded:
Analysis.Chromatograms(1).ClearRangeSelections
See Also
AddRangeSelection method
AverageMassSpectrum method
FindCompounds method
IntegrateOnly method
Syntax
object.ClearResults
Parameters
object An expression that evaluates to an Analysis object.
Example
The following example deletes the results in an Analysis.
Analysis.ClearResults
Syntax
object.Close
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Remarks
The Analysis.Close command cannot be invoked in a script attached to an analy-
sis. This command can only be used from external scripts, e.g., from the Automation-
Engine, or applications other than DataAnalysis.
Example
The following example closes the script form.
Form.Close
Syntax
object.Deconvolute
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Example
The following example deconvolutes each spectrum in the Compounds collection:
Analysis.Compounds.Deconvolute
Syntax
object.DeleteCompound ( n )
Parameters
object An expression that evaluates to a Compounds object.
n Number of compound to delete
Example
The following example deletes the first compound in the Compounds collection:
Analysis.Compounds.DeleteCompound 1
The following example deletes all compounds in the Compounds collection, except for
the first:
For i = Analysis.Compounds.Count to 2 step -1
Analysis.Compounds.DeleteCompound i
Next
See Also
Clear method
Syntax
object.DeletePeak ( n )
Parameters
object An expression that evaluates to an MSPeakList object.
n Number of peak to delete
Example
The following example deletes all peaks of all precursor spectra of the first compound:
Dim Spec
For Each Spec in Analysis.Compounds(1)
If Spec.MSFilter.Type = daMSFilterMS Then
For i = Spec.MSPeakList.Count to 1 to by -1
Spec.MSPeakList.DeletePeak i
Next
End If
Next
Syntax
object.DeleteScriptTable TableName
Parameters
object An expression that evaluates to an Analysis object.
TableName Name of the table to delete
Remarks
The Analysis.Close command cannot be invoked in a script attached to an analy-
sis. This command can only be used from external scripts, e.g., from the Automation-
Engine, or applications other than DataAnalysis.
Example
The following example deletes the script table "MyTable" of the analysis.
Analysis.DeleteScriptTable "MyTable"
See Also
SetScriptTableCellText method
SetScriptTableColumnHeader method
Syntax
object.DoEvents
Parameters
object An expression that evaluates to a Form object.
Example
The following example handles pending events in the script form:
Form.DoEvent
Syntax
object.ElementalComposition symbols, fractions
Parameters
Object An expression that evaluates to a SumFormula object.
symbols An array used to store the symbols of each present element.
fractions An array used to store the relative amount of each element.
Example
The following example calculates the elemental composition for ferrocene and demon-
strates how to access the resulting data.
Note: the arrays are start with index zero
dim symbols()
dim fractions()
dim SF
set SF = CreateObject("DataAnalysis.SumFormula")
SF.Formula = "C10H10Fe"
SF.ElementalComposition symbols, fractions
for n = 0 to UBound(symbols)
MsgBox symbols(n) & " " & fractions(n)
next
Syntax
object.Form [=boolean]
Parameters
object An expression that evaluates to a Form object.
boolean A Boolean that sets the state of the object. Possible values are:
True Enables the script form.
False Disables the script form.
Example
The following example browses all open analyses for the analysis named MyAnalysis.
If the analysis is found, it becomes the active analysis.
Dim myAnalysis
set Application = GetObject("",
"BDal.DataAnalysis.Application")
For Each myAnalysis in Application.Analyses
If myAnalysis.Name = "MyAnalysis" Then
myAnalysis.Active = True
End If
Next
Syntax
object.Export filename type
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
filename Destination, to which the export should be saved, if the filename is empty
DataAnalysis will generate a filename based on name of the analysis.
Compound and Compounds object:
type = daMGF Export in Mascot format (*.mgf)
daCSV Export in comma-separated-value ASCII format (*.csv)
daXML Export in XML format (*.xml)
Spectrum and Spectra object:
type = daMGF Export in Mascot format (*.mgf)
daASCII Export in ASCII format (*.ascii)
daXY Export in a simple ASCII format containing x-y values
only (*.xy)
daCSV Export in comma-separated-value ASCII format (*.csv)
daBSC Export a profile spectrum in BioTools ASCII format(*.bsc)
daXML Export in XML format (*.xml)
Chromatogram object:
type = daChemStation Export spectra in Agilent ChemStation format (*.d)
daASCII Export spectra in ASCII format (*.ascii)
daXY Export the chromatogram in a simple ASCII format
containing x-y values only (*.xy)
daCDF Export spectra in andi netCDF format (*.cdf)
Chromatogram object and daChemStation or daASCII type only:
spectrum = daLine Export line spectra; optional parameter, default is daLine
daProfile Export profile spectra; optional parameter
Remarks
The export to ASCII format (*.ascii) will export profile spectra if the spectrum parameter
is set to daProfile and if profile spectra are available. Otherwise, line spectra are
exported.
Example
The following example deconvolutes each spectrum in the Compounds collection
object and exports the result as a Mascot file:
Analysis.Compounds.Deconvolute
Analysis.Compounds.Export "", daMGF
Syntax
object.ExportMassList filename type
Parameters
object An expression that evaluates to a Spectrum object.
filename Destination, to which the export should be saved, if the filename is empty
DataAnalysis will generate a filename based on name of the analysis.
type = daASCII Export in blank-separated ASCII format (*.ascii)
daCSV Export in comma-separated-value ASCII format (*.csv)
Remarks
The mass list of a line spectrum contains all lines. The mass list of a profile spectrum
contains the peaks being found with one of the mass list peak finder algorithms. The
items of the Mass List being exported are determined by the Mass List Layout defined
in the related method parameters.
Example
The following example exports the first averaged spectrum in the Compound Mass List.
Analysis.Spectra(1).ExportMassList "", daASCII
See Also
Export method
Syntax
object.FindAutoMSn
Parameters
object An expression that evaluates to an Analysis object.
Remarks
Example
The following performs an automatic integration on MRM analysis.
Analysis.FindAutoMSn
See Also
AddChromatogramRangeSelection method
Syntax
object.FindCompounds
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Example
The following performs an automatic integration on analyses.
Dim MyChromatogram
For each MyChromatogram in Analysis.Chromatograms
MyChromatogram.FindCompounds
Next
' which is fully equivalent to:
Analysis.Chromatograms.FindCompounds
See Also
AddRangeSelection method
ClearRangeSelections method
Syntax
object.FindDissect
Parameters
object An expression that evaluates to an Analysis object.
Remarks
Example
The following performs an automatic integration on MRM analysis.
Analysis.FindDissect
See Also
AddChromatogramRangeSelection method
Syntax
object.FindMSn
Parameters
object An expression that evaluates to an Analysis object.
Example
The following performs an automatic integration on MRM analysis.
Analysis.FindMSn
Syntax
object.GenerateFormula parameters, filename
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
parameters An expression that evaluates to a GenerateFormulaParameters object
filename Destination, to which the results list should be saved. If the file name is
empty DataAnalysis will generate a file name based on location and
name of the analysis.
Remarks
The results list will be written as a *.csv file.
Example
The following example generates formulas on each spectrum in the Spectra collection
object and exports the result to the specified file:
Dim GFP
Set GFP =
CreateObject("DataAnalysis.GenerateFormulaParameters")
GFP.Charge = +1
GFP.DoubleBondEquivalenceMinimum = 3
GFP.DoubleBondEquivalenceMaximum = 8
GFP.LowerBoundaryFormula = "C5H5Fe0"
GFP.UpperBoundaryFormula = "C30H30Fe3"
GFP.NumberOfFormula = 50
GFP.Tolerance = 0.001
GFP.SearchMass = 186
GFP.SearchRange = 0.5
Analysis.Spectra.GenerateFormula GFP ,
"D:\Data\MyAnalysis.d\FormulaResult0.csv"
Syntax
object.Hide
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Example
The following example hides the script form:
Form.Hide
The following example temporarily hides the DataAnalysis application during some
processing:
Application.Hide
’ do some processing...
Application.Show
See Also
Show method
Syntax
object.HideMenu
Parameters
object An expression that evaluates to a Form object.
Example
The following example hides the menu of the script form:
Form.HideMenu
Syntax
object.Deconvolute
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Example
The following example identifies each spectrum in the Compounds collection:
Analysis.Compounds.Identify
Syntax
object.IntegrateOnly
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Example
The following performs an automatic integration on analyses.
Dim MyChromatogram
For each MyChromatogram in a Analysis.Chromatograms
MyChromatogram.IntegrateOnly
Next
' which is fully equivalent to:
Analysis.Chromatograms.IntegrateOnly
See Also
AddRangeSelection method
ClearRangeSelections method
-or-
object index
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
index A Variant that is a Long or String representing the appropriate analysis,
layout, processed spectrum, spectrum, or trace.
• If you specify a Long, the Item method fetches the object by its one-
based index in the collection.
• If you specify a String, it must be one of the strings described in the
following table:
Object String
Analyses
Remarks
If you specify numbers for index, do not store these for later use because the indices
might change as objects are added or removed.
The Item method is the default. Accordingly, you don't have to reference Item explicitly,
as shown in the syntax.
Note that the first valid index is ‘1’ – not‘0’.
Example
The following example prints all open analyses:
for num = 1 to Analyses.Count
Msgbox Analyses.Item(num).Name
Analyses(num).Print("Chromatogram Report")
next
Syntax
object.LoadMethod ( MethodName )
Parameters
object An expression that evaluates to an Analysis object.
MethodName A String that specifies the method file name. If no drive and path is
included the method is loaded from the default method folder.
Example
The following loads a method from the default method folder.
Analysis.LoadMethod "Metabolite.m"
The following loads a method by specifying the full path name.
Analysis.LoadMethod "D:\MyMethods\Test.m"
Syntax
object.MascotSearch
Parameters
object An expression that evaluates to an Analysis object.
Remarks
This method requires that the Bruker Daltonics BioTools™ 2.0 application is installed
on the system and BioTools being properly setup to search on a Mascot database.
Example
The following performs an automatic integration on analyses.
Analysis.FindAutoMSn
Analysis.Compounds.Deconvolute
Analysis.MascotSearch
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Example
The following code performs MassListClear on each spectrum in a Spectra object:
Analysis.Spectra.MassListClear
Syntax
object.MassListFind ( start, end )
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Start Start m/z value
End End m/z value
Example
The following code performs MassListFind on each spectrum in a Spectra object:
val = Analysis.Spectra.MassListFind(250, 400)
Example
The following example maximizes the script form:
Form.Maximize
Syntax
object.Minimize
Parameters
object An expression that evaluates to a Form object.
Example
The following example minimizes the script form:
Form.Minimize
The signal-to-noise ratio determination differs to the one used in the Find Compounds
algorithm only, that it is using a fixed, small smoothing width. The steps for determina-
tion the noise level simplifies to:
1. The third derivative of the chromatogram is calculated using the Savitzky-Golay
algorithm with a smoothing width m=1. The simplified formula then is:
1 1
y 'i = y i +1 − y i −1
2 2
2. The standard deviation σ of all values of the third derivative y''' is determined.
2
N
y ' ' 'i
σ = ∑
i =1 N
The determination of an internal threshold by a histogram approach as in the
signal-to-noise determination in Find Compounds does not apply, if the region
selected does not contain chromatographic peaks.
The following drawing illustrates the Signal and the Noise values.
Syntax
object. Noise
Parameters
object An expression that evaluates to a Chromatogram object.
Example
The following example defines a selected range (10-15min) of the first chromatogram
loaded and then determines and displays the noise.
Analysis.Chromatograms(1).AddRangeSelection 10, 15, 0, 0
noise = Analysis.Chromatograms(1).Noise
MsgBox "Noise (10-15min) = " + CStr(noise)
See Also
AddRangeSelection method
ClearRangeSelections method
Syntax
object.Open ( PathName )
Parameters
object An expression that evaluates to an Analyses object.
PathName A String that specifies the full path to the analysis.
Example
The following example opens the analysis file C:\Data Files\Demo\Sample.d\Ana-
lysis.yep:
set myAnalysis = Application.Analyses.Open("C:\Data
Files\Demo\Sample.d\Analysis.yep")
See Also
Close method
Syntax
object.Pattern charge, bHighResolution, m_over_z, intensities
Parameters
Object An expression that evaluates to a SumFormula object.
Charge The charge state which should be considered for calculation.
dim SF
set SF = CreateObject("DataAnalysis.SumFormula")
SF.Formula = "C10H10Fe"
SF.Pattern 1, 0, m_over_z, intensities
for n = 0 to UBound(m_over_z)
MsgBox m_over_z(n) & " " & I(n)
next
The Report layout name may be specified without the instrument category and without
the “.layout“ extension of the report layout filename. Thus, “Display Report”,
“Esquire\Display Report”, or “Display Report.layout” are all legal and equivalent
settings.
Printing thru automation (this command) always uses the non-direct printing mode. The
direct printing mode available in the Print dialog cannot be applied here.
Example
The following prints the “Display Report” report.
Analysis.Print "Display Report"
Syntax
object.PrintToPDF layout [, filename]
Parameters
object An expression that evaluates to an Analysis object.
layout Report layout name.
filename Full path of the PDF file to write. This parameter is optional; if it is not
specified, the PDF will be stored in the analysis folder with the filename
“Report.pdf”.
Remarks
Layouts for DataAnalysis are currently exclusively being stored below the dedicated
folder “C:\BDalSystemData\Report Layouts\DataAnalysis”.
The Report layout name may be specified without the instrument category and without
the “.layout“ extension of the report layout filename. Thus “Display Report”,
“Esquire\Display Report” or “Display Report.layout” are all legal and equivalent
settings.
Example
The following prints the “Generic Display Report” report to “Report.pdf” in the analysis
folder.
Analysis.PrintToPDF "Generic Display Report"
Syntax
object.RecalibrateInternal
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Remarks
If a complete chromatographic analysis is to be recalibrated internally, the analysis is
recalibrated based on the first spectrum in the Compound List (Analysis.Spectra(0))
which is not part of a Compound. The internal recalibration is performed on this spec-
trum and then applied to all other spectra of this analysis. Note, that the method para-
meter settings for the recalibration must be properly set to contain peaks being found in
this first spectrum.
Syntax
object.RelatedCompounds compound_nr_vector
Parameters
object An expression that evaluates to a Chromatogram object.
compound_nr_vector A vector for the compound number values.
Remarks
The vector being filled with compound numbers is zero-based.
Example
The following example displays the related compounds for the first chromatogram:
dim cpmds()
dim text, i, c
dim Chrom
set Chrom = Analysis.Chromatograms(1)
Chrom.RelatedCompounds cpmds
MsgBox text
Syntax
object.Restore
Parameters
object An expression that evaluates to a Form object.
Example
The following example restores the script form:
Form.Restore
Syntax
object.RunScript
Parameters
object An expression that evaluates to an Analysis object.
Example
The following example starts the script of an analysis:
Analysis.RunScript
Syntax
object.Save
Parameters
object An expression that evaluates to an Analysis object.
Example
The following example saves the analysis:
Analysis.Save
Syntax
object.SendReport layout, email
Parameters
object An expression that evaluates to an Analysis object.
layout Report layout name.
email Email address.
Remarks
Layouts for DataAnalysis are currently exclusively being stored below the dedicated
folder “C:\BDalSystemData\Report Layouts\DataAnalysis”.
The Report layout name may be specified without the instrument category and without
the “.layout“ extension of the report layout filename. Thus, “Display Report”,
“Esquire\Display Report” or “Display Report.layout” are all legal and equivalent
settings.
Example
The following sends an email with the “Generic Display Report” report attached to an
email recipient defined in the local address book (My Colleague).
Analysis.SendReport "Generic Display Report", "My Colleague"
Syntax
object.SetScriptTableCellText TableName, ColumnNumber, RowNumber, CellText
Parameters
object An expression that evaluates to an Analysis object.
TableName Name of the table
ColumnNumber Column number of the cell
RowNumber Row number of the cell
CellText Text to set into the cell
Remarks
Script tables can only be filled through the automation interface. Its content can only be
examined by printing (or print preview).
Example
The following example creates a script table named "MassAccuracyTable" with 4
columns and fills in 2 rows:
Dim i
Dim TableName
Dim TargetMass(2)
Dim ActualMass(2)
Dim Accuracy(2)
TableName = "MassAccuracyTable"
TargetMass(1) = "509.20"
TargetMass(2) = "612.40"
ActualMass(1) = "509.25"
ActualMass(2) = "509.42"
Accuracy(1) = "0.05"
Accuracy(2) = "0.02"
'Fill table
for i = 1 to 2
Analysis.SetScriptTableCellText TableName, 1, i, CStr(i)
Analysis.SetScriptTableCellText TableName, 2, i,
TargetMass(i)
Analysis.SetScriptTableCellText TableName, 3, i,
ActualMass(i)
Analysis.SetScriptTableCellText TableName, 4, i,
Accuracy(i)
Next
This Sample can be printed out using a report layout containing a "Scripting Table"
component with the "Variable Name" property set to "MassAccuracyTable".
Syntax
object.SetScriptTableColumnHeader TableName, ColumnNumber, HeaderText
Parameters
object An expression that evaluates to an Analysis object.
TableName Name of the table
ColumnNumber Column number
HeaderText Text to set as header
Remarks
Script tables can only be filled through the automation interface. Its content can only be
examined by printing (or print preview).
See Also
SetScriptTableCellText method
Syntax
object.Show
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Example
The following example shows a hidden script form again:
Form.Show
The following example temporarily hides the DataAnalysis application during some
processing:
Application.Hide
’ do some processing...
Application.Show
See Also
Hide method
Syntax
object.ShowMenu
Parameters
object An expression that evaluates to a Form object.
Example
The following example shows a hidden script form again:
Form.ShowMenu
Syntax
object.Smooth
Parameters
object An expression that evaluates to one of the objects in the Applies To list
above.
Example
The following code smoothes all spectra of a mass spectrum analysis:
Analysis.Spectra.Smooth
Syntax
object.SpectrumData mass_vector, intensity_vector
Parameters
object An expression that evaluates to a Spectrum object.
mass_vector A vector for the m/z values.
intensity_vector A vector for the intensity values.
Remarks
When accessing numerous mass/intensity values of a chromatogram, this method will
be significantly faster than using the Mass or Intensity properties.
The vectors being filled with m/z and intensity values are zero-based.
Example
The following example calculates the total sum intensity of a chromatogram.
dim mass()
dim intensity()
dim spec
set spec = Analysis.Compounds(1)(1)
dim sum
sum = 0
dim i
for i = 0 to UBound(intensity)
sum = sum + intensity(i)
next
See Also
ChromatogramData method
Mass property
Intensity property
Syntax
object.Subtract formula
Parameters
object An expression that evaluates to a SumFormula object.
formula A partial formula
Example
The following example subtracts a Methylen group (CH2) to Ethanol (C2H5OH) making
up Methanol and displays the hill-sorted sum formula of it:
dim SF
set SF = CreateObject("DataAnalysis.SumFormula")
SF.Formula = "C2H5OH"
SF.Subtract "CH2"
MsgBox SF.Formula
5 AUTOMATION EVENTS
Events are not supported.
INDEX
S T
SampleInfo property ............................. 3-44 TICChromatogramDefinition object ........ 2-8
Save method ........................................ 4-40 Tolerance property................................ 3-50
ScanMode property .............................. 3-45 Type property........................................ 3-50
ScriptVariable property......................... 3-45
SearchMass property ........................... 3-46 U
SearchRange property ......................... 3-46 Unit property ......................................... 3-51
SendReport method ............................. 4-40 UpperBoundaryFormula property ......... 3-51
SeparationType property...................... 3-47 UV2DChromatogramDefinition object..... 2-8
SequenceNumbers property ................ 3-47 UVChromatogramDefinition object ......... 2-8
SetScriptTableCellText method............ 4-41
SetScriptTableColumnHeader method 4-43 V
Show method........................................ 4-43 Value property....................................... 3-52
ShowMenu method .............................. 4-44 VARChromatogramDefinition objects ..... 2-8
SignalToNoise property........................ 3-48 Variable object ...................................... 2-24
Size property ........................................ 3-48 VariableName property......................... 3-52
Smooth method .................................... 4-44 Variables object .................................... 2-25
Spectra object....................................... 2-21 Version property.................................... 3-53
Spectrum object.................................... 2-21 Visible property ..................................... 3-53
SpectrumComment property ................ 3-49
SpectrumInfo property.......................... 3-49
W
Subtract method ................................... 4-46 Width property....................................... 3-54
SumFormula object .............................. 2-23 WidthLeft property................................. 3-54
SumIntensity property .......................... 3-49 WidthRight property .............................. 3-54