Mnova Extensions to QtScript

Application

Application object

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
applicationName String
clipboard Clipboard
identityManager IdentityManager [read-only]
mainWindow MainWindow [read-only]
name String [read-only]
organizationName String
version Object [read-only]
version.build Number [read-only]
version.full String [read-only]
version.major Number [read-only]
version.minor Number [read-only]
version.number Number [read-only]
version.release String [read-only]
version.revision Number [read-only]

applicationName : String

clipboard : Clipboard

See also: Clipboard

identityManager : IdentityManager [read-only]

The identities manager. Handles Mnova identities to digital sign Mnova documents

mainWindow : MainWindow [read-only]

Main window object

name : String [read-only]

Application name

organizationName : String

version : Object [read-only]

Application version

version.build : Number [read-only]

Version build number

version.full : String [read-only]

Full version string

version.major : Number [read-only]

Version major number

version.minor : Number [read-only]

Version minor number

version.number : Number [read-only]

Introduced in v.8.1.0-11172

Floating point representation of the version. It is recommended to use this number to compare software versions.

version.release : String [read-only]

The version release

Valid values: {"Chemist", "Console", "Full", "Lite"}

version.revision : Number [read-only]

Version revision number.

Functions

Name Output Parameters
blockSignals QObject aObj, Bool aBlock
checkDependencies Array aPlgArr
createUuid
exit Number aStatus
getPluginInfo Object String|RegExp aPluginID
loadUi Object String aUiString, String aWorkingDir = Dir.application()
loadUiFile Object String aUiFile, String aWorkingDir = Dir.application()
lockDocument Document aDocument
markForDeletion QObject aObj
openUrl String aUrl
quit
requestUiUpdate String aUuid
setExitStatus Number aStatus
unlockDocument

blockSignals (QObject aObj, Bool aBlock)

Blocks or unblocks the signals emmited by an object.


List of parameters:
  • QObject aObj
  • Bool aBlock

checkDependencies (Array aPlgArr)

Checks the availability of a list of plug-ins. Throws an exception if it fails


List of parameters:
  • Array aPlgArr

    - An array with the names or ids of the needed plug-ins

createUuid ()

Returns a UUID.

exit (Number aStatus)

Closes all the windows and exits Mnova with an exit status.


List of parameters:
  • Number aStatus

getPluginInfo (String|RegExp aPluginID) : Object

Returns an object with information about the specified plug-in


List of parameters:
  • String|RegExp aPluginID

    - A regular expression or a string (in this case must be an uuid or a plugin name, case insensitive)

loadUi (String aUiString, String aWorkingDir = Dir.application()) : Object

Load a user interface string and returns the created object


List of parameters:
  • String aUiString
  • String aWorkingDir

    - The UI resource files, such as icons and resource files, are relative to this directory

loadUiFile (String aUiFile, String aWorkingDir = Dir.application()) : Object

Load a user interface file and returns the created object


List of parameters:
  • String aUiFile
  • String aWorkingDir

    - The UI resource files, such as icons and resource files, are relative to this directory

lockDocument (Document aDocument)

Forces the activeDocument to be aDocument until the next call of unlockDocument


List of parameters:

markForDeletion (QObject aObj)

Schedule and object for deletion in the main thread


List of parameters:
  • QObject aObj

openUrl (String aUrl)

Opens URL with external browser.


List of parameters:
  • String aUrl

quit ()

Closes all the windows and quits Mnova.

requestUiUpdate (String aUuid)

Update a user interface


List of parameters:
  • String aUuid

    - The user interface's id. If empty, all user interfaces are updated.

setExitStatus (Number aStatus)

Sets the application exit status


List of parameters:
  • Number aStatus

unlockDocument ()




AreaSeries

Wrapper to Qt Charts QAreaSeries

Properties

Name Type Comments
borderColor String
color String
name String
opacity Number

borderColor : String

color : String

name : String

opacity : Number

The opacity of the area. By default, the opacity is 1.0. The valid values range from 0.0 (transparent) to 1.0 (opaque).

Constructors

AreaSeries ()

Functions

Name Output Parameters
setLowerSeries LineSeries aLineSeries
setUpperSeries LineSeries aLineSeries

setLowerSeries (LineSeries aLineSeries)


List of parameters:
  • LineSeries aLineSeries

    - Sets the series that is to be used as the area chart lower series.

setUpperSeries (LineSeries aLineSeries)


List of parameters:
  • LineSeries aLineSeries

    - Sets the series that is to be used as the area chart upper series. If the upper series is null, the area chart is not drawn, even if it has a lower series.




Arrow

Arrow page item

Inherits PageItem

Properties

Name Type Comments
endX Number
endY Number
origin Object
startX Number
startY Number

endX : Number

endY : Number

origin : Object

Object that contains the point (x, y) used as origin for the arrow coordinates.

startX : Number

startY : Number

Constructors

Arrow (Arrow aArrow)

Functions

Name Output Parameters
endHead Object
setEndHead Object aObject
setStartHead Object aObject
startHead Object
toString String

endHead () : Object

Returns an object with the arrow end head attributes

setEndHead (Object aObject)


List of parameters:
  • Object aObject

setStartHead (Object aObject)


List of parameters:
  • Object aObject

startHead () : Object

Returns an object with the arrow start head attributes

toString () : String




ASVPlugin

The Mnova Verify plug-in object

Enumerations

Name Type Values
VerifyFlags Number NMRAbsReference, None, RedoNMRPredictions

Properties

Name Type Comments
negativeThreshold Number
positiveThreshold Number
settings ASVSettings [read-only]

negativeThreshold : Number

positiveThreshold : Number

settings : ASVSettings [read-only]

The verification settings

Constructors

ASVPlugin (ASVPlugin aASVPlugin)

Functions

Name Output Parameters
getResults Array PageItem aSpecItem
getResults Array Molecule aMolecule
getResults Array
getResults Array PageItem aSpecItem, Molecule aMolecule
modifyPriorConfidence aPriorConfidence, [Number aId]
moleculeIdFromResult String VerificationResult aResult
moleculeIdFromResult String VerificationResult aResult
moleculeIdFromResult String VerificationResult aResult
moleculeIdFromResult String VerificationResult aResult
scoreToColor aScore, [ aPositiveThreshold], [ aNegativeThreshold]
spectraItemsFromResult Array VerificationResult aResult
verify VerificationResult Array aNMRGroup, Molecule aMolecule, [MassItem aMSItem], [Number aFlags], [Number aPriorConfidence]

getResults (PageItem aSpecItem) : Array

Gets all the verification result objects in an array where the given spectrum item was involved. (Undefined if no results were found).


List of parameters:

getResults (Molecule aMolecule) : Array

Gets all the verification result objects in an array where the given molecule was involved. (Undefined if no results were found).


List of parameters:

getResults () : Array

Gets all the verification result objects in an array for the current document. (Undefined if no results were found).

getResults (PageItem aSpecItem, Molecule aMolecule) : Array

Gets all the verification result objects in an array where the given spectrum item and molecule were involved. (Undefined if no results were found).


List of parameters:

modifyPriorConfidence ( aPriorConfidence, [Number aId])

Modify the prior confidence of a result if aId is specified or of all the results in the document if the id is undefined.


List of parameters:
  • aPriorConfidence

    - The new prior confidence. It must be a number between 0 and 1.

  • Number aId [optional]

    - A verification result id.

moleculeIdFromResult (VerificationResult aResult) : String

Gets a string containing a molecule identifier for the molecule used to get the given result


List of parameters:

moleculeIdFromResult (VerificationResult aResult) : String

Gets a string containing a molecule identifier for the molecule used to get the given result


List of parameters:

moleculeIdFromResult (VerificationResult aResult) : String

Gets a string containing a molecule identifier for the molecule used to get the given result


List of parameters:

moleculeIdFromResult (VerificationResult aResult) : String

Gets a string containing a molecule identifier for the molecule used to get the given result


List of parameters:

ASVPlugin.scoreToColor ( aScore, [ aPositiveThreshold], [ aNegativeThreshold])

Returns the associated color for a given score


List of parameters:
  • aScore
  • aPositiveThreshold [optional]

    - Value to be interpreted as positive threshold. If not specified the plugin positive threshold will be used

  • aNegativeThreshold [optional]

    - Value to be interpreted as negative threshold. If not specified the plugin negative threshold will be used

spectraItemsFromResult (VerificationResult aResult) : Array

Gets all the spectral items used to get the given result as an array of page items.


List of parameters:

verify (Array aNMRGroup, Molecule aMolecule, [MassItem aMSItem], [Number aFlags], [Number aPriorConfidence]) : VerificationResult

Verifies a molecule structure against a group of NMR items and a mass item (optional) belonging to the same compound. Returns a verification result object (can be undefined in case of error).


List of parameters:



ASVSettings

The verification settings

Table of contents

  1. Properties

Properties

Name Type Comments
mass MassVerifySettings [read-only]
nmr NMRVerifySettings [read-only]

mass : MassVerifySettings [read-only]

nmr : NMRVerifySettings [read-only]




ASVWarning

A warning or message issued when running a verification

See also: VerificationResult.messages

Table of contents

  1. Properties

Properties

Name Type Comments
advice String [read-only]
context String [read-only]
description String [read-only]
hidden Boolean [read-only]
message String [read-only]
params Object [read-only]
type Number [read-only]

advice : String [read-only]

A warning advice on how to fix it. (Can contain HTML entities).

context : String [read-only]

The warning context. What originates the warning.

description : String [read-only]

The warning detailed description (Can contain HTML entities).

hidden : Boolean [read-only]

A boolean value telling if the user set the warning to be displayed or not.

message : String [read-only]

The warning short description.

params : Object [read-only]

An object whose properties are the parameters provided by the warning

type : Number [read-only]

A numeric value indicating the warning type




Atom

Properties

Name Type Comments
alias String
assignmentQuality Number [read-only]
assignmentStability Number [read-only]
charge Number
color String
elementSymbol String
isotope Number
nH Number
nHAll Number
number String
protonNotation Number
stereoNotation String [read-only]
text String
valence Number

alias : String

assignmentQuality : Number [read-only]

assignmentStability : Number [read-only]

Valid values: {Atom.AssignmentStability.Normal, Atom.AssignmentStability.Stable, Atom.AssignmentStability.Unknown}

charge : Number

color : String

Label color

Valid values: {"#RRGGBB", "Color Keywords"}

elementSymbol : String

isotope : Number

nH : Number

nHAll : Number

number : String

protonNotation : Number

Proton notation to be used

Valid values: {Atom.AB, Atom.ALPHABETA, Atom.AXEQ, Atom.CISTRANS, Atom.QUOTES}

stereoNotation : String [read-only]

Stereo notation for the atom

text : String

valence : Number

Constructors

Atom (Atom aAtom)

Functions

Name Output Parameters
protonLabel String Number aIndex
toString String

protonLabel (Number aIndex) : String

Returns the proton label, according with the protonNotation. Example: ', '', cis, trans,...


List of parameters:
  • Number aIndex

    - Proton index

    Valid values: {1, 2, 3}

toString () : String

String representation of the object




AtomNMRAssignmentData

Table of contents

  1. Properties
  2. Example

Properties

Name Type Comments
atom Object
correlations Object
couplings Object
element String
shift Object|Number|Array

atom : Object

index
1-based atom index
h
undefined, a, b or c

correlations : Object

Keys
The names of the experiment correlations (HSQC, COSY, HMBC...)
Values
An array of objects decribing the correlated atom indexes (index,h)

couplings : Object

js
List of pairs (atom, value)
NOE
List of pairs (atom, value)
RDC
List of pairs (atom, value)
ambigJs
List of values

element : String

shift : Object|Number|Array

  • Number: Chemical shift
  • Object: An object with the following properties
    shift
    Chemical shift
    min
    When assigned to a range the minimum
    max
    When assigned to a range the maximum
    idTypes
    Array of objects, each one with two properties, "uuid" and type". uuid - When assigned to an integral/multiplet/peak the corresponding uuid. type - A string describing the type of assignment: "Integral", "Multiplet", "Peak" or "None".
  • Array: An array of either numbers or Objects as decribed above

Example:




AtomNMRPredictionData

Table of contents

  1. Properties
  2. Example

Properties

Name Type Comments
atom Object
js Array
shift Object|Number

atom : Object

Object with two properties: index, the 1-based index of the atom in the molecule and h which can take the values 'a', 'b', 'c' or can be undefined for explicit H or non H elements. When returning grouped elements is an array.

js : Array

Returns an array of objects. Each one of the objects has two properties "atom" and "j" with the same format of the PredictionData.atom and PredictionData.shift.

shift : Object|Number

If it's a number it's the predicted chemichal shift of the atom. When it's a object it has two properties, "value" and "error".

Example:




Attachment

Object to attach data to an mnova document

Properties

Name Type Comments
isEmpty Boolean
isText Boolean
size Number

isEmpty : Boolean

isText : Boolean

size : Number

Constructors

Attachment ()

Functions

Name Output Parameters
binaryDataAsFile Number String aPath
getMetaData Object
getMetaDataValue Variant String aName, Variant aDefaultValue
removeMetaDataValue String aName
setBinaryDataFromFile Number String aPath
setMetaData Object aObject
setMetaDataValue String aName, Variant aValue
setTextData Number String aText
setTextDataFromFile Number String aPath, String aCodec
textData String

binaryDataAsFile (String aPath) : Number

Writes the data in the attachment to the file as unformatted data. Returns the number of bytes actually written to the file.


List of parameters:
  • String aPath

getMetaData () : Object

Returns the meta data associated to this attachment in the form of an Object map

getMetaDataValue (String aName, Variant aDefaultValue) : Variant


List of parameters:
  • String aName
  • Variant aDefaultValue

removeMetaDataValue (String aName)


List of parameters:
  • String aName

setBinaryDataFromFile (String aPath) : Number

Set the attachment data to be the unformatted data in the file. Returns the new size of the attachment.


List of parameters:
  • String aPath

setMetaData (Object aObject)

Sets the meta data associated to this attachment


List of parameters:
  • Object aObject

setMetaDataValue (String aName, Variant aValue)


List of parameters:
  • String aName
  • Variant aValue

setTextData (String aText) : Number

Set the attachment data to be this text. Returns the new size.


List of parameters:
  • String aText

setTextDataFromFile (String aPath, String aCodec) : Number

Set the attachment data to be the text in the file. Returns the new size.


List of parameters:
  • String aPath
  • String aCodec

    - Codec to be used when reading the text from the file

textData () : String




AuditTrail

Table of contents

  1. Functions

Functions

Name Output Parameters
items Array [Array|String aItemIds]

items ([Array|String aItemIds]) : Array

Array of AuditTrailCommand


List of parameters:
  • Array|String aItemIds [optional]

    - A string or an array of strings corresponding to the itemIds for which we want to get the audit trail. If undefined the whole document audit trail is returned




AuditTrailCommand

Table of contents

  1. Properties

Properties

Name Type Comments
comment String
date Date [read-only]
hostName String [read-only]
itemId String [read-only]
mnovaName String [read-only]
name String [read-only]
osName String [read-only]
user String [read-only]
version String [read-only]

comment : String

date : Date [read-only]

hostName : String [read-only]

itemId : String [read-only]

mnovaName : String [read-only]

name : String [read-only]

osName : String [read-only]

user : String [read-only]

version : String [read-only]




AuditTrailItem

Table of contents

  1. Functions

Functions

Name Output Parameters
addCommand Object String aName, Function aDoFunction, Object aThisObject, Array aArguments
items Array

addCommand (String aName, Function aDoFunction, Object aThisObject, Array aArguments) : Object

Adds a new AuditTrailCommand to this item


List of parameters:
  • String aName

    - The command name

  • Function aDoFunction

    - A function that contains the code that modifies the item

  • Object aThisObject

    - The this object passed to the do-function. It can be null.

  • Array aArguments

    - An array of arguments. Each element can be an object with attributes "name", "value" and "oldValue" or a array of three elements. The values of the arguments (either the attributes "value" or the second value in the array) are passed to the aDoFunction as arguments.

items () : Array

Array of AuditTrailCommand belonging to this item




AutoTraceAlignmentParams

Table of contents

  1. Properties

Properties

Name Type Comments
applyToDAD Boolean
applyToTrace Boolean
offset Number
slope Number

applyToDAD : Boolean

Set to true if the offset must be applied to DAD traces

applyToTrace : Boolean

Set to true if the offset must be applied to non-DAD traces

offset : Number

The offset in min that traces must be shifted in order to be aligned with MS chromatograms

slope : Number

The slope to be applied in order to shift traces linearly. Valid values [0.5, 1.5]




BarCategoryAxis

Wrapper to Qt Charts QBarCategoryAxis

Table of contents

  1. Properties

Properties

Name Type Comments
alignment Number
categories Object
color String
count Number
gridLineColor String
gridVisible Boolean
labelsAngle Number
labelsColor String
labelsFont Object
labelsVisible Boolean
lineVisible Boolean
max Number
min Number
minorGridLineColor String
minorGridVisible Boolean
orientation Number
reverse Number
shadesBorderColor String
shadesColor String
shadesVisible Boolean
titleFont Object
titleText String
titleVisible Boolean
visible Boolean

alignment : Number

categories : Object

color : String

count : Number

gridLineColor : String

gridVisible : Boolean

labelsAngle : Number

labelsColor : String

labelsFont : Object

labelsVisible : Boolean

lineVisible : Boolean

max : Number

min : Number

minorGridLineColor : String

minorGridVisible : Boolean

orientation : Number

reverse : Number

shadesBorderColor : String

shadesColor : String

shadesVisible : Boolean

titleFont : Object

titleText : String

titleVisible : Boolean

visible : Boolean




BarSeries

Wrapper to Qt Charts QBarSeries

Table of contents

  1. Functions

Functions

Name Output Parameters
append aSet
attachAxis aAxis
barSets

append ( aSet)


List of parameters:

See also: QBarSeries::append

attachAxis ( aAxis)


List of parameters:

See also: QAbstractSeries::attachAxis

barSets ()

See also: QBarSeries::barSets

See also: BarSet




BarSet

Wrapper to Qt Charts QBarSet

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
borderColor String
color String
label String
labelColor String
labelFont Object

borderColor : String

color : String

label : String

labelColor : String

labelFont : Object

Functions

Name Output Parameters
append aSet

append ( aSet)


List of parameters:
  • aSet

See also: QBarSet::append




BaseSpectrum

A common ancestor for spectrum based items with general functionallities.

Inherited by: ChromatogramItem, ElViSSpectrum, Graph, MassItem, NMRSpectrum

Table of contents

  1. Functions

Functions

Name Output Parameters
mmToScale Object Object aPoint
plotAt String Object aPoint
scaleToMm Object Object aPoint

mmToScale (Object aPoint) : Object

Returns the value in current scale units for a provided point in page units. If the point is outside the current scale boundaries, undefined will be returned.


List of parameters:
  • Object aPoint

    - An object like {"x":1.0,"y":1.0} holding the horizontal and vertical position in page units to be converted.

plotAt (Object aPoint) : String

Returns the plot id items containing the provided point in page units. If the point not inside any plot boundaries, undefined will be returned.


List of parameters:
  • Object aPoint

    - An object like {"x":1.0,"y":1.0} holding the horizontal and vertical position in page units to be checked. This method is relevant for MassItem items.

    See also: MassItemPlot.id

scaleToMm (Object aPoint) : Object

Returns the value in page units for a provided point in current scale units. If the point is outside the current scale boundaries, undefined will be returned.


List of parameters:
  • Object aPoint

    - An object like {"x":1.0,"y":1.0} holding the horizontal and vertical position in the current scale units to be converted.




BinaryStream

The BinaryStream object provides serialization of binary data to a file

Properties

Name Type Comments
endianness Number
pos Number

endianness : Number

Gets/sets the serialization endianness

Valid values: {BinaryStream.eBig, BinaryStream.eLittle}

pos : Number

Gets/sets the file position corresponding to the current position of the stream. Returns -1 if an error occurs

Constructors

BinaryStream (File aIODevice)

Constructs a BinaryStream that operates on a File, a NetworkReply or a ByteArray

BinaryStream (BinaryStream aStream)

Constructs a BinaryStream that is a copy of aStream

BinaryStream (String aHexStr)

Constructs a BinaryStream that operates on aHexStr (see Qt's QByteArray::toHex)

  • String aHexStr

Functions

Name Output Parameters
atEnd Boolean
readBool
readBytes ByteArray Number aSize
readCString
readInt16
readInt32
readInt64
readInt8
readObj Object
readReal32
readReal64
readString
skip Number aSize
toString String
writeBool Boolean aValue
writeBytes String | ByteArray aValue, [Number aSize]
writeCString String aValue
writeInt16 Number aValue
writeInt32 Number aValue
writeInt64 Number aValue
writeInt8 Number aValue
writeObj Boolean aObj
writeReal32 Number aValue
writeReal64 Number aValue
writeString String aValue

atEnd () : Boolean

Returns true if there is no more data to be read from the BinaryStream

readBool ()

Reads a boolean from the stream

readBytes (Number aSize) : ByteArray

Reads aSize bytes from the stream.


List of parameters:
  • Number aSize

readCString ()

Reads the '\0'-terminated (C-like) string from the stream

readInt16 ()

Reads a signed 16-bit integer from the stream

readInt32 ()

Reads a signed 32-bit integer from the stream

readInt64 ()

Reads a signed 64-bit integer from the stream

readInt8 ()

Reads a signed byte from the stream

readObj () : Object

Reads a JS object from the stream and returns it

readReal32 ()

Reads a 32-bit real (float) from the stream

readReal64 ()

Reads a 64-bit real (double) from the stream

readString ()

Reads a String from the stream

skip (Number aSize)

Skips the aSize bytes in the stream


List of parameters:
  • Number aSize

toString () : String

writeBool (Boolean aValue)

Writes a boolean to the stream


List of parameters:
  • Boolean aValue

writeBytes (String | ByteArray aValue, [Number aSize])

Writes aSize bytes from aValue to the stream


List of parameters:
  • String | ByteArray aValue
  • Number aSize [optional]

writeCString (String aValue)

Writes the '\0'-terminated (C-like) string to the stream


List of parameters:
  • String aValue

writeInt16 (Number aValue)

Writes a signed 16-bit integer to the stream


List of parameters:
  • Number aValue

writeInt32 (Number aValue)

Writes a signed 32-bit integer to the stream


List of parameters:
  • Number aValue

writeInt64 (Number aValue)

Writes a signed 64-bit integer to the stream


List of parameters:
  • Number aValue

writeInt8 (Number aValue)

Writes a signed byte to the stream


List of parameters:
  • Number aValue

writeObj ( aObj) : Boolean

Write the JS object to the stream. To provide a custom serialization for an object, the object must have a default constructor, a constructorName property and two functions storeObj and loadObj that receives a BinaryStream as parameter.


List of parameters:
  • aObj

writeReal32 (Number aValue)

Writes a 32-bit real (float) to the stream


List of parameters:
  • Number aValue

writeReal64 (Number aValue)

Writes a 64-bit real (double) to the stream


List of parameters:
  • Number aValue

writeString (String aValue)

Writes a String to the stream


List of parameters:
  • String aValue



BlindRegion

Defines a region of the spectrum to not be processed

Properties

Name Type Comments
f1 Object
f2 Object
name String

f1 : Object

It has a from and to properties

f2 : Object

It has a from and to properties

name : String

Constructors

BlindRegion (Number aFrom, Number aTo)

  • Number aFrom
  • Number aTo

BlindRegion (Number aFrom1, Number aTo1, Number aFrom2, Number aTo2)

  • Number aFrom1
  • Number aTo1
  • Number aFrom2
  • Number aTo2

Functions

Name Output Parameters
exportList String Array aBlindRegionArray
importList Array String aXmlString
toString String

BlindRegion.exportList (Array aBlindRegionArray) : String

Export the blind region array to XML and returns the string


List of parameters:
  • Array aBlindRegionArray

BlindRegion.importList (String aXmlString) : Array

Parses the XML string and returns an array of blind regions


List of parameters:
  • String aXmlString

toString () : String




Bond

Enumerations

Name Type Values
BondStereo Number bsCisOrTrans, bsDown, bsEither, bsNone, bsUp
BondType Number btAny, btAromatic, btDouble, btDoubleOrAromatic, btSingle, btSingleOrAromatic, btSingleOrDouble, btTriple

Properties

Name Type Comments
atom1 Number
atom2 Number
bondStereo BondStereo
bondType BondType

atom1 : Number

atom2 : Number

bondStereo : BondStereo

bondType : BondType

Constructors

Bond (Bond aBond)

Functions

Name Output Parameters
toString String

toString () : String

String reperesentation of the object




ByteArray

Represents and array of bytes in memory. It can be used to read/write using a BinaryStream or a TextStream.

Properties

Name Type Comments
size Number

size : Number

Constructors

ByteArray (String aString, String aCodec = 'Latin1')

ByteArray (ByteArray aBytes)

  • ByteArray aBytes

Functions

Name Output Parameters
at Number Number aIndex
fromBase64 ByteArray ByteArray aBase64Array
fromHex ByteArray ByteArray aHexArray
toBase64 ByteArray
toHex ByteArray
toString String String aCodec = 'Latin1'

at (Number aIndex) : Number


List of parameters:
  • Number aIndex

ByteArray.fromBase64 (ByteArray aBase64Array) : ByteArray


List of parameters:
  • ByteArray aBase64Array

ByteArray.fromHex (ByteArray aHexArray) : ByteArray


List of parameters:
  • ByteArray aHexArray

toBase64 () : ByteArray

toHex () : ByteArray

toString (String aCodec = 'Latin1') : String

IANA character set name or alias


List of parameters:
  • String aCodec



CanvasItemView

A widget to show and interact with a PageItem

Properties

Name Type Comments
currentMouseModeUuid String
defaultActionNames Array

currentMouseModeUuid : String

The current mouse mode UUID or {00000000-0000-0000-0000-000000000000} if the default mode is set.

defaultActionNames : Array

A strings array with all the default action names

Constructors

CanvasItemView ([Widget aParent])

  • Widget aParent [optional]

    - The parent widget or none if not defined

Functions

Name Output Parameters
activeDefaultAction Action String aName
registerMouseModeAction MouseModeAction [String aUuid]
setItem PageItem aItem

activeDefaultAction (String aName) : Action

Returns the active default action object for the specified action name


List of parameters:

registerMouseModeAction ([String aUuid]) : MouseModeAction

Register a custom mouse mode action


List of parameters:
  • String aUuid [optional]

    - The mode UUID. If not passed a random one will be used.

See also: MouseModeaction

setItem (PageItem aItem)

Sets the current item


List of parameters:



CategoryAxis

Wrapper to QCategoryAxis

Properties

Name Type Comments
labelFormat String
max Number
min Number
startValue Number
titleText String

labelFormat : String

The label format of the axis. The format string supports the following conversion specifiers, length modifiers, and flags provided by printf() in the standard C++ library: d, i, o, x, X, f, F, e, E, g, G, c.

max : Number

The maximum value on the axis.

min : Number

The minimum value on the axis.

startValue : Number

The low end of the first category on the axis.

titleText : String

The title of the axis. Empty by default.

Constructors

CategoryAxis ()

Functions

Name Output Parameters
append String aCategoryLabel, Number aCategoryEndValue

append (String aCategoryLabel, Number aCategoryEndValue)

Appends a new category to the axis with the label aCategoryLabel. A category label has to be unique. The value aCategoryEndValue specifies the high end limit of the category. It has to be greater than the high end limit of the previous category. Otherwise the method returns without adding a new category.


List of parameters:
  • String aCategoryLabel
  • Number aCategoryEndValue



Chart

Wrapper to Qt Charts QChart

Enumerations

Name Type Values
Alignment Number AlignBottom, AlignLeft, AlignRight, AlignTop

Properties

Name Type Comments
legend

legend :

See also: QChart::legend

Functions

Name Output Parameters
addAxis aAxis, aAlignment
addSeries aSerie
createDefaultAxis
removeAllSeries
removeSeries aSerie
setAxisX aAxis, aSerie
setAxisY aAxis, aSerie
setLegendMarkerVisibility aSeries, Boolean aIsVisible
toSvg ByteArray [Number aWidth], [Number aHeight]

addAxis ( aAxis, aAlignment)


List of parameters:

var axisY = new CategoryAxis();
chart.addAxis(axisX, Chart.AlignBottom);
			

See also: QChart::addAxis

addSeries ( aSerie)


List of parameters:
  • aSerie

See also: QChart::addSeries

createDefaultAxis ()

removeAllSeries ()

removeSeries ( aSerie)


List of parameters:
  • aSerie

See also: QChart::removeSeries

setAxisX ( aAxis, aSerie)


List of parameters:
  • aAxis
  • aSerie

See also: QChart::setAxisX

setAxisY ( aAxis, aSerie)


List of parameters:
  • aAxis
  • aSerie

See also: QChart::setAxisY

setLegendMarkerVisibility ( aSeries, Boolean aIsVisible)


List of parameters:
  • aSeries

    - The series you want to show/hide in the legend. It should be already present in the chart.

  • Boolean aIsVisible

toSvg ([Number aWidth], [Number aHeight]) : ByteArray

Returns a SVG that includes the whole Chart in the form of a ByteArray. If aWidth and aHeight are left blank, it will take the dimensions of the displayed Chart (if any).


List of parameters:
  • Number aWidth [optional]
  • Number aHeight [optional]



ChartView

Wrapper to Qt Charts QChartView

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
chart Chart

chart : Chart

See also: QChartView::chart

Functions

Name Output Parameters
setChart Chart aChart

setChart (Chart aChart)

Previous Chart will be deleted.


List of parameters:

See also: QChartView::setChart




CheckBox

Provides a checkbox with a text label

Properties

Name Type Comments
checked bool
enabled Boolean

checked : bool

Returns the check state

enabled : Boolean

True if the widget is enabled

Signals

Constructors

CheckBox ()

Functions

Name Output Parameters
setIcon String aFilePath, Number aWidth, Number aHeight
text String

setIcon (String aFilePath, Number aWidth, Number aHeight)

Changes the CheckBox icon and its dimensions


List of parameters:
  • String aFilePath
  • Number aWidth
  • Number aHeight

				
dialog.widgets.theCheckBox.setIcon("ricares:theImage.png", 64, 64);
			
			

text () : String

Returns the text of the check box




ChemometricsData

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
data Array
itemId String
itemInfos Array
options Object
regions Array

data : Array

itemId : String

itemInfos : Array

options : Object

regions : Array

Functions

Name Output Parameters
raiseDialog

raiseDialog ()




Chromatogram

A chromatogram object

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
autoPeakSettings Object
parameters Object [read-only]
peaks Array [read-only]
pointsNumber Number [read-only]
procParams ChromatogramProcParams [read-only]

autoPeakSettings : Object

The settings for the automatic peak detection process. Valid keys are:

  • AutoWindowSize: A boolean. If true, the automatic chromatographic peak detection process calculates the best window size for the input signal.
  • ManualWindowSize: An odd integer greater than 5. The window size used to calculate derivatives, if 'AutoWindowSize' is false.
  • Sensitivity: An integer in the range (0, 100). The higher it is the higher is the peak detection sensitivity.


        
chrom.activeItem().chromatogram().autoPeakSettings = 
  {
    "AutoWindowSize": false, 
    "ManualWindowSize": 7, 
    "Sensitivity": 50
  }
print(chrom.activeItem().chromatogram().autoPeakSettings)
			
      

parameters : Object [read-only]

An object containing the parameters shown in the Parameters Table

peaks : Array [read-only]

The list of the peaks of the chromatogram.

pointsNumber : Number [read-only]

The chromatogram number of points

procParams : ChromatogramProcParams [read-only]

The applied processing parameters

Functions

Name Output Parameters
addPeak Boolean Number aFromRT, Number aToRT
autoPeakPicking
clearPeaks
dataPoint Object Number aIndex
editPeak Boolean Number aId, ChromItem.PeakSpot isStart, Number aX, [Number aY]
fillPeak Boolean Number aId, String aColor
labelPeak Boolean Number aId, String aLabel
process ChromatogramProcParams aParams
removePeaks Boolean Number aPeakIndex
removePeaks Boolean Number aFromRT, Number aToRT
setDataPoint Number aIndex, Object aPoint
splitPeak Boolean Number aId, Number aX, [Number aY]

addPeak (Number aFromRT, Number aToRT) : Boolean

Adds a new peak Appends a chromatographic peak for a given RT range. Peak possition is automatilly calculated in the new peak. It returns false if range is wrong defined.


List of parameters:
  • Number aFromRT

    - The lower bound of the range.

  • Number aToRT

    - The upper bound of the range.

autoPeakPicking ()

Performs an automatic chromatographic peak detection.

clearPeaks ()

Clears all the chromatographic peaks.

dataPoint (Number aIndex) : Object


List of parameters:
  • Number aIndex

editPeak (Number aId, ChromItem.PeakSpot isStart, Number aX, [Number aY]) : Boolean

Edits the start/end position of a peak (only modifications that not modify the RT of the peak is allowed). It returns false if the resulting range does not contain the original retention time or if the peak index is wrong.


List of parameters:
  • Number aId

    - The index of the peak to be modified.

  • ChromItem.PeakSpot isStart

    - 'Start' indicates that the start point of the peak will be modified. 'End' indicates the end point.

  • Number aX

    - The X position of the splitting point.

  • Number aY [optional]

    - The Y position of the splitting point.

fillPeak (Number aId, String aColor) : Boolean

Sets a chromatographic peak fill color. It returns false if the peak index is wrong.


List of parameters:
  • Number aId

    - The index of the peak to be modified.

  • String aColor

    - A color name in the format '#rrggbb' or '#aarrggbb'

labelPeak (Number aId, String aLabel) : Boolean

Set the label of a peak. It returns false if the peak index is wrong.


List of parameters:
  • Number aId

    - The index of the peak to be modified.

  • String aLabel

    - The label to set.

process (ChromatogramProcParams aParams)


List of parameters:

removePeaks (Number aPeakIndex) : Boolean

Removes a peak by index. It returns false if the peak index is wrong.


List of parameters:
  • Number aPeakIndex

    - The index of the peak to be modified.

removePeaks (Number aFromRT, Number aToRT) : Boolean

Removes all peaks within a given RT range. It returns false if the range is wrong defined.


List of parameters:
  • Number aFromRT

    - The lower bound of the range.

  • Number aToRT

    - The upper bound of the range.

setDataPoint (Number aIndex, Object aPoint)


List of parameters:
  • Number aIndex
  • Object aPoint

splitPeak (Number aId, Number aX, [Number aY]) : Boolean

Splits a peak. The RT of the new peaks is automatically calculated. It returns false if the split position is out of the original peak range or if the peak index is wrong.


List of parameters:
  • Number aId

    - The index of the peak to be modified.

  • Number aX

    - The X position of the splitting point.

  • Number aY [optional]

    - The Y position of the splitting point.




ChromatogramItem

A chromatogram item object

Inherits PageItem

Enumerations

Name Type Values
PeakSpot Number End, Start

Properties

Name Type Comments
activeChromatogramIndex Number
count Number [read-only]
properties ChromPlotProperties

activeChromatogramIndex : Number

The index of the active chromatogram. An integer value from 0 to ChromatogramItem.count -1

count : Number [read-only]

Returns the number of chromatograms contained in this item

properties : ChromPlotProperties

The item graphical properties (background, grid, axes, peaks, etc)

Constructors

ChromatogramItem (ChromatogramItem aItem)

  • ChromatogramItem aItem

Functions

Name Output Parameters
appendChromatogram ChromatogramItem aOtherChromItem
chromatogram Chromatogram [Number aIndex]
removeChromatogram Boolean Number aIndex

appendChromatogram (ChromatogramItem aOtherChromItem)

Appends the chromatograms from another ChromatogramItem to this.


List of parameters:

chromatogram ([Number aIndex]) : Chromatogram

Get a chromatogram object


List of parameters:
  • Number aIndex [optional]

    - An integer value from 0 to ChromatogramItem.count -1. The index of the chromatogram to get. If omitted, the active one is returned.

removeChromatogram (Number aIndex) : Boolean

Removes the chromatogram for index aIndex. Returs true if it has succeeded.


List of parameters:
  • Number aIndex

    - The chromatogram index to delete




ChromatogramProcParams

Table of contents

  1. Properties

Properties

Name Type Comments
normalization ChromNormalizationParams
timeShift ChromTimeShiftParams

normalization : ChromNormalizationParams




ChromNormalizationParams

Table of contents

  1. Properties

Properties

Name Type Comments
apply Boolean
factor Number

apply : Boolean

factor : Number




ChromPlotAxesProps

An object to set and get the chromatogram item plot axes properties

Inherits Plot1DAxesProps

Table of contents

  1. Properties

Properties

Name Type Comments
stacked PlotStackedAxisProps

The stacked axis properties




ChromPlotProperties

An object to set and get the chromatogram item plot properties

Table of contents

  1. Properties
  2. Example

Properties

Name Type Comments
axes ChromPlotAxesProps
background PlotBackgroundProps
grid PlotGridProps
line Plot1DLineProps
peaks PlotChromPeaksProps
title PlotTitleProps

The plot axes properties

background : PlotBackgroundProps

The plot background properties

The plot grid properties

The plot line properties

The plot peaks properties

The plot title properties

Example:




ChromPlugin

The Chromatography plug-in object

Table of contents

  1. Constructors
  2. Functions

Constructors

ChromPlugin (ChromPlugin aChromPlugin)

Functions

Name Output Parameters
activeItem ChromatogramItem
loadParametersCustomization Boolean String aFileName, [String aFileFormat]

activeItem () : ChromatogramItem

Returns the active chromatogram item

loadParametersCustomization (String aFileName, [String aFileFormat]) : Boolean

Loads a parameter customization file associated to the file format and sets it as default.


List of parameters:
  • String aFileName
  • String aFileFormat [optional]



ChromTimeShiftParams

Table of contents

  1. Properties

Properties

Name Type Comments
apply Boolean
offset Number

apply : Boolean

offset : Number




Clipboard

Object that provides access to the system clipboard. Wrapper to QClipboard

See also: Application.clipboard

Properties

Name Type Comments
formats Array
hasHtml Boolean
hasPixmap Boolen
hasText Boolean
hasUrls Boolean
html String
pixmap Pixmap
text String
urls Array

formats : Array

hasHtml : Boolean

hasPixmap : Boolen

hasText : Boolean

hasUrls : Boolean

html : String

pixmap : Pixmap

text : String

urls : Array

Functions

Name Output Parameters
data ByteArray String aMimeType
setData String aMimeType, ByteArray aData

data (String aMimeType) : ByteArray

Returns the data stored in the clipboard in the format described by the MIME type specified by aMimeType.


List of parameters:
  • String aMimeType

See also: ByteArray

setData (String aMimeType, ByteArray aData)

Sets the data associated with the MIME type given by aMimeType to the specified aData.


List of parameters:
  • String aMimeType
  • ByteArray aData

Example:




ColorDialog

Table of contents

  1. Functions

Functions

Name Output Parameters
getColor String String aInitialColor, Object aParent, String aTitle, [Number aOptions]

ColorDialog.getColor (String aInitialColor, Object aParent, String aTitle, [Number aOptions]) : String

Shows a Color Dialog and returns the selected color as a string or undefined if canceled.


List of parameters:
  • String aInitialColor
  • Object aParent
  • String aTitle
  • Number aOptions [optional]

    - This argument allows you to customize the dialog

    See also: ColorDialogOptions




ComboBox

Provides a popup list

Properties

Name Type Comments
count Number
currentIndex Number
currentText String
items Array

count : Number

Number of items

currentIndex : Number

Current index

currentText : String

Text in the current index

items : Array

List of items

Signals

Functions

Name Output Parameters
addItem String aItemName
clear

addItem (String aItemName)

Adds items to the combo box


List of parameters:
  • String aItemName

clear ()

Removes the items of the combo box




CSPFilterOptions

Enumerations

Name Type Values
CSPMaxMedianFactor Number Q1, Q2, Q3
CSPMaxMode Number CSPMaxMean, CSPMaxMedian

Properties

Name Type Comments
cspMaxFilterMethod CSPMaxMode
cspMaxMeanThreshold Number
cspMaxMedianThreshold CSPMaxMedianFactor
disableInvalidKds Number
filterByCspMax Boolean
filterByKdAbsoluteValue Boolean
filterByKdRelativeError Boolean
kdRelativeErrorThreshold Number

cspMaxFilterMethod : CSPMaxMode

cspMaxMeanThreshold : Number

cspMaxMedianThreshold : CSPMaxMedianFactor

disableInvalidKds : Number

Disable series with resulting negative Kd or with σ(Kd) > Kd

filterByCspMax : Boolean

Disables series based on its maximum CSP

filterByKdAbsoluteValue : Boolean

Disables series with Kd bigger than the maximum concentration of ligand

filterByKdRelativeError : Boolean

Disables series based on the ratio σ(Kd)/Kd

kdRelativeErrorThreshold : Number

Constructors

CSPFilterOptions ()

Constructs an empty object. By default only invalid Kds are removed from the calculation




CSPResult

An Object to represent a Chemical Shift Perturbation result.

Enumerations

Name Type Values
RecalculateMedianFactor Number Q1, Q2, Q3
RecalculateMode Number AutoAll, AutoMean, AutoMedian

Properties

Name Type Comments
itemId String [read-only]
kd Number [read-only]
kdStdDev Number [read-only]
peakSeries Array
reactionProperties Array
settings Object
title String
uuid String [read-only]

itemId : String [read-only]

Linked NMR Item id

kd : Number [read-only]

kdStdDev : Number [read-only]

peakSeries : Array

Array containing the peak serie objects used to calculate the Kd

reactionProperties : Array

Array containing the Pt, Lt and Pt/Lt values for each spectrum in the reaction

settings : Object

Settings object

title : String

Title of the result

uuid : String [read-only]

Constructors

CSPResult ()

Constructs a CSP Result with a specific UUID. If the UUID is not a valid UUID of a CSP result in the document this object is invalid

Functions

Name Output Parameters
addPeakSerie Object aPeakPos
findResultById String aID
getAllResults
isValid
recalculateKd CSPFilterOptions aOpts

addPeakSerie (Object aPeakPos)


List of parameters:
  • Object aPeakPos

    - Adds a peak serie based on the position aPeakPos in the reference spectra

CSPResult.findResultById (String aID)

Returns the CSP Result with UUID aID or undefined if it does not exists


List of parameters:
  • String aID

    - UUID of the CSP Result

CSPResult.getAllResults ()

Returns all the CSPresult objects in the document

isValid ()

recalculateKd (CSPFilterOptions aOpts)

Recalculates the kd using the specified peak serie selection algorithm


List of parameters:
  • CSPFilterOptions aOpts

See also: CSPFilterOptions




CSVNMRConverter

CSV NMR Converter

Properties

Name Type Comments
endingPointPpm Number
lineFirstValue String
lineLastValue String
numberOfPoints Number
ppmPrecision Number
startingPointPpm Number
valuePrecision Number
valueSeparator String

endingPointPpm : Number

PPM of the last point to be written.

lineFirstValue : String

String that will appear at the beginning of each line.

lineLastValue : String

String that will appear at the end of each line.

numberOfPoints : Number

Number of points whose ppm and intensities will be shown in the CSV.

ppmPrecision : Number

Decimal precision of the PPM values.

startingPointPpm : Number

PPM of the first point to be written.

valuePrecision : Number

Decimal precision of the intensity values.

valueSeparator : String

String for separating the different values.

Constructors

CSVNMRConverter ()

Functions

Name Output Parameters
exportItems NMRSpectrum aSpectrum, String aFilePath
setDefaultSettings

exportItems (NMRSpectrum aSpectrum, String aFilePath)

Exports the intensity information from aSpectrum to a CSV file in aFilePath.


List of parameters:

setDefaultSettings ()

Resets all settings to the ones set by default in Mnova.

Example:




CurvedArrow

Curved arrow page item

Inherits PageItem

Properties

Name Type Comments
endX Number
endY Number
startX Number
startY Number

endX : Number

endY : Number

startX : Number

startY : Number

Constructors

CurvedArrow (CurvedArrow aCurvedArrow)

Functions

Name Output Parameters
endHead Object
setEndHead Object aObject
setStartHead Object aObject
startHead Object
toString String

endHead () : Object

Returns an object with the curved arrow end head attributes

setEndHead (Object aObject)


List of parameters:
  • Object aObject

setStartHead (Object aObject)


List of parameters:
  • Object aObject

startHead () : Object

Returns an object with the curved arrow start head attributes

toString () : String




DBClient

Represents a database server client.

See also: DBPlugin.client, DBPlugin.createClient

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
connectionUrl DBUrl [read-only]
database String
host String [read-only]
name String [read-only]
port int [read-only]
serverProperties Object [read-only]
serverRevision Number [read-only]
serverVersion String [read-only]
user String [read-only]

connectionUrl : DBUrl [read-only]

The connection URL we are connected to, or an invalid DBUrl if not connected.

See also: connected, DBUrl

database : String

The name of the currently open database, or empty if none is currently open.


				
mainWindow.doAction("dbDatabaseOpen");
print(DBPlugin.client.database);
			
			

See also: connected, databases, host, openDatabase

host : String [read-only]

The name of MnDB server this client is connected to, or empty if not connected.

See also: connected, name

name : String [read-only]

The name of the computer this client is running on.

See also: host

port : int [read-only]

The port of the MnDB server which this client is connected to, or -1 if not connected.

See also: connected

serverProperties : Object [read-only]

Object containing properties of the server we are connected to, or an empty object if not connected.

See also: connected, serverProperty, serverRevision, serverVersion

serverRevision : Number [read-only]

The revision number of the server we are connected to, or -1 if not connected.

See also: connected, serverProperties, serverVersion

serverVersion : String [read-only]

The server version of the server we are connected to, or "" if not connected.

See also: connected, serverProperties, serverRevision

user : String [read-only]

The user name we are connected as, or empty if not connected.

See also: connected

Functions

Name Output Parameters
connect Boolean DBUrl aConnectionUrl
connect Boolean String aConnectionString
connect Boolean String aServer, int aPort, String aUser, String aPassword, [String aDatabase]
connected Boolean
createDatabase Boolean DBDefinition aDefinition
databases Array
definition DBDefinition [String aDatabaseName]
deleteDatabase Boolean String aDatabaseName
deleteItems int String aRecordRange, String aItemType, String aItemRange
deleteRecords int String aRecordRange
disconnect
openDatabase Boolean String aDatabaseName
saveRecord int int aRecordId, Array aItems
sendRequest String String aRequest
serverProperty Object String aPropertyName
toString String

connect (DBUrl aConnectionUrl) : Boolean

Connects to the specified server and optionally opens the specified database. Returns True on success and False on Failure.


List of parameters:
  • DBUrl aConnectionUrl

    - A DBUrl object describing the connection.


				
var db = DBPlugin.createClient();
var url = DBUrl("mndb://Test:database@localhost:5504/mydb")
db.connect(url)
if (db.connected())
	MessageBox.information("Connected as user 'Test' to database 'mydb' on server 'localhost'.");
else
	MessageBox.critical("Could not connect.");
db.disconnect();
			
			

See also: DBUrl

connect (String aConnectionString) : Boolean

Connects to the specified server and optionally opens the specified database. Returns True on success and False on Failure.


List of parameters:
  • String aConnectionString

    - A string in URL format describing the connection. Is is of the form: mndb://[username[:password]@]host[:port][/database].

    Examples:

    • mndb://Test:database@localhost:5504
    • mndb://fred:secret@myserver.mydomain.com:5504/mydatabase


				
var db = DBPlugin.createClient();
db.connect("mndb://Test:database@localhost:5504/mydb")
if (db.connected())
	MessageBox.information("Connected as user 'Test' to database 'mydb' on server 'localhost'.");
else
	MessageBox.critical("Could not connect.");
db.disconnect();
			
			

connect (String aServer, int aPort, String aUser, String aPassword, [String aDatabase]) : Boolean

Connects to the specified server and optionally opens the specified database. Returns True on success and False on Failure.


List of parameters:
  • String aServer

    - Host name or IP address of the server

  • int aPort

    - Port the server is listening on

  • String aUser

    - User name to send to the server

  • String aPassword

    - Password to send to the server

  • String aDatabase [optional]

    - Name of database to be opened


				
var db = DBPlugin.createClient();
db.connect("localhost", 5504, "test", "secret", "mydb");
if (db.connected())
	MessageBox.information("Connected as user 'test' to database 'mydb' on server 'localhost'.");
else
	MessageBox.critical("Could not connect.");
db.disconnect();
			
			

connected () : Boolean

Returns true if the connection to the server is open.

See also: connect, disconnect

createDatabase (DBDefinition aDefinition) : Boolean

Creates a new database on the server using the specified database definition. Returns True on success and False on Failure. Will throw an error if not connected to a server.


List of parameters:
  • DBDefinition aDefinition

    - Name and schema of the database to create


				
var db = DBPlugin.createClient();
var dbname = "test_1";
var dbschema = DBDefinition.defaultDefinition(dbname);
db.connect("localhost", 5504, "test", "secret");
if (!db.connected())
	MessageBox.critical("Could not connect.");
else if (!db.createDatabase(dbschema))
	print("Could not create database '" + dbname + "'.");
else
	print("Database '" + dbname + "' created successfully.");
db.disconnect();
			
			

See also: databases, DBDefinition

databases () : Array

Queries the server for the list of databases and returns the result.


				
var db = DBPlugin.createClient();
db.connect("localhost", 5504, "test", "secret");
if (!db.connected())
	MessageBox.critical("Could not connect.");
else
{
	var dbnames = db.databases();
	for( var i = 0; i < dbnames.length; i++ )
	{
		print("  Database " + (i+1) + ": "+ dbnames[i]);
	}
}
db.disconnect();
			
			

See also: createDatabase

definition ([String aDatabaseName]) : DBDefinition

Returns the DBDefinition object for the specified database. Will throw an error if not connected to a server.


List of parameters:
  • String aDatabaseName [optional]

    - The database name. If not given, the function will return the DBDefinition object for the currently open database.

See also: DBDefinition

deleteDatabase (String aDatabaseName) : Boolean

Permanently and irrevocably deletes a database from the server. Returns True on success and False on Failure. Will throw an error if not connected to a server.


List of parameters:
  • String aDatabaseName

    - Name of the database to delete forever.

See also: connect, databases

deleteItems (String aRecordRange, String aItemType, String aItemRange) : int

Deletes one or several DB items from the currently open Database. Returns +1 on successful deletion, 0 on specified items not found, -1 on error (not connected, invalid database, etc.).


List of parameters:
  • String aRecordRange

    - The record ids to be deleted. May be a single number (e.g. '5'), a list (e.g. '3,7,24'), a range (e.g. '7-10'), or a combination thereof (e.g. '1-3,4-6,11').

  • String aItemType

    - The type of the DB item to be deleted (Molecule, NMR Spectrum, Mass Spectrum, etc.)

  • String aItemRange

    - The item ids to be deleted. May be a single number (e.g. '5'), a list (e.g. '3,7,24'), a range (e.g. '7-10'), or a combination thereof (e.g. '1-3,4-6,11'). If aItemRange is 0, all items of the specified item type will be deleted.


				
// Database mydatabase must exist or deleteItems will return -1
var db = DBPlugin.createClient();
db.connect("localhost", 5504, "Test", "secret", "mydatabase");
print(db.deleteItems("1", "Molecule", "0"));             // Delete molecule from record 1
print(db.deleteItems("17", "NMR Spectrum", "2,3"));      // Delete NMR spectra 2 and 3 from record 17
print(db.deleteItems("1-5", "Mass Chromatogram", "0"));  // Delete all Mass Chromatograms from records 1-5
db.disconnect();
			
			

See also: database, deleteRecords, openDatabase

deleteRecords (String aRecordRange) : int

Deletes one or several records from the currently open Database. Returns +1 on successful deletion, 0 on specified record not found, -1 on error (not connected, invalid database, etc.).


List of parameters:
  • String aRecordRange

    - The record ids to be deleted. May be a single number (e.g. '5'), a list (e.g. '3,7,24'), a range (e.g. '7-10'), or a combination thereof (e.g. '1-3,4-6,11').


				
var db = DBPlugin.createClient();
db.connect("localhost", 5504, "Test", "secret", "mydatabase");
if (!db.connected())
        MessageBox.critical("Could not connect.");
print("Deleting record 18 from database '" + db.database + "'.")  // mydatabase
var result = db.deleteRecords(18);
print("Result: " + result);
db.disconnect();
			
			

See also: database, deleteItems, openDatabase

disconnect ()

Closes any open server connection.

See also: connect, connected

openDatabase (String aDatabaseName) : Boolean

Opens a database on the server. Returns True on success and False on Failure. Will throw an error if not connected to a server.


List of parameters:
  • String aDatabaseName

    - Name of the database to open


				
var db = DBPlugin.createClient();
var dbname = "test_1";
db.connect("localhost", 5504, "test", "secret");
if (!db.connected())
	MessageBox.critical("Could not connect.");
else if (!db.openDatabase(dbname))
	print("Could not open database '" + dbname + "'.");
else
	print("Now connected to database '" + dbname + "'.");
db.disconnect();
			
			

See also: connect, databases

saveRecord (int aRecordId, Array aItems) : int

Stores the given items in the database as a new record. Returns the id of the newly created record or -1 on error. This function does not perform any checks for duplicate items in the database.


List of parameters:
  • int aRecordId

    - The record number to store the items under or 0 for new record.

  • Array aItems

    - The items to store. Can be either an array of DBItem objects or an array of PageItem objects.

    See also: DBItem, PageItem


				
var db = DBPlugin.createClient();
db.connect("localhost", 5504, "test", "secret", "testdb");
if (!db.connected())
	MessageBox.critical("Could not connect to database testdb as user test.");
else {
	// Save all PageItems in document to a new record
	var items = new Array();
	var dw = mainWindow.activeDocument;
	for( var i = 0; i < dw.itemCount(); i++ )
		items.push(dw.item(i));
	print("Saving...");
	var cid = db.saveRecord(0, items);
	if (cid > 0)
		MessageBox.information("Saved " + items.length + " items under record id " + cid + ".")
	else
		MessageBox.critical("Error while saving.")
}
db.disconnect();
			
			

sendRequest (String aRequest) : String

Sends a raw request packet to the server and returns the server response. Will throw an error if not connected to a server.


List of parameters:
  • String aRequest

    - The request data.

serverProperty (String aPropertyName) : Object

Returns the value of the named server property, or undefined if the client is not connected.


List of parameters:
  • String aPropertyName

    - Property name. Valid values are: DB_ENGINE, PRODUCT_BUILD, PRODUCT_NAME.


				
print(DBPlugin.client.connected() ? "Connected to " + DBPlugin.client.serverProperty("PRODUCT_NAME") : " Not connected.");
			
			

See also: connected, serverProperties

toString () : String

Returns a string representation of this object.




DBDefinition

Holds meta information about a database.

See also: DBClient.createDatabase

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
clientVersion String [read-only]
created String [read-only]
creator String [read-only]
name String
records Int [read-only]
serverVersion String [read-only]
version String

clientVersion : String [read-only]

Version of the Mnova client used to create the database.

created : String [read-only]

Date/Time of database creation in ISO format.

creator : String [read-only]

User who created the database.

name : String

Name of the database

records : Int [read-only]

The highest used record id.

serverVersion : String [read-only]

Version of the MnServer software used to create the database.

version : String

Version of the database storage protocol specification. Used internally by the Mnova server.

Functions

Name Output Parameters
addField Boolean String aItemType, String aName, String aType, Number aSize = 0, String aContentDef, String aComment
addItemType Boolean String aName, String aType, String aComment
contentDef String String aItemType, String aFieldName
defaultDefinition DBDefinition [String aName = ""]
emptyDefinition DBDefinition [String aName = ""]
fields Array String aItemType
hasField Boolean String aItemType, String aName
hasItemType Boolean String aItemType
itemTypes Array
removeField Boolean String aItemType, String aName
removeItemType Boolean String aName
toString String
toXml String

addField (String aItemType, String aName, String aType, Number aSize = 0, String aContentDef, String aComment) : Boolean

Adds a new data field to this database definition object. Returns True on success and False on Failure.


List of parameters:
  • String aItemType

    - The name of the itemtype to which the given field should be added.

  • String aName

    - The name of the field to be added. Field names must be unique for any given database and item type.

  • String aType

    - The type of field to be added.

    Valid values: {"BINARY", "CHEMSTRC", "LINK", "MOLFORM", "MULTIPLETLIST1A", "NUMERIC", "PEAKLIST1A", "PEAKLIST2A", "SVGPICT", "TEXT"}

  • Number aSize

    - The field size. This will determine the maximum amount of data which can be stored in this field.

  • String aContentDef

    - The field content definition.

  • String aComment

    - A comment for this field which will be shown in the database info dialog.


				
// A database only for molecules:
var dbdef = DBDefinition.emptyDefinition("MyDatabase");
dbdef.addItemType("Molecule", "COMP", "");
dbdef.addField("Molecule", "Structure", "CHEMSTRC", 0, "=Molecule(item).getMolfile()", "The molecule structure.");
dbdef.addField("Molecule", "Formula", "MOLFORM", 0, "=Molecule(item).molecularFormula()", "The molecular formula.");
dbdef.addField("Molecule", "Weight", "NUMERIC", 0, "=Molecule(item).molecularWeight()", "The molecular weight.");
dbdef.addField("Molecule", "Svg", "SVGPICT", 0, "-SVG-", "An svg picture of the molecule.");
dbdef.addField("Molecule", "ID", "TEXT", 100, "=item.uuid", "A unique identifier for each molecule.");
			
			

See also: addItemType, hasField, removeField

addItemType (String aName, String aType, String aComment) : Boolean

Adds a new item type to this database definition object. Returns True on success and False on Failure.


List of parameters:
  • String aName

    - The name of the item type to be added. Item type names must be unique for any given database.

  • String aType

    - The item type to be added.

    Valid values: {"COMP", "GENERIC", "NMR"}

  • String aComment

    - A comment for this item type which will be shown in the database info dialog.

See also: addField, hasItemType, removeItemType

contentDef (String aItemType, String aFieldName) : String

Returns the field content definition for the given field.


List of parameters:
  • String aItemType

    - The name of the itemtype.

  • String aFieldName

    - The name of the field.


				
var dbdef = DBDefinition.defaultDefinition("MyDatabase");
var itemTypes = dbDef.itemTypes();
for (var i=0; i<itemTypes.length; i++)
{
	var fields = dbdef.fields(itemTypes[i]);
	for (var f=0; f<fields.length; f++)
	{
		print ("ItemType=" + itemTypes[i]);
		print ("Field name=" + fields[f]);
		print ("Content Def=" + dbdef.contentDef(itemTypes[i], fields[f]));
	}
}
			
			

See also: addField

defaultDefinition ([String aName = ""]) : DBDefinition

Returns a default database schema with the given database name.


List of parameters:
  • String aName [optional]

    - The database name.

See also: emptyDefinition

emptyDefinition ([String aName = ""]) : DBDefinition

Returns an empty database schema with the given database name.


List of parameters:
  • String aName [optional]

    - The database name.

See also: addField, addItemType, defaultDefinition

fields (String aItemType) : Array

Returns the field names this definition contains for the given item type.


List of parameters:
  • String aItemType

    - The name of the itemtype.

See also: addField, itemTypes

hasField (String aItemType, String aName) : Boolean

Returns true if this database defintion contains a field with the specified item type and field name.


List of parameters:
  • String aItemType

    - The name of the itemtype.

  • String aName

    - The name of the field.

See also: addField, hasItemType, removeField

hasItemType (String aItemType) : Boolean

Returns true if the database definition contains an item type with the specified name.


List of parameters:
  • String aItemType

    - The name of the item type.

See also: addItemType, hasField, removeItemType

itemTypes () : Array

Returns the item types this definition contains.

See also: addItemtype, fields, hasItemtype

removeField (String aItemType, String aName) : Boolean

Removes the specied field from this database definition. Returns True on success and False on Failure.


List of parameters:
  • String aItemType

    - The name of the itemtype from which the given field should be removed.

  • String aName

    - The name of the field to be removed.


				
// Dont store any preview pictures:
var dbdef = DBDefinition.defaultDefinition("MyDatabase");
dbdef.removeField("Molecule", "Preview");
dbdef.removeField("Spectrum", "Preview");
dbdef.removeField("MNmova", "Preview");
			
			

See also: addField, hasField, removeItemType

removeItemType (String aName) : Boolean

Removes the specied itemtype from this database definition. Returns True on success and False on Failure.


List of parameters:
  • String aName

    - The name of the item type to be removed.


				
// Dont store any molecules:
var dbdef = DBDefinition.defaultDefinition("MyDatabase");
dbdef.removeItemType("Molecule");
			
			

See also: addItemType, removeField

toString () : String

Returns a string representation of this object.

toXml () : String

Returns a representation of this object in XML format.




DBItem

Represents a database item.

Properties

Name Type Comments
type String

type : String

Item type, as in the database definition.

See also: DBDefinition.addItemType

Constructors

DBItem ()

Constructs an empty DBItem.

DBItem (String aType)

Constructs an empty DBItem of the given item type.

  • String aType

DBItem (String aType, Object aFields)

Constructs a DBItem of the given item type with the given item fields.

  • String aType
  • Object aFields

				
var dbitem = new DBItem("Molecule", { "Name": "Catechin", "Formula": "C15H14O6", "AtomCount": 21, "Mass": 290.08 });
print(dbitem);
			
			

DBItem (DBItem aItem)

Constructs a new DBItem with item type and fields fom the given item.

  • DBItem aItem

    - The item to copy.

Functions

Name Output Parameters
addField String aFieldName, Variant aValue
field Variant String aFieldName
fieldNames Array
hasField Boolean String aFieldName
removeField String aFieldName
setField String aFieldName, Variant aValue
toString String

addField (String aFieldName, Variant aValue)

Adds a field with the specified field name and value. This is a synonym for setField.


List of parameters:
  • String aFieldName

    - The field name.

  • Variant aValue

    - The field content.

See also: DBDefinition.addField, field, removeField

field (String aFieldName) : Variant

Returns the field contents for the given field name.


List of parameters:
  • String aFieldName

    - The field name.

See also: fieldNames, setField

fieldNames () : Array

Returns an array with the names of all fields.

See also: field, setField

hasField (String aFieldName) : Boolean

Returns True iff this DBItem object has a field with the given name.


List of parameters:
  • String aFieldName

    - The field name to check.

See also: field, setField

removeField (String aFieldName)

Removes the field with the given name from this DBItem.


List of parameters:
  • String aFieldName

    - The field name.

See also: DBDefinition.removeField, field, setField

setField (String aFieldName, Variant aValue)

Sets the contents for the specified field to the specified value.


List of parameters:
  • String aFieldName

    - The field name.

  • Variant aValue

    - The field content.


				
var dbitem = new DBItem("Molecule");
dbitem.setField("Name", "Catechin");
dbitem.setField("Formula", "C15H14O6");
dbitem.setField("AtomCount", 21);
dbitem.setField("Mass", 290.08);
print(dbitem);
			
			

See also: DBDefinition.addField, field, removeField

toString () : String

Returns a string representation of this object.




DBPlugin

The global DBPlugin object

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
client DBClient [read-only]

client : DBClient [read-only]

The global DBClient object. Interaction with this object will be reflected in the GUI.


				
mainWindow.doAction("dbDatabaseOpen");
print(DBPlugin.client.database);
			
			

See also: createClient, DBClient

Functions

Name Output Parameters
addRecord int DBClient aClient, Array aItems
createBrowser Array aRecords, [String aContext]
createClient DBClient
getRecord DBRecord DBClient aClient, int aRecordId, [Boolean aPaste = true]
getRecordItem DBItem DBClient aClient, int aRecordId, String aItemType, int aItemID, [Boolean aPaste = true], [int aPage]
getRecordItems Array DBClient aClient, Number aRecordId
search DBSearchHits DBClient aDBClient, String aQuery, [String aSearchType = "TEXT"], [String aItemType = ""], [String aFieldName = ""], [Number aMaxHits = 1000], [Number aMaxRecords = 100], [Number aMinHitQuality = 1000]
toString String

addRecord (DBClient aClient, Array aItems) : int [deprecated]

Use DBClient.saveRecord instead. Stores the given items in the database as a new record. Returns the id of the newly created record or -1 on error. This function does not perform any checks for duplicate items in the database.


List of parameters:
  • DBClient aClient

    - The database client where to store the items.

    See also: DBClient

  • Array aItems

    - The items to store. Can be either an array of DBItem objects or an array of PageItem objects.

    See also: DBItem, PageItem

See also: DBClient.saveRecord, getRecord

createBrowser (Array aRecords, [String aContext])

Creates a DBBrowser window for the given records.


List of parameters:
  • Array aRecords

    - The records to browse. An array of DBRecord objects containing the records to show.

  • String aContext [optional]

    - The usage context. This determines the starting view for the browser. Valid values are: "None", "Browse", "Record", "Search", and "Select".


				
var records = [];
for (var r = 1; r <= 3; r++) {
        print("Retrieving record {0} of 3...").format(r));
        record = DBPlugin.getRecord(DBPlugin.client, r, false);
        records.push(record);
}
DBPlugin.createBrowser(records);
			
			

See also: DBRecord, getRecord

createClient () : DBClient

Creates and returns a new DBClient object.

See also: client, DBClient

getRecord (DBClient aClient, int aRecordId, [Boolean aPaste = true]) : DBRecord

Retrieves the requested record from the database.


List of parameters:
  • DBClient aClient

    - The database client to use to retrieve the items.

    See also: DBClient

  • int aRecordId

    - The record ID as returned by addRecord().

  • Boolean aPaste [optional]

    - If true (the default), the items from the retrieved record are pasted into the current Mnova document. If false, nothing gets pasted into the document and only the DBRecord object is returned.


				
var db = DBPlugin.createClient();
db.connect("localhost", 5504, "test", "secret", "testdb");
if (!db.connected())
	MessageBox.critical("Could not connect to database testdb as user test.");
else {
	var dw = mainWindow.newDocument();
	var recid = 1;
        var paste = true;
	var record = DBPlugin.getRecord(db, recid, paste);
        MessageBox.information("Pasted " + dw.itemCount() + " items from record id " + recid + ".")
	db.disconnect();
}
			
			

See also: addRecord, DBRecord, getRecordItem

getRecordItem (DBClient aClient, int aRecordId, String aItemType, int aItemID, [Boolean aPaste = true], [int aPage]) : DBItem

Retrieve the requested item from the database.


List of parameters:
  • DBClient aClient

    - The database client to use to retrieve the items.

    See also: DBClient

  • int aRecordId

    - The record ID as returned by addRecord().

  • String aItemType

    - The item type of the requested item. Corresponds to the item type in the database definition (for eaxmple Molecule, NMR Spectrum, Mnova).

  • int aItemID

    - The number of the requested item in the record.

  • Boolean aPaste [optional]

    - If true (the default), the items from the retrieved record are pasted into the current Mnova document. If false, nothing gets pasted into the document and only the DBItem object is returned.

  • int aPage [optional]

    - The number of the page to paste the item to.


				
var db = DBPlugin.createClient();
db.connect("localhost", 5504, "test", "secret", "testdb");

# Get the molecule from record 1
var molitem = DBPlugin.getRecordItem(db, 1, "Molecule", 0, false);
print(molitem.field("Molucular Formula"));

# Get the first NMR spectrum from record 3 and paste into first page of document
var specitem = DBPlugin.getRecordItem(db, 3, "NMR Spectrum", 1, true, 1);

db.disconnect();
			
			

See also: DBItem, getRecord

getRecordItems (DBClient aClient, Number aRecordId) : Array [deprecated]

Use getRecord(client, record_id, false).items() instead. Retrieves the items from the given record in the database and returns them as an array of DBItem objects.


List of parameters:
  • DBClient aClient

    - The database client to use to retrieve the items.

    See also: DBClient

  • Number aRecordId

    - The record ID as returned by addRecord().

See also: addRecord

search (DBClient aDBClient, String aQuery, [String aSearchType = "TEXT"], [String aItemType = ""], [String aFieldName = ""], [Number aMaxHits = 1000], [Number aMaxRecords = 100], [Number aMinHitQuality = 1000]) : DBSearchHits

Executes a database search and returns the result as a DBSearchHits object.


List of parameters:
  • DBClient aDBClient

    - The database client object.

    See also: createClient

  • String aQuery

    - The search query.

  • String aSearchType [optional]

    - The type of the search to execute.

    Valid values: {"CHEMSTRC", "DATETIME", "MASSDATA", "MOLFORM", "MULTIPLETLIST1A", "NUMERIC", "PEAKLIST1A", "PEAKLIST2A", "TEXT"}

  • String aItemType [optional]

    - The type of items to search for. Must correspond to the name of an item type in the database definition (by default Molecule, Spectrum, or Mnova). If not specified, will search for all item types.

  • String aFieldName [optional]

    - The name of a database field to search through. Must correspond to the name of a field in the database definition. If not specified, will search through all fields whose type matches the aSearchType parameter.

  • Number aMaxHits [optional]

    - The maximum number of search hits which will be returned.

  • Number aMaxRecords [optional]

    - The maximum number of records which will be returned.

  • Number aMinHitQuality [optional]

    - The minimal score a search hit must have to be included in the results. Valid values range from 1 to 1000.


				
var db = DBPlugin.createClient();
db.connect("localhost", 5504, "test", "secret", "testdb");
if (!db.connected())
	MessageBox.critical("Could not connect to database testdb as user test.");
else {
	// Search for "-" in all text fields of all items, return max. 1000 hits:
	var hits = DBPlugin.search(db, "-");
	print (hits.length  + " hits found.");
	for( var h = 0; h < hits.length; h++ )
	{
		var hit = hits.at(h);
		print(" Hit " + h + ": Record=" + hit.recordId() + " Item=" + hit.itemId() + " Score=" + hit.score());
	}
	db.disconnect();
}
			
			

See also: DBSearchHits, getRecord

toString () : String

Returns a string representation of this object.




DBRecord

Represents a database record.

See also: DBPlugin.getRecord

Table of contents

  1. Functions

Functions

Name Output Parameters
id Number
items Array
toString String
url String

id () : Number

Returns the record id of this record.

items () : Array

Returns an array with the DBItems of this record.

See also: DBItem

toString () : String

Returns a string representation of this object.

url () : String

Returns the location identifier (URL) of this record.




DBSearchHit

Represents an entry in a list of database search results

See also: DBPlugin.search, DBSearchHits.at

Table of contents

  1. Functions

Functions

Name Output Parameters
itemId Number
recordId Number
score Number
toString String

itemId () : Number

Returns the item number of the search hit

recordId () : Number

Returns the record id for the search hit

score () : Number

Returns the score of the search hit. Higher numbers mean better matches

toString () : String




DBSearchHits

A list of database search results

See also: DBPlugin.search

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
count Number [read-only]
length Number [read-only]

count : Number [read-only]

The number of search results in the list.

length : Number [read-only]

A synonym for count.

See also: DBSearchHits.count

Functions

Name Output Parameters
at DBSearchHit Number aIndex

at (Number aIndex) : DBSearchHit

Gets a search hit at a specified index.


List of parameters:
  • Number aIndex

    - The index of the search hit in the list. From 0 to count - 1.




DBUrl

Represents a reference to database data in URL format. It is of the form

mndb://[username[:password]@]host[:port][/database[/recordid[/itemtypeid/itemid[/fieldid]]]]
Examples:
  • mndb://Test:database@localhost:5504
  • mndb://fred:secret@myserver.mydomain.com:5504/mydatabase
  • mndb://fred:secret@myserver.mydomain.com:5504/mydatabase/23
  • mndb://localhost:5504/mydatabase/23/1/0/55

Properties

Name Type Comments
database String
fieldId Number
host String
itemId Number
itemTypeId Number
password String
port Number
recordId Number
user String

database : String

Name of the database.

fieldId : Number

Database field id.

host : String

Host or IP adress of the MnDB server.

itemId : Number

Database item id.

itemTypeId : Number

Database item type identifier.

password : String

Password for the MnDB connection.

port : Number

Port the MnDB server is listening on.

recordId : Number

Database record id.

user : String

User name for the MnDB connection.

Constructors

DBUrl ()

Constructs an empty DBUrl.

DBUrl (String aUrl)

Constructs a DBUrl from the given string in URL form.

  • String aUrl

Functions

Name Output Parameters
setAuthority String aUser, String aPassword
toString String Boolean aIncludePassword = false

setAuthority (String aUser, String aPassword)

Set user and password fields in a single call.


List of parameters:
  • String aUser
  • String aPassword

toString (Boolean aIncludePassword = false) : String

Returns a string representation of this object.


List of parameters:
  • Boolean aIncludePassword

    - Whether to include passwords in the string. Defaults to false.




Dialog

Creates a dialog with Ok and Cancel buttons

Properties

Name Type Comments
cancelButtonText String
enabled Boolean
okButtonText String
title String

cancelButtonText : String

String in the Cancel button

enabled : Boolean

True if the widget is enabled

okButtonText : String

String in the Ok button

title : String

Title of the window

Constructors

Dialog ()

Functions

Name Output Parameters
add Widget aWidget
addSpace Number aSpace
exec Number

add (Widget aWidget)

Adds a Widget to Dialog


List of parameters:
  • Widget aWidget

addSpace (Number aSpace)

Adds space to the dialog


List of parameters:
  • Number aSpace

exec () : Number

Shows the dialog. Returns 1 if accepted 0 otherwise




Dir

The Dir object provides access to directory structures and their contents

Properties

Name Type Comments
absPath String
exists Boolean
name String

absPath : String

Returns the absolute path

exists : Boolean

Returns true if the directory exists

name : String

Returns the name of the directory

Constructors

Dir (String aDirPath)

Constructs a Dir pointing to the given directory path

  • String aDirPath

Dir (Dir aDir)

Constructs a copy of the aDir

Functions

Name Output Parameters
alphanumericPathsCompare Number String aPath1, String aPath2
appDataCommon String
appDataUser String
application String
canonicalPath String
canonicalPath String String aDirPath
cd Boolean String aDirName
cdUp Boolean
cleanDirPath String String aDirPath
convertSeparators String String aDirPath
copy Boolean Dir aSrcDir, Dir aDstDir
current String
drives Array
entryInfoList Array String aWildcard, Number aKind = 0, Number aSortFlags = 0
entryList Array String aWildcard, Number aKind = 0, Number aSortFlags = 0
entryListAdv Array String aPathWildcard, Number aDirsSortFlags = Dir.Name, Number aFilesSortFlags = Dir.Name
fileExists Boolean String aName
filePath String String aFileName
home String
mkdir Boolean String aDirName
mkpath Boolean String aDirPath
numericPathsCompare Number String aPath1, String aPath2
rename Boolean String aOldName, String aNewName
rmdir Boolean String aDirName
rmpath Boolean String aDirPath
root String
searchPaths String aPrefix
setCurrent Boolean String aDirPath
temp String
toString String

Dir.alphanumericPathsCompare (String aPath1, String aPath2) : Number

Compares aPath1 with aPath2 and returns an integer less than, equal to, or greater than zero if aPath1 is less than, equal to, or greater than aPath2. If a directory name in the paths is an alphanumeric string then the function compares, using natural sort order, alphanumeric values instead of strings.


List of parameters:
  • String aPath1
  • String aPath2

				
var samplesDir = new Dir("c:/samples")
var mayDatasets = samplesDir.entryListAdv("2010-05-??/*/pdata/1/1r")
mayDatasets.sort(Dir.numericPathsCompare)
			
			

Dir.appDataCommon () : String

Returns the OS specific, common for all users, application data directory name

See also: Dir.appDataUser

Dir.appDataUser () : String

Returns the OS specific user application data directory name

See also: Dir.appDataCommon

Dir.application () : String

Returns the absolute path of the application executable

canonicalPath () : String

Resolves symbolic links and removes redundant "." or ".." elements from this directory object's path. If the canonical path does not exist (normally due to dangling symbolic links) canonicalPath() returns an empty string.

Dir.canonicalPath (String aDirPath) : String

Resolves symbolic links and removes redundant "." or ".." elements from the path, aDirPath. If the canonical path does not exist (normally due to dangling symbolic links) canonicalPath() returns an empty string.


List of parameters:
  • String aDirPath

cd (String aDirName) : Boolean

Changes the Dir's directory to dirName


List of parameters:
  • String aDirName

cdUp () : Boolean

Changes directory by moving one directory up from the Dir's current directory

Dir.cleanDirPath (String aDirPath) : String

Removes all multiple directory separators "/" and resolves any "."s or ".."s found in the path, aDirPath


List of parameters:
  • String aDirPath

Dir.convertSeparators (String aDirPath) : String

Returns aDirPath with the '/' separators converted to separators that are appropriate for the underlying operating system


List of parameters:
  • String aDirPath

Dir.copy (Dir aSrcDir, Dir aDstDir) : Boolean

Recursively copies the source directory to the destination directory.


List of parameters:

Dir.current () : String

Returns the absolute path of the application's current directory

Dir.drives () : Array

Returns a list of the root directories on this system

entryInfoList (String aWildcard, Number aKind = 0, Number aSortFlags = 0) : Array

This function is equivalent to entryList but instead of returning an array of strings returns an array of FileInfo objects


List of parameters:
  • String aWildcard

    - Filter that understands * and ? wildcards

  • Number aKind

    - Filter option. Combination of the following flags

    Valid values: {Dir.AccessMask, Dir.All, Dir.Dirs, Dir.Drives, Dir.Executable, Dir.Files, Dir.Hidden, Dir.Modified, Dir.NoDotAndDotDot, Dir.NoSymLinks, Dir.Readable, Dir.RWEMask, Dir.System, Dir.TypeMask, Dir.Writable}

  • Number aSortFlags

    - Sort option. Combination of the following flags

    Valid values: {Dir.DirsFirst, Dir.IgnoreCase, Dir.Name, Dir.Reversed, Dir.Size, Dir.SortByMask, Dir.Time, Dir.Type, Dir.Unsorted}

See also: entryList, FileInfo

entryList (String aWildcard, Number aKind = 0, Number aSortFlags = 0) : Array

Returns a list of the names of all the files and directories in the directory, ordered according to the name and attribute filters


List of parameters:
  • String aWildcard

    - Filter that understands * and ? wildcards

  • Number aKind

    - Filter option. Combination of the following flags

    Valid values: {Dir.AccessMask, Dir.All, Dir.Dirs, Dir.Drives, Dir.Executable, Dir.Files, Dir.Hidden, Dir.Modified, Dir.NoSymLinks, Dir.Readable, Dir.RWEMask, Dir.System, Dir.TypeMask, Dir.Writable}

  • Number aSortFlags

    - Sort option. Combination of the following flags

    Valid values: {Dir.DirsFirst, Dir.IgnoreCase, Dir.Name, Dir.Reversed, Dir.Size, Dir.SortByMask, Dir.Time, Dir.Type, Dir.Unsorted}

entryListAdv (String aPathWildcard, Number aDirsSortFlags = Dir.Name, Number aFilesSortFlags = Dir.Name) : Array

Returns a list of the names of all the files in the directory matching to the specified aPathWildcard


List of parameters:
  • String aPathWildcard

    - Filter that understands * and ? wildcards and / path separator

  • Number aDirsSortFlags

    - Directories sort option. Combination of the following flags

    Valid values: {Dir.DirsFirst, Dir.IgnoreCase, Dir.Name, Dir.Reversed, Dir.Size, Dir.SortByMask, Dir.Time, Dir.Type, Dir.Unsorted}

  • Number aFilesSortFlags

    - Files sort option. Combination of the following flags

    Valid values: {Dir.DirsFirst, Dir.IgnoreCase, Dir.Name, Dir.Reversed, Dir.Size, Dir.SortByMask, Dir.Time, Dir.Type, Dir.Unsorted}


				
var samplesDir = new Dir("c:/samples")
var mayDatasets = samplesDir.entryListAdv("2010-05-??/*/pdata/1/1r")
			
			

fileExists (String aName) : Boolean

Returns true if the file or directory called aName exists.


List of parameters:
  • String aName

filePath (String aFileName) : String

Returns the path name of a file in the directory. Does not check if the file actually exists in the directory


List of parameters:
  • String aFileName

Dir.home () : String

Returns the absolute path of the user's home directory

mkdir (String aDirName) : Boolean

Creates a sub-directory specified by aDirName


List of parameters:
  • String aDirName

mkpath (String aDirPath) : Boolean

Creates the directory path aDirPath. The function will create all parent directories necessary to create the directory


List of parameters:
  • String aDirPath

Dir.numericPathsCompare (String aPath1, String aPath2) : Number

Compares aPath1 with aPath2 and returns an integer less than, equal to, or greater than zero if aPath1 is less than, equal to, or greater than aPath2. If a directory name in the paths is an integer number then the function compares integer values, instead of strings.


List of parameters:
  • String aPath1
  • String aPath2

				
var samplesDir = new Dir("c:/samples")
var mayDatasets = samplesDir.entryListAdv("2010-05-??/*/pdata/1/1r")
mayDatasets.sort(Dir.numericPathsCompare)
			
			

rename (String aOldName, String aNewName) : Boolean

Renames a file or directory from aOldName to aNewName, and returns true if successful; otherwise returns false.


List of parameters:
  • String aOldName
  • String aNewName

rmdir (String aDirName) : Boolean

Removes the directory specified by aDirName


List of parameters:
  • String aDirName

rmpath (String aDirPath) : Boolean

Removes the directory path aDirPath. The function will remove all parent directories in aDirPath, provided that they are empty


List of parameters:
  • String aDirPath

Dir.root () : String

Returns the absolute path of the root directory

Dir.searchPaths (String aPrefix)

Returns the search paths associated to aPrefix


List of parameters:
  • String aPrefix

Dir.setCurrent (String aDirPath) : Boolean

Sets the application's current working directory to aDirPath


List of parameters:
  • String aDirPath

Dir.temp () : String

Returns the absolute path of the system's temporary directory

toString () : String




Document

Document object

Properties

Name Type Comments
auditTrail AuditTrailItem
currentSignerIdentity Identity [read-only]
docItems Array [read-only]
documentAuditTrail AuditTrail
identities Array
isModified Boolean [read-only]
lastSignerIdentity Identity [read-only]
molTableItems Array [read-only]
name String [read-only]
orientation String
pageItems Array [read-only]
signatureValidationResult Number [read-only]
templateHistory Boolean
uuid String [read-only]

auditTrail : AuditTrailItem

currentSignerIdentity : Identity [read-only]

The current signer identity for this document: The one which will sign the document when saving

docItems : Array [read-only]

A list of items owned by the document itself (not by its pages). For example, molecules from the table of compounds. For experts only!

See also: pageItems

documentAuditTrail : AuditTrail

identities : Array

An array of Identity objects with all the document signers

isModified : Boolean [read-only]

Returns true if the document has unsaved changes, and false otherwise.

lastSignerIdentity : Identity [read-only]

The last signer identity for this document: The one which has signed the document the last time

molTableItems : Array [read-only]

A list of items from the table of compounds, in the same order as they are in the table.

name : String [read-only]

Returns the document name.

orientation : String

The orientation can be portrait, if the page's height is greater than its width; or landscape,if the page's width is greater than its height.

Valid values: {"Landscape", "Portrait"}

pageItems : Array [read-only]

A list of items owned by document's pages.

See also: docItems

signatureValidationResult : Number [read-only]

The result of the digital signature validation when the document was loaded

Valid values: {0: The signature is valid, 1: There is no signature, 2: The signature data is corrupted, 3: The signature is invalid, 4: An I/O error has occurred when validating the signature}

templateHistory : Boolean

Controls layout template document history filling in the GUI

uuid : String [read-only]

Returns document UUID.

Constructors

Document ()

Constructs a standalone empty document. The document won't be accesible to the user until MainWindow.addDocument is called.

See also: addDocument

See also: lockDocument

Document (String aPath)

Constructs a standalone document with the mnova document in aPath. The document won't be accesible to the user until MainWindow.addDocument is called.

  • String aPath

				
function createDocument()
{
	//creates empty document
	var doc = new Document();
	//or create a document from a File
	//var doc = new Document("/path/to/mnova/file");

	//imports data to the document
	serialization.importFile("/path/to/a/file/to/import", "", doc);

	//lock the document before running more tasks on it
	Application.lockDocument(doc);

	//mainWindow.activeDocument will always return doc in this block

	//... do the things to be done

	settings.save("/path/to/save/result.mnova", "mnova");
	//unlock the document when done
	Application.unlockDocument();

	//add the document to the MainWindow if we want to show the result to the user
	mainWindow.addDocument(doc);

	//or destroy the document if we don't want to show the result
	//doc.destroy();
}
			
			

See also: addDocument

See also: lockDocument

See also: importFile

Document (Document aDoc)

Functions

Name Output Parameters
addPage Number aIndex
applyTemplateDocument String aFileName, Object aOptions = undefined
attachmentNames Array
clonePages Array Array aPages
close
curPage Page
deleteItems PageItem | Array aPageItems
deletePages Array aPages
destroy
exportToPDF Boolean String aOutPath, Array|String|Number|Page aPages
getActiveItem
getActiveItem aType
getAttachment Attachment String aName
getItem PageItem String aUuid
getMolTableItem PageItem String aMoleculeID
getMolTableItem PageItem Number aIndex
getMolTableItemCount Number
importCompoundsTable Boolean Document aDocument
isValid Boolean
item PageItem Number aIndex, String aType
item PageItem Number aIndex
itemCount Number
itemCount Number String aType
itemsByName Array String aType1, ..., String aTypeN
movePages Number aIndex, Page | Array aPages
newPage Boolean atEnd
page Page Number String aPageId
pageCount Number
pageIndex Number Page aPage
pages Array
pagesIds Array
print
removeAttachment Boolean String aName
selectedMolTableItems Array
selectedPages Array
selection Array
setActiveItem PageItem aItem
setAttachment Boolean String aName, Attachment aAttachment
setCurPage Page Number String aPage
setCurPageIndex Number aPageIndex
setSelectedMolTableItems Array aItems
setSelectedPages Array aPages
setSelection Array aItems
update

addPage (Number aIndex)


List of parameters:
  • Number aIndex

applyTemplateDocument (String aFileName, Object aOptions = undefined)

Applies layout template document


List of parameters:
  • String aFileName

    - Layout template document filename

  • Object aOptions

    - The layout template options: {applyProcessing: Boolean, applyZoom: Boolean, applySinglePageTemplateToCurrentPage: Boolean, applySinglePageTemplateToAllPages: Boolean}.
    -- applyProcessing: apply the processing template of the layout item properties (only valid for NMR Spectrum)
    -- applyZoom: apply the zoom of the layout item properties (only valid for NMR Spectrum)
    -- applySinglePageTemplateToCurrentPage: apply the layout template (it should have only one page) only to current page
    -- applySinglePageTemplateToAllPages: apply the same layout template (it should have only one page) to all pages recursively
    When options applySinglePageTemplateToAllPages and applySinglePageTemplateToCurrentPage are both false, the behaviour is the default one: apply all the pages of the layout template to all the pages of the current document.


				
applyTemplateDocument('c:/MyTemplates/MyLayoutTemplate.mnova', {applyProcessing: true, applyZoom: true, applySinglePageTemplateToCurrentPage: false, applySinglePageTemplateToAllPages: false})
				
			

attachmentNames () : Array

Returns the list with the names of all the attachments in the document.

clonePages (Array aPages) : Array

Creates a copy of the pages sent as parameter and adds them to the document. Returns an array with the new pages.


List of parameters:
  • Array aPages

    - A page or an array of pages that can be specified with their Page objects, their index in the document or their uuid.

close ()

Closes the document window

curPage () : Page

Returns current page

See also: setCurPage, setCurPageIndex

Document.deleteItems (PageItem | Array aPageItems)

Delete the items


List of parameters:
  • PageItem | Array aPageItems

    - A page item or an array of page items

deletePages (Array aPages)

Delete an array of pages


List of parameters:
  • Array aPages

    - A page or an array of pages that can be specified with their Page objects, their index in the document or their uuid.

destroy ()

Destroys the underlying document object. If the document is in the Mnova document list this is equivalent to close.

exportToPDF (String aOutPath, Array|String|Number|Page aPages) : Boolean

Exports the document to PDF format. The pages will be printed following the order in the document.


List of parameters:
  • String aOutPath
  • Array|String|Number|Page aPages

    - It can be page number (zero based), a page uuid, a page object or an array of them

getActiveItem ()

Returns the active item in the document

See also: setActiveItem

getActiveItem ( aType)

Returns the active item in the document of a given type aType


List of parameters:
  • aType

See also: setActiveItem

getAttachment (String aName) : Attachment

Returns the attachment if exists or undefined.


List of parameters:
  • String aName

getItem (String aUuid) : PageItem

Returns the element with the ID aUuid from the document


List of parameters:
  • String aUuid

    - An element id as returned by PageItem.uuid

See also: item, PageItem

getMolTableItem (String aMoleculeID) : PageItem

Returns a molecule from the table of molecules with the given molecule ID


List of parameters:

getMolTableItem (Number aIndex) : PageItem

Returns a molecule from the table of molecules at the given index


List of parameters:
  • Number aIndex

    - A molecule index

getMolTableItemCount () : Number

Returns the number of molecules in the table of molecules

importCompoundsTable (Document aDocument) : Boolean

Imports all molecules present in the Compounds table of aDocument into the current document.


List of parameters:

isValid () : Boolean

item (Number aIndex, String aType) : PageItem

Returns the aIndex-th element of type aType in the document


List of parameters:
  • Number aIndex

    - Index of element to return

  • String aType

    - Element Type

    Valid values: {"Arrow", "CurvedArrow", "Ellipse", "ElViS spectrum", "Graph", "Image", "Layout Template", "Mass Spectrum", "Molecule", "NMR Spectrum", "OLE Object", "Polygon", "Rectangle", "Text"}

See also: itemCount

item (Number aIndex) : PageItem

Returns the element number aIndex in the document


List of parameters:
  • Number aIndex

See also: itemCount

itemCount () : Number

Number of elements in the document

itemCount (String aType) : Number

Number of elements of type aType in the document


List of parameters:
  • String aType

    - Element Type

    Valid values: {"Arrow", "CurvedArrow", "Ellipse", "ElViS spectrum", "Graph", "Image", "Layout Template", "Mass Spectrum", "Molecule", "NMR Spectrum", "OLE Object", "Polygon", "Rectangle", "Text"}

itemsByName (String aType1, ..., String aTypeN) : Array

Returns an array of page items of the specified types.


List of parameters:
  • String aType1
  • ...
  • String aTypeN

movePages (Number aIndex, Page | Array aPages)


List of parameters:
  • Number aIndex
  • Page | Array aPages

newPage (Boolean atEnd)

Creates a new page


List of parameters:
  • Boolean atEnd

page (Number String aPageId) : Page

Returns a page in the document.


List of parameters:
  • Number String aPageId

    - A page number or uuid

pageCount () : Number

Number of pages of the document

pageIndex (Page aPage) : Number

Returns index of aPage.


List of parameters:

pages () : Array

Returns all document pages.

pagesIds () : Array

Returns an array with all the page ids in the document

print ()

Prints the document using the defaults printer and printer settings

removeAttachment (String aName) : Boolean

Returns true if no error.


List of parameters:
  • String aName

selectedMolTableItems () : Array

Returns an array of selected items in the table of compounds

See also: setSelectedMolTableItems

selectedPages () : Array

Returns array of currently selected pages

See also: selection, setSelectedPages, setSelection

selection () : Array

Returns array of currently selected page items

setActiveItem (PageItem aItem)

Marks the aItem as active


List of parameters:
  • PageItem aItem

See also: getActiveItem

setAttachment (String aName, Attachment aAttachment) : Boolean

Returns true if no error.


List of parameters:

setCurPage (Page Number String aPage)

Sets current page to aPage


List of parameters:
  • Page Number String aPage

    - It can be either a Page object, a page index or a page uuid

See also: curPage, setCurPageIndex

setCurPageIndex (Number aPageIndex)

Sets current page index to aPageIndex


List of parameters:
  • Number aPageIndex

See also: curPage, setCurPage

setSelectedMolTableItems (Array aItems)

Marks the aItems as selected in the table of compounds


List of parameters:
  • Array aItems

See also: selectedMolTableItems

setSelectedPages (Array aPages)

Marks the aPages as selected.


List of parameters:
  • Array aPages

    - An array of Page objects, page indexes or page uuids

See also: selectedPages, selection, setSelection

setSelection (Array aItems)

Marks the aItems as selected


List of parameters:
  • Array aItems

update ()

Refresh the current page




DoubleSpinBox

Provides spinbox widget to select floating point values

Properties

Name Type Comments
decimals Number
enabled Boolean
maximum Number
minimum Number
prefix String
singleStep Number
suffix String
value Number

decimals : Number

Number of decimals shown in the spin box

enabled : Boolean

True if the widget is enabled

maximum : Number

Maximum allowed value

minimum : Number

Minimum allowed value

prefix : String

Prefix added to the number

singleStep : Number

Step value

suffix : String

Suffix added to the number

value : Number

Current value in the spin box

Signals

Constructors

DoubleSpinBox ()




DrawPlugin

Object to add text objects to the document

Properties

Name Type Comments
autoChildrenEnabled Boolean

autoChildrenEnabled : Boolean

Toggle if a item can be automatically set as child of another item when creating the item. By default is false and it does not preserve on application restarts

Constructors

DrawPlugin (DrawPlugin aDrawPlugin)

Functions

Name Output Parameters
arrow Arrow Number aStartX, Number aStartY, Number aEndX, Number aEndY, Boolean aShowStartHead, Boolean aShowEndHead
curvedArrow CurvedArrow Number aStartX, Number aStartY, Number aEndX, Number aEndY, Boolean aShowStartHead, Boolean aShowEndHead
ellipse Ellipse Number aLeft, Number aTop, Number aWidth, Number aHeight
ellipse Ellipse Number aWidth, Number aHeight
heavyAtomsCount Number
polygon Polygon Array aPoints
rectangle Rectangle Number aWidth, Number aHeight
rectangle Rectangle Number aLeft, Number aTop, Number aWidth, Number aHeight
svg ByteArray aSvgByteArray, String aType, String aSubType
text Text String aText, Boolean aIsHtml
text Text String aText, String aType, String aSubtype, Boolean aIsHtml, [Option aProps]
toPixmap Pixmap PageItem | Array | Page aObj, Number aDpi
toString String

arrow (Number aStartX, Number aStartY, Number aEndX, Number aEndY, Boolean aShowStartHead, Boolean aShowEndHead) : Arrow

Adds an arrow to the document


List of parameters:
  • Number aStartX

    - X coordinate of the starting point

  • Number aStartY

    - Y coordinate of the starting point

  • Number aEndX

    - X coordinate of the ending point

  • Number aEndY

    - Y coordinate of the ending point

  • Boolean aShowStartHead

    - Show start head

  • Boolean aShowEndHead

    - Show end head

curvedArrow (Number aStartX, Number aStartY, Number aEndX, Number aEndY, Boolean aShowStartHead, Boolean aShowEndHead) : CurvedArrow

Adds a curved arrow to the document


List of parameters:
  • Number aStartX

    - X coordinate of the starting point

  • Number aStartY

    - Y coordinate of the starting point

  • Number aEndX

    - X coordinate of the ending point

  • Number aEndY

    - Y coordinate of the ending point

  • Boolean aShowStartHead

    - Show start head

  • Boolean aShowEndHead

    - Show end head

ellipse (Number aLeft, Number aTop, Number aWidth, Number aHeight) : Ellipse

Adds an ellipse to the document


List of parameters:
  • Number aLeft

    - Left

  • Number aTop

    - Top

  • Number aWidth

    - Width

  • Number aHeight

    - Height

ellipse (Number aWidth, Number aHeight) : Ellipse

Adds an ellipse to the document


List of parameters:
  • Number aWidth

    - Width

  • Number aHeight

    - Height

heavyAtomsCount () : Number

Counts all the molecule atoms except the Hydrogens.

polygon (Array aPoints) : Polygon

Adds a polygon to the document


List of parameters:
  • Array aPoints

    - Points of the polygon in format [{x: x1, y: y1}, {x: x2, y: y2}, ..., {x: xN, y: yN}]

rectangle (Number aWidth, Number aHeight) : Rectangle

Adds a rectangle to the document


List of parameters:
  • Number aWidth

    - Width

  • Number aHeight

    - Height

rectangle (Number aLeft, Number aTop, Number aWidth, Number aHeight) : Rectangle

Adds a rectangle to the document


List of parameters:
  • Number aLeft

    - Left

  • Number aTop

    - Top

  • Number aWidth

    - Width

  • Number aHeight

    - Height

svg (ByteArray aSvgByteArray, String aType, String aSubType)

Pastes the SVG defined in aSvgByteArray to the current Mnova document.


List of parameters:
  • ByteArray aSvgByteArray

    - A ByteArray that contains the information of the SVG.

  • String aType
  • String aSubType

text (String aText, Boolean aIsHtml) : Text

Adds a text box to the document


List of parameters:
  • String aText

    - Text

  • Boolean aIsHtml

    - HTML text

text (String aText, String aType, String aSubtype, Boolean aIsHtml, [Option aProps]) : Text

Adds a text box to the document


List of parameters:
  • String aText

    - Text

  • String aType

    - Type

  • String aSubtype

    - Subtype

  • Boolean aIsHtml

    - HTML text

  • Option aProps [optional]

    - Report properties

toPixmap (PageItem | Array | Page aObj, Number aDpi) : Pixmap


List of parameters:
  • PageItem | Array | Page aObj
  • Number aDpi

toString () : String




ECHOS

Table of contents

  1. Functions

Functions

Name Output Parameters
run ECHOSMatrixEvaluationResult NMRSpectrum aNmrSpectrum, ECHOSOptions aOptions, String aTitle, Boolean aShowChemometricsWindow
runSimple ECHOSResult NMRSpectrum aNmrSpectrum, ECHOSOptions aOptions, String aTitle, Boolean aShowChemometricsWindow, Number aFirstSpectrumIndex, Number aSecondSpectrumIndex

ECHOS.run (NMRSpectrum aNmrSpectrum, ECHOSOptions aOptions, String aTitle, Boolean aShowChemometricsWindow) : ECHOSMatrixEvaluationResult

This function runs an ECHOS analysis on the NMR spectrum specified in the parameters. Important: if the stack of the spectrum contains three or more spectra, the result of this function is a object of type ECHOSMatrixEvaluationResult; in case that it contains only two spectra, the result will be of type ECHOSResult instead. If only one spectrum is present in the NMRSpectrum object, or the stack is 1D, or any of the parameters is wrong, it will return 'undefined'.


List of parameters:
  • NMRSpectrum aNmrSpectrum

    - A NMR Spectrum stack with two or more 2D spectra.

  • ECHOSOptions aOptions

    - An object containing the ECHOS settings.

  • String aTitle

    - A string with the title of the result.

  • Boolean aShowChemometricsWindow

    - If true, the Chemometrics window will be displayed at the end of the analysis, with the result of the analysis set as current.


			
var i, options, result;

function printResult(aResult) {
	"use strict";

	print("Result ID: " + aResult.id);
	print("Item ID: " + aResult.itemId);
	print("Label: " + aResult.label);
	print("Regression Line (Y-intercept): " + aResult.regressionLineAlpha);
	print("Regression Line (Slope): " + aResult.regressionLineBeta);
	print("Correlation coefficient: " + aResult.correlationCoefficient);
	print("");
}

options = new ECHOSOptions();
options.thresholdMode = ECHOSOptions.ThresholdMode.Automatic;

result = ECHOS.run(nmr.activeSpectrum(), options, "Result (Automatic Threshold)", true);
if (result.typeName === "ECHOSMatrixEvaluationResult") {
	for (i = 0; i < result.results.length; ++i) {
		printResult(result.results[i]);
	}
} else if (result.typeName === "ECHOSResult") {
	printResult(result);
}
			
			

ECHOS.runSimple (NMRSpectrum aNmrSpectrum, ECHOSOptions aOptions, String aTitle, Boolean aShowChemometricsWindow, Number aFirstSpectrumIndex, Number aSecondSpectrumIndex) : ECHOSResult

This function runs an ECHOS analysis on a single pair of 2D NMR spectra in the NMRSpectrum stack, specified by the indices aFirstSpectrumIndex and aSecondSpectrumIndex. If the indices or any of the parameters are wrong, it will return 'undefined'.


List of parameters:
  • NMRSpectrum aNmrSpectrum

    - A NMR Spectrum stack with two or more 2D spectra.

  • ECHOSOptions aOptions

    - An object containing the ECHOS settings.

  • String aTitle

    - A string with the title of the result.

  • Boolean aShowChemometricsWindow

    - If true, the Chemometrics window will be displayed at the end of the analysis, with the result of the analysis set as current.

  • Number aFirstSpectrumIndex

    - Index of the first spectrum in the stack used in the analysis.

  • Number aSecondSpectrumIndex

    - Index of the second spectrum in the stack used in the analysis.


var options = new ECHOSOptions();
options.thresholdMode = ECHOSOptions.ThresholdMode.Visual;
var result = ECHOS.runSimple(nmr.activeSpectrum(), options, "Result (Visual Threshold)", false, 0, 1);
			



ECHOSMatrixEvaluationResult

Table of contents

  1. Properties

Properties

Name Type Comments
id Uuid [read-only]
results Array [read-only]
title String [read-only]
typeName String [read-only]

id : Uuid [read-only]

The uuid of the result.

results : Array [read-only]

An Array of ECHOSResult containing all the results in the matrix evaluation.

title : String [read-only]

The title of the result.

typeName : String [read-only]

A string with the value "ECHOSMatrixEvaluationResult".




ECHOSOptions

Enumerations

Name Type Values
ThresholdMode Number Automatic, Manual, Visual

Properties

Name Type Comments
thresholdMode ThresholdMode
thresholdValue Number

thresholdMode : ThresholdMode

The possible values are specified in the enumeration ThresholdMode. See the example.

thresholdValue : Number

The numerical value used as threshold (only applies if the Threshold Mode is set to Manual).

Constructors

ECHOSOptions ()

Creates a ECHOSOptions object with the settings saved in the registry.

Example:




ECHOSResult

Table of contents

  1. Properties

Properties

Name Type Comments
correlationCoefficient Number [read-only]
firstSpectrumIndex Number [read-only]
id Uuid [read-only]
itemId Uuid [read-only]
label String [read-only]
options ECHOSOptions [read-only]
regressionLineAlpha Number [read-only]
regressionLineBeta Number [read-only]
secondSpectrumIndex Number [read-only]
threshold Number [read-only]
typeName String [read-only]

correlationCoefficient : Number [read-only]

The Pearson correlation coefficient of the regression analysis.

firstSpectrumIndex : Number [read-only]

The index in the original stack of the first spectrum used in the analysis.

id : Uuid [read-only]

The uuid of the result.

itemId : Uuid [read-only]

The uuid of the item used for the analysis.

label : String [read-only]

The label of the result.

options : ECHOSOptions [read-only]

The settings used in the analysis.

regressionLineAlpha : Number [read-only]

The Y-intercept of the regression line.

regressionLineBeta : Number [read-only]

The slope of the regression line.

secondSpectrumIndex : Number [read-only]

The index in the original stack of the second spectrum used in the analysis.

threshold : Number [read-only]

typeName : String [read-only]

A string with the value "ECHOSResult".




Ellipse

Ellipse page item

Inherits PageItem

Table of contents

  1. Constructors
  2. Functions

Constructors

Ellipse (Ellipse aEllipse)

  • Ellipse aEllipse

Functions

Name Output Parameters
toString String

toString () : String




ElViSPlugin

The ElViS plug-in object

Table of contents

  1. Constructors
  2. Functions

Constructors

ElViSPlugin (ElViSPlugin aElViSPlugin)

Functions

Name Output Parameters
activeSpectrum ElViSSpectrum
createArrayedItem ElViSSpectrum Array aSpectra, [Boolean aStacked]
extractSpectrumFromArrayedItem ElViSSpectrum ElViSSpectrum aSpectrum, [Number aIndex]

activeSpectrum () : ElViSSpectrum

Returns the active spectrum

createArrayedItem (Array aSpectra, [Boolean aStacked]) : ElViSSpectrum

Creates an arrayed ElViSSpectrum from an array of ElViSSpectrum objects


List of parameters:
  • Array aSpectra

    - An array of ElViSSpectrum objects with at least two objects. Returns the created ElViSSpectrum

  • Boolean aStacked [optional]

    - If true (the default) the arrayed item will be stacked. If false it will be superimposed

extractSpectrumFromArrayedItem (ElViSSpectrum aSpectrum, [Number aIndex]) : ElViSSpectrum

Extracts a ElViSSpectrum object from an arrayed ElViSSpectrum


List of parameters:
  • ElViSSpectrum aSpectrum

    - The arrayed ElViSSpectrum item.

  • Number aIndex [optional]

    - The spectrum index (From 0 to specCount-1) to be extracted. By default the active one will be extracted.




ElViSSpectrum

ElViSSpectrum page item

Inherits PageItem

Properties

Name Type Comments
comment String
curSpecIndex Number
originalFormat String [read-only]
realFirstX Number [read-only]
realLastX Number [read-only]
realMax Number [read-only]
realMin Number [read-only]
specCount Number [read-only]
spectra Array [read-only]
title String [read-only]

comment : String

Spectrum comment.

curSpecIndex : Number

Controls active spectrum index of arrayed set. Index from zero to specCount-1.

originalFormat : String [read-only]

Returns a file format from which the spectrum was imported.

Valid values: {"ElViS CSV", "JCAMP-DX IR", "MNova", "Omnic SPA", "Thermo Galactic GRAMS IR", "Unknown"}

realFirstX : Number [read-only]

The first X value of the spectrum.

realLastX : Number [read-only]

The last X value of the spectrum.

realMax : Number [read-only]

The maximum [Y] value of the spectrum.

realMin : Number [read-only]

The minimum [Y] value of the spectrum.

specCount : Number [read-only]

Returns number of spectra for arrayed sets

spectra : Array [read-only]

If the spectrum is arrayed, contains an array with the comprised ElViSSpectrum objects.

title : String [read-only]

Spectrum title.

Constructors

ElViSSpectrum (ElViSSpectrum aSpectrum)

Functions

Name Output Parameters
activeSpectrumHasPeaks Boolean
appendSpectrum ElViSSpectrum aElViSSpectrum
count Number
dataPoint Object Number aIndex
forceStdPeaks Array
isValid Boolean
peaks Array
process Boolean procFile
removeSpectrum Boolean Number aSpecIndex
setDataPoint Number aIndex, Number aYValue
zoom

activeSpectrumHasPeaks () : Boolean

True if the spectrum has any peak.

appendSpectrum (ElViSSpectrum aElViSSpectrum)

Append all the spectra contained in ElViSSpectrum passed as argument


List of parameters:
  • ElViSSpectrum aElViSSpectrum

    - The ElViS spectrum item to append. NOTE: It only works with arrayed items.

count () : Number

Number of points in spectrum.

dataPoint (Number aIndex) : Object

If spectrum is not arrayed, returns X and Y values at aIndex.


List of parameters:
  • Number aIndex

forceStdPeaks () : Array

Only if the spectrum has no peaks, performs a standard peak picking and returns the resulting list of peaks.

isValid () : Boolean

Is a valid spectrum object.

peaks () : Array

Returns the list of peaks of the spectrum.

process ( procFile) : Boolean

Processes the spectrum using commands and parameters in procFile. In case of an stacked spectrum item, it applies the processing in procFile to all spectra in the stack.


List of parameters:
  • procFile

    - Processing file created and saved with the Mnova ElViS Dynamic Processing Template

removeSpectrum (Number aSpecIndex) : Boolean

Tries to remove the spectrum for the given index. Returns true if the item was removed and false otherwise (An arrayed item must have at least two spectra).


List of parameters:
  • Number aSpecIndex

    - A index from zero to specCount-1.

setDataPoint (Number aIndex, Number aYValue)

If spectrum is not arrayed, sets Y value at aIndex.


List of parameters:
  • Number aIndex
  • Number aYValue

zoom ()

Removes zooming applied, if any.




File

Properties

Name Type Comments
absDirPath String
exists Boolean
name String
size Number

absDirPath : String

Returns the absulute path of the file's parent directory

exists : Boolean

Returns true if the file exists

name : String

Retruns the file name

size : Number

Returns the file size

Constructors

File (String aFileName)

Constructs a new file object to represent the file with the given aFileName

  • String aFileName

File (File aFile)

Constructs a copy of the aFile

Functions

Name Output Parameters
absDirPath String String aFileName
close Boolean
copy Boolean String aFileName, String aNewFileName
create Boolean String aFileName
exists Boolean String aFileName
hash String String aAlgorithm
open bool Number aMode
permissions Number String aFileName
permissions Number
remove Boolean
remove Boolean String aFileName
rename Boolean String aOldFileName, String aNewFileName
setPermissions Boolean Number aPermissions
setPermissions Boolean String aFileName, Number aPermissions

File.absDirPath (String aFileName) : String

Returns the absulute path of the file's parent directory


List of parameters:
  • String aFileName

close () : Boolean

Closes the file and sets its open mode to File.NotOpen

File.copy (String aFileName, String aNewFileName) : Boolean

Copies the file aFileName to aNewFileName. Returns true if successful


List of parameters:
  • String aFileName
  • String aNewFileName

File.create (String aFileName) : Boolean

Creates the file specified by the given aFileName. Returns true if successful


List of parameters:
  • String aFileName

File.exists (String aFileName) : Boolean

Returns true if the aFileName exists


List of parameters:
  • String aFileName

hash (String aAlgorithm) : String

Returns the hash of a file in hex format from it's current position until the end


List of parameters:
  • String aAlgorithm

    Valid values: {"md4", "md5", "sh1", "sh2-224", "sh2-256", "sh2-384", "sh2-512", "sh3-224", "sh3-256", "sh3-384", "sh3-512"}

open (Number aMode) : bool

Opens the file using aMode mode, returning true if successful


List of parameters:
  • Number aMode

    - This enum is used to describe the mode in which a file is opened

    Valid values: {File.Append, File.NotOpen, File.ReadOnly, File.ReadWrite, File.WriteOnly}

File.permissions (String aFileName) : Number

Returns the complete OR-ed together combination of file's permissions.


List of parameters:
  • String aFileName

See also: File.setPermissions, permissions

permissions () : Number

Returns the complete OR-ed together combination of file's permissions.

See also: File.permissions, setPermissions

remove () : Boolean

Removes the file. Returns true if successful. The file has to be closed before it is removed

File.remove (String aFileName) : Boolean

Removes the file specified by the given aFileName. Returns true if successful


List of parameters:
  • String aFileName

File.rename (String aOldFileName, String aNewFileName) : Boolean

Renames the file aOldFileName to aNewFileName. Returns true if successful


List of parameters:
  • String aOldFileName
  • String aNewFileName

setPermissions (Number aPermissions) : Boolean

Sets the permissions for the file to the aPermissions specified. Returns true if successful, or false if the permissions cannot be modified.


List of parameters:
  • Number aPermissions

    - The complete OR-ed together combination of file's permissions

    Valid values: {File.ExeGroup, File.ExeOther, File.ExeOwner, File.ExeUser, File.ReadGroup, File.ReadOther, File.ReadOwner, File.ReadUser, File.WriteGroup, File.WriteOther, File.WriteOwner, File.WriteUser}

See also: File.setPermissions, permissions

File.setPermissions (String aFileName, Number aPermissions) : Boolean

Sets the permissions for the aFileName to the aPermissions specified. Returns true if successful, or false if the permissions cannot be modified.


List of parameters:
  • String aFileName
  • Number aPermissions

    - The complete OR-ed together combination of file's permissions

    Valid values: {File.ExeGroup, File.ExeOther, File.ExeOwner, File.ExeUser, File.ReadGroup, File.ReadOther, File.ReadOwner, File.ReadUser, File.WriteGroup, File.WriteOther, File.WriteOwner, File.WriteUser}

See also: File.permissions, setPermissions




FileDialog

The FileDialog object provides methods that allow users to select files or directories

Table of contents

  1. Functions

Functions

Name Output Parameters
getExistingDirectory String String aStartDirectory, String aDialogTitle
getOpenFileName String String aFileFilter, String aDialogTitle, String aWorkingDirectory
getOpenFileNames Array String aFileFilter, String aDialogTitle, String aWorkingDirectory
getSaveFileName String String aFileFilter, String aDialogTitle, String aWorkingDirectory, Number aFlag

FileDialog.getExistingDirectory (String aStartDirectory, String aDialogTitle) : String

The function creates a directory open dialog and returns an existing directory name selected by the user


List of parameters:
  • String aStartDirectory
  • String aDialogTitle

FileDialog.getOpenFileName (String aFileFilter, String aDialogTitle, String aWorkingDirectory) : String

The function creates a file open dialog and returns an existing file name selected by the user


List of parameters:
  • String aFileFilter
  • String aDialogTitle
  • String aWorkingDirectory

FileDialog.getOpenFileNames (String aFileFilter, String aDialogTitle, String aWorkingDirectory) : Array

The function creates a multiple file open dialog and returns one or more existing file names selected by the user


List of parameters:
  • String aFileFilter
  • String aDialogTitle
  • String aWorkingDirectory

FileDialog.getSaveFileName (String aFileFilter, String aDialogTitle, String aWorkingDirectory, Number aFlag) : String

The function creates a file save dialog and returns a file name selected by the user


List of parameters:
  • String aFileFilter
  • String aDialogTitle
  • String aWorkingDirectory
  • Number aFlag

    - This flag is used to select the options of use of the dialog. It stores a combination of the following values:

    Valid values: {"1" Only show directories in the file dialog. By default both files and directories are shown. (Valid only in the Directory file mode.), "10" Don't use the native file dialog. By default, the native file dialog is used., "2" Don't resolve symlinks in the file dialog. By default symlinks are resolved., "20" Indicates that the model is readonly., "4" Don't ask for confirmation if an existing file is selected. By default confirmation is requested., "40" Indicates if the file name filter details are hidden or not.}


				
var filename = FileDialog.getSaveFileName("*.txt","Choose file","c:\temp\file.txt",4)
//Don't ask for confirmation if an existing file is selected;
			
			



FileInfo

Object that contains information about a file or a directory

Properties

Name Type Comments
absoluteFilePath String
baseName String
completeBaseName String
created Date
exists Boolean
fileName String
isDir Boolean
isFile Boolean
lastModified Date
lastRead Date
path String
size Number
suffix String

absoluteFilePath : String

Returns an absolute path including the file name.

baseName : String

Returns the file name exclude the extension. The base name consists of all characters in the file up to (but not including) the first '.' character.

completeBaseName : String

Returns the complete base name of the file without the path. The complete base name consists of all characters in the file up to (but not including) the last '.' character.

created : Date

Returns the date and time when the file was created.

exists : Boolean

Returns true if the file exists; otherwise returns false.

fileName : String

Returns the name of the file, excluding the path.

isDir : Boolean

Returns true if it's a directory or a symbolic link to a directory; otherwise returns false.

isFile : Boolean

Returns true if it's a file or a symbolic link to a file; otherwise returns false.

lastModified : Date

Returns the date and time when the file was last modified.

lastRead : Date

Returns the date and time when the file was last read.

path : String

Returns the file's path. This doesn't include the file name.

size : Number

Returns the file size in bytes. If the file does not exist or cannot be fetched, 0 is returned.

suffix : String

Returns the extension of the file name.

Constructors

FileInfo (Array aPath)

Constructs an object that provide information about the specified path

  • Array aPath

    - Path to the file or directory




FileSystemWatcher

Object that emits signals whenever a directory or a file is modified

Properties

Name Type Comments
delay Number
filters Number
ignoreOld Boolean
maxDepth Number
maxNotifyDepth Boolean
maxOldDays Number
nameFilters Array
paths Array
timeOutMinutes Number
useFastHash Boolean
useMultiThread Boolean
useSystemBackend Boolean

delay : Number

When using directoryChangedExt, this is the number of miliseconds that the object will wait to check whether the modifications in a file have finished. By default 100ms.

See also: directoryChangedExt

filters : Number

When using directoryChangedExt, the kind of paths we are looking for

Valid values: {Dir.AccessMask, Dir.All, Dir.Dirs, Dir.Drives, Dir.Executable, Dir.Files, Dir.Hidden, Dir.Modified, Dir.NoSymLinks, Dir.Readable, Dir.RWEMask, Dir.System, Dir.TypeMask, Dir.Writable}

See also: Dir.entryList, directoryChangedExt

ignoreOld : Boolean

When using directoryChangedExt, if this value is set to true, all the files already present in the directory are ignored until they are modified. By default false.

See also: directoryChangedExt

maxDepth : Number

When using directoryChangedExt, this value controls how deep in the directory tree the watcher goes looking for modified files, 0 means looking only in the top directory. Big values could affect the performance. By default 2.

See also: directoryChangedExt

maxNotifyDepth : Boolean

Maximum depth in the file system for which notifications when adding directories to the cache are emitted. The bigger the number better information but poorest performance. 2 by default, -1 to disable notifications

maxOldDays : Number

Files or directories older than this amount of days will be ignored. By default is zero which means that all are taken into account.

nameFilters : Array

When using directoryChangedExt, this value specifies an array of wildcards to filter the modified paths.

See also: directoryChangedExt

paths : Array

Array of watched paths

timeOutMinutes : Number

If different from zero makes the FileSystemWatcher to periodically check for modifications in the watched directories even if the OS did not report any change. When the timeout is triggered all the files in all the watched directories are checked for changes, this can consume a lot of resources if there are a lot of directories and timeOutMinutes is small, anyway setting this to a reasonable not zero value and useSystemBackend to false makes the FileSystemWatcher to consume in general less system resources. It is 0 by default (disabled).

See also: useSystemBackend

useFastHash : Boolean

Only uses the modification date of the file when checking for changes. By default false.

useMultiThread : Boolean

Tries to use several thread when creating the file cache

useSystemBackend : Boolean

Rely on the OS to know when changes were made in the watched directories. If true, changes in the file system are inmediatly reported to the user. If you are working with network shared units you might use timeOutMinutes in addition to this because depending on the configuration the OS could not report the changes. Setting this to false and timeOutMinutes to a reasonable not zero value makes the FileSystemWatcher to consume in general less system resources. It is true by default.

See also: timeOutMinutes

Signals

Constructors

FileSystemWatcher (Array aPathArray)

Constructs an object that watches the specified paths

  • Array aPathArray

    - Array of paths

Functions

Name Output Parameters
addPath String aPath
removePath String aPath

addPath (String aPath)

Adds a path to be watched.


List of parameters:
  • String aPath

removePath (String aPath)

Removes a path from the watched list.


List of parameters:
  • String aPath



FitRegion

Enumerations

Name Type Values
Parameter Number Center, Height, Shape, Width

Properties

Name Type Comments
error Number
from Number
name String
peaks Array
to Number

error : Number

from : Number

name : String

peaks : Array

A peak id's (Strings) array

See also: Peak.id

to : Number

Constructors

FitRegion (FitRegion aFitRegion)

FitRegion (Number aFrom, Number aTo)

  • Number aFrom
  • Number aTo

FitRegion (Number aFrom, Number aTo, NMRSpectrum aSpc)

The peak list will be initialized using the peaks in the spectrum

Functions

Name Output Parameters
calculateError NMRSpectrum aSpectrum
isParameterLocked Boolean Number aParameter, String aPeakId
lockParameter Boolean aLock, Number aParameter, [String aPeakId]
toString String

calculateError (NMRSpectrum aSpectrum)

Updates the error field using the parameter to calculate it


List of parameters:
  • NMRSpectrum aSpectrum

isParameterLocked (Number aParameter, String aPeakId) : Boolean

Checks if a peak parameter is locked


List of parameters:
  • Number aParameter

    - Indicates which parameter to check

    See also: FitRegion.Parameter

  • String aPeakId

    - Indicates the peak to be checked.

    See also: Peak.id

lockParameter (Boolean aLock, Number aParameter, [String aPeakId])

Locks/Unlocks a peak parameter when fitting


List of parameters:
  • Boolean aLock

    - If true locks the parameter, if false unlocks it

  • Number aParameter

    - Indicates which parameter to lock

    See also: FitRegion.Parameter

  • String aPeakId [optional]

    - If provided, locks the parameter for that peak. If not provided locks the parameter in all the peaks

    See also: Peak.id

toString () : String




Font

Table of contents

  1. Properties

Properties

Name Type Comments
bold Boolean
family String
italic Boolean
size Number
strikeOut Boolean
underline Boolean

bold : Boolean

family : String

italic : Boolean

size : Number

strikeOut : Boolean

underline : Boolean




FontDialog

Table of contents

  1. Functions
  2. Example

Functions

Name Output Parameters
getFont Font Font aInitialFont, Widget aParent, String aTitle, [Number aOptions]
getFontFromWidget Font Widget aWidget
setFontToWidget Font aFont, Widget aWidget

FontDialog.getFont (Font aInitialFont, Widget aParent, String aTitle, [Number aOptions]) : Font

Shows a QFontDialog and returns the selected font as a Font object or undefined if canceled.


List of parameters:
  • Font aInitialFont

    - A Font object to set up as initial font of the dialog.

  • Widget aParent
  • String aTitle
  • Number aOptions [optional]

    - This argument allows you to customize the dialog. You can access the different values in the following way: for example, for QFontDialog::ScalableFonts, use FontDialog.ScalableFonts

    See also: FontDialogOptions

FontDialog.getFontFromWidget (Widget aWidget) : Font

Returns the font of aWidget


List of parameters:
  • Widget aWidget

FontDialog.setFontToWidget (Font aFont, Widget aWidget)

Sets aFont as main font of the aWidget.


List of parameters:
  • Font aFont
  • Widget aWidget

Example:




Graph

Graph Object

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
fitModels Array [read-only]
responseFactor GraphResponseFactor [read-only]
seriesCount Number [read-only]
specIds Array [read-only]
xData Array [read-only]
yData Array [read-only]
yModels Array [read-only]

fitModels : Array [read-only]

Array of GraphFitModel objects that describe the fit applied to each serie. It can have undefined values

See also: GraphFitModel

responseFactor : GraphResponseFactor [read-only]

Response factor of the graph

seriesCount : Number [read-only]

Number of series in the object

specIds : Array [read-only]

Array of ids of the spectrums represented in the graph

xData : Array [read-only]

Array of the x values

yData : Array [read-only]

Array of the y values

yModels : Array [read-only]

Array of GraphYModel objects that describe each one of the series

See also: GraphYModel

Functions

Name Output Parameters
fitSerieToBest aSerie
toXML String

fitSerieToBest ( aSerie)

Fit the the serie to the best possible fit (minimum MSE)


List of parameters:
  • aSerie

    - Serie number to be fitted

toXML () : String

Returns an XML representation of the object




GraphFitModel

Object that describes the fitting information of each serie of the graph

See also: Graph

Enumerations

Name Type Values
FitFunction Number FirstOrder, MonoExponential, SecondOrder, ZeroOrder

Properties

Name Type Comments
fitParams Object
fomula String
reportParams Object

fitParams : Object

Each one of the properties of this object is the value of one fitted parameter

fomula : String

Formula to be fitted

reportParams : Object

Each one of the properties of this object is the value of one a reported parameter, including its value and the formula used to calculate it

Constructors

GraphFitModel (Number aFitFunction)

GraphFitModel (String aFormula, Object aFitParams)

Functions

Name Output Parameters
toString String

toString () : String




GraphResponseFactor

Object that describes the response factor the graph

See also: Graph

Enumerations

Name Type Values
Mode Number Formula, InitialConcentration, PULCON

Properties

Name Type Comments
func Object
InitConcentration Number
mode Number
PULCON Number
units String

func : Object

Object that describes the equation to obtain the concentration. It has two properties. It has two parameters, formula is the equation and parameters an object in which the properties are the default value of the parameters

InitConcentration : Number

Initial Concetration

mode : Number

Mode of this response factor

See also: GraphResponseFactor.Mode

PULCON : Number

PULCON factor

units : String

Concetration Units

Constructors

GraphResponseFactor (Number aMode, Number aValue)

Depending on the value of aMode constructs a Response Factor of type InitConcetration or PULCON

  • Number aMode
  • Number aValue

GraphResponseFactor (Number aMode, String aFormula)

Constructs a Response Factor of type Formula

  • Number aMode
  • String aFormula

Functions

Name Output Parameters
toString String

toString () : String




GraphYModel

Object that describes the spectral information of each serie of the graph

See also: Graph

Enumerations

Name Type Values
ExtractMode Number emConcentration, emIntegral, emMaxPeakInt, emMaxPeakPos, emNone, emPeakInt, emShift

Properties

Name Type Comments
extractMode Number
f1From Number
f1To Number
label String
nNuclides Number

extractMode : Number

See also: ExtractMode

f1From : Number

Spectrum region limit

f1To : Number

Spectrum region limit

label : String

Label of the Serie

nNuclides : Number

Number of nuclides in this region

Constructors

GraphYModel ( aMod, from, to, nNuclides)

Functions

Name Output Parameters
toString String

toString () : String




GroupBox

Provides a group box frame with a title

Properties

Name Type Comments
checkable Boolean
checked Boolean
enabled Boolean
title String

checkable : Boolean

True if the group box is checkable

checked : Boolean

True if the group box is checked

enabled : Boolean

True if the widget is enabled

title : String

Title of the group box

Signals

Constructors

GroupBox ()

Functions

Name Output Parameters
add Widget aWidget

add (Widget aWidget)

Adds a Widget to the group box


List of parameters:
  • Widget aWidget



GSDMultiplet

This object is deprecated. Use Multiplet object instead.

A GSD multiplet

Table of contents

  1. Properties

Properties

Name Type Comments
centroid Number [read-only]
effPeaks Number [read-only]
integral Number [read-only]
kurtosis Number [read-only]
rmsWidth Number [read-only]
skewness Number [read-only]

centroid : Number [read-only]

The multiplet's centroid in ppm's

effPeaks : Number [read-only]

The number of effective peaks in the multiplet

integral : Number [read-only]

The multiplet's integral

kurtosis : Number [read-only]

The multiplet's kurtosis

rmsWidth : Number [read-only]

The multiplet's RMS width in ppm's

skewness : Number [read-only]

The multiplet's skewness




GSDMultiplets

This object is deprecated. Use Multiplets object instead.

A object holding a list of GSD multiplets

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
count Number [read-only]
length Number [read-only]
totalIntegral Number [read-only]

count : Number [read-only]

The count of GSD multiplets in the list.

length : Number [read-only]

A synonym of count.

See also: GSDMultiplets.count

totalIntegral : Number [read-only]

The sum of the integrals of each multiplet.

Functions

Name Output Parameters
at GSDMultiplet Number aIndex

at (Number aIndex) : GSDMultiplet

Gets a GSD multiplet at a specified index.


List of parameters:
  • Number aIndex

    - The index of the GSD multiplet in the list. From 0 to count - 1




GSDPeak

This object is deprecated. Use Peak object instead.

A GSD peak

Enumerations

Name Type Values
Flags Number C13Satellite, Hidden, Labile, None, Rotational, Weak
Types Number Artifact, Compound, Impurity, QReference, Solvent, SReference

Properties

Name Type Comments
area Number [read-only]
center Number [read-only]
flags GSDPeak.Flags
height Number [read-only]
phase Number [read-only]
type GSDPeak.Types
width Number [read-only]

area : Number [read-only]

The peak's area

center : Number [read-only]

The peak's center position in ppm's

flags : GSDPeak.Flags

The peak's flags.

height : Number [read-only]

The peak's height

phase : Number [read-only]

The peak's phase value

The peak's type.

width : Number [read-only]

The peak's width in ppm's

Functions

Name Output Parameters
setFlag GSDPeak.Flags aFlag, [Boolean aEnable]

setFlag (GSDPeak.Flags aFlag, [Boolean aEnable])

Sets/Resets a flag from Flags enumeration


List of parameters:
  • GSDPeak.Flags aFlag

    - The flag to set/reset

  • Boolean aEnable [optional]

    - If true, the flag is set, else the flag is reset. By default it's true.




GSDPeaks

This object is deprecated. Use Peaks object instead.

A object holding a list of GSD peaks

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
count Number [read-only]
length Number [read-only]

count : Number [read-only]

The count of GSD peaks in the list.

length : Number [read-only]

A synonym of count.

See also: GSDPeaks.count

Functions

Name Output Parameters
at GSDPeak Number aIndex

at (Number aIndex) : GSDPeak

Gets a GSD peak at a specified index.


List of parameters:
  • Number aIndex

    - The index of the GSD peak in the list. From 0 to count - 1




HttpMultiPart

Wrapper to QHttpMultiPart

Enumerations

Name Type Values
ContentType Number AlternativeType, FormDataType, MixedType, RelatedType

Constructors

HttpMultiPart ()

Functions

Name Output Parameters
append HttpPart aHttpPart
boundary ByteArray
setBoundary ByteArray aBoundary
setContentType Number aContentType

append (HttpPart aHttpPart)

Appends aHttpPart to this multipart.


List of parameters:

boundary () : ByteArray

Returns the boundary.

setBoundary (ByteArray aBoundary)

Sets the boundary. Usually, you do not need to generate a boundary yourself; upon construction the boundary is initiated with the string "boundary_.oOo._" followed by random characters, and provides enough uniqueness to make sure it does not occur inside the parts itself.


List of parameters:

setContentType (Number aContentType)

Sets the content type. The content type will be used in the HTTP header section when sending the multipart message via NetworkAccessManager.post().


List of parameters:
  • Number aContentType

    - Use the enumeration ContentType for this parameter.

Example:




HttpPart

Wrapper to QHttpPart

Table of contents

  1. Constructors
  2. Functions

Constructors

HttpPart ()

Functions

Name Output Parameters
setBody ByteArray aBody
setBodyDevice String aFilepath
setHeader Number aHeader

setBody (ByteArray aBody)

Sets the body of this MIME part. The body set with this method will be used unless the device is set via setBodyDevice(). For a large amount of data use setBodyDevice(), which will not copy the data internally.


List of parameters:

setBodyDevice (String aFilepath)

Sets the body device as the file in aFilepath.


List of parameters:
  • String aFilepath

setHeader (Number aHeader)

Sets the header.


List of parameters:
  • Number aHeader

    - See the enumeration KnownHeaders in NetworkRequest.




Identity

Table of contents

  1. Properties

Properties

Name Type Comments
comments String [read-only]
creationDate Date [read-only]
days Number [read-only]
email String [read-only]
expiryDate Date [read-only]
isPrivate Boolean [read-only]
isValid Boolean [read-only]
name String [read-only]
organization String [read-only]
role String [read-only]
serial String [read-only]
thumbprint String [read-only]

comments : String [read-only]

creationDate : Date [read-only]

days : Number [read-only]

email : String [read-only]

expiryDate : Date [read-only]

isPrivate : Boolean [read-only]

isValid : Boolean [read-only]

name : String [read-only]

organization : String [read-only]

role : String [read-only]

serial : String [read-only]

thumbprint : String [read-only]




IdentityData

Table of contents

  1. Properties

Properties

Name Type Comments
comments String
creationDate Date
days Number
email String
expiryDate Date
name String
organization String
role String

comments : String

creationDate : Date

days : Number

email : String

expiryDate : Date

name : String

organization : String

role : String




IdentityManager

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
identities Array

identities : Array

An array of Identity objects with all the known identities

Functions

Name Output Parameters
changeIdentityPassword Boolean String aIdentityThb, String aOldPwd, String aNewPwd
exportIdentities Boolean Array aIdentities, String aPath, [Boolean aOnlyPub = true]
extendIdentityExpiryDate String String aIdentityThb, String aPwd, [Date aDate]
importIdentities Boolean String aPath
isIdentityTrust Boolean String aIdentityThb
newIdentity String Object aData, String aPassword
removeDocumentSigner String aDocUuid
removeIdentity Boolean String aIdentityThb
setDocumentSigner String aDocUuid, String aIdentityThb, String aPwd

changeIdentityPassword (String aIdentityThb, String aOldPwd, String aNewPwd) : Boolean

Changes an identity password. Returns true on success and false on fail


List of parameters:
  • String aIdentityThb

    - A string with the identity thumbprint to modify

  • String aOldPwd

    - A string with the old password

  • String aNewPwd

    - A string with the new password

exportIdentities (Array aIdentities, String aPath, [Boolean aOnlyPub = true]) : Boolean

Export one or several identities to a '.mnid' file. Returns true on success and false on fail


List of parameters:
  • Array aIdentities

    - An array of strings representing the identity thumbprints to export

  • String aPath

    - The file path where identies will be exported

  • Boolean aOnlyPub [optional]

    - A boolean flag. If true, only the public part of the identities will be exported. Otherwise, the private part will exported too

extendIdentityExpiryDate (String aIdentityThb, String aPwd, [Date aDate]) : String

Creates a new identity from the seleced one but with extended expiry date. Returns the thumbprint of the created identity on succees. Throws and exception or returns undefined on fail.


List of parameters:
  • String aIdentityThb

    - A string with the identity thumbprint to modify

  • String aPwd

    - A string with the identity password

  • Date aDate [optional]

    - The new expiry date. If not specified a default one will be chosen.

importIdentities (String aPath) : Boolean

Import one or several identities from a '.mnid' file. Returns true on success and false on fail


List of parameters:
  • String aPath

    - The file path to be imported

isIdentityTrust (String aIdentityThb) : Boolean

Tells if a identity is trust or not.


List of parameters:

newIdentity (Object aData, String aPassword) : String

Creates a new identity and adds it to the available identities. Returns the thumbprint of the created identity on succees. Throws and exception or returns undefined on fail.


List of parameters:
  • Object aData

    - The new identity data. An object following the prototype of IdentityData. The mandatory fields are name and email. You can specify the expiry date setting the days from today or by setting the expiry date. The creation date will be ignored.

  • String aPassword

    - The password used to encrypt the private part of the identity and needed to use it after then

removeDocumentSigner (String aDocUuid)

Removes the document current signer so the document won't be signed anymore.


List of parameters:

removeIdentity (String aIdentityThb) : Boolean

Removes an identity from the known identities. Returns true on success and false on fail


List of parameters:

setDocumentSigner (String aDocUuid, String aIdentityThb, String aPwd)

Sets the document current signer. Therefore the document will be signed with this identity on saving.


List of parameters:
  • String aDocUuid

    - A string with the document uuid

  • String aIdentityThb

    - A string with the identity thumbprint to modify

  • String aPwd

    - A string with the identity password




IniFile

Save/Read settings to/from a file. It has the same interface as the Settings object

See also: Settings

Table of contents

  1. Constructors
  2. Functions

Constructors

IniFile (String aFilePath, [String aPreffix])

  • String aFilePath
  • String aPreffix [optional]

Functions

Name Output Parameters
fileName String

fileName () : String

Returns the path of the file




InputDialog

This object provides convenience functions to get simple type input dialogs. All the dialogs return undefined when the user presses "Cancel"

Table of contents

  1. Functions

Functions

Name Output Parameters
getDouble Number String aTitle, String aLabel, Number aValue, Number aMin, Number aMax, Number aDecimals
getInt Number String aTitle, String aLabel, Number aValue, Number aMin, Number aMax, Number aStep
getItem String String aTitle, String aLabel, Array aItems, Number aCurrent, Boolean aEditable
getText String String aTitle, String aLabel, LineEdit.EchoMode aEchoMode, String aText

InputDialog.getDouble (String aTitle, String aLabel, Number aValue, Number aMin, Number aMax, Number aDecimals) : Number


List of parameters:
  • String aTitle
  • String aLabel
  • Number aValue
  • Number aMin
  • Number aMax
  • Number aDecimals

InputDialog.getInt (String aTitle, String aLabel, Number aValue, Number aMin, Number aMax, Number aStep) : Number


List of parameters:
  • String aTitle
  • String aLabel
  • Number aValue
  • Number aMin
  • Number aMax
  • Number aStep

InputDialog.getItem (String aTitle, String aLabel, Array aItems, Number aCurrent, Boolean aEditable) : String


List of parameters:
  • String aTitle
  • String aLabel
  • Array aItems
  • Number aCurrent
  • Boolean aEditable

InputDialog.getText (String aTitle, String aLabel, LineEdit.EchoMode aEchoMode, String aText) : String


List of parameters:



Integral

Properties

Name Type Comments
calculationParams Object [read-only]
id String [read-only]

calculationParams : Object [read-only]

The parameters used to calculate the integral. The object has the following properties:

  • 'method' as a String and valid values {"Sum", "Peaks", "SumEdited"}. The method of calculation.
  • 'peaksInc' as a Number. The flags telling which peaks to include in the calculus. Only relevant for "Peaks" and "SumEdited" methods.
  • 'peaksExc' as a Number. The flags telling which peaks to exclude in the calculus. Only relevant for "Peaks" and "SumEdited" methods.
  • 'ellipticalShape' as a Boolean. Only relevant for 2D spectra. If true the integral shapes are elliptical instead of rectangular.

id : String [read-only]

The integral region UUID (unique identifier)

Constructors

Integral (Integral aIntegral)

Integral (NMRSpectrum aSpectrum, SpectrumRegion aSpectrumRegion, Boolean aEllipse = true)

  • NMRSpectrum aSpectrum
  • SpectrumRegion aSpectrumRegion
  • Boolean aEllipse

    - 2D integration region. 'true' - ellipse, 'false' - rectangle.

Functions

Name Output Parameters
integralValue Number Number aNormFactor
rangeMax Number Number aDim
rangeMin Number Number aDim
toString String

integralValue (Number aNormFactor) : Number


List of parameters:
  • Number aNormFactor

rangeMax (Number aDim) : Number


List of parameters:
  • Number aDim

rangeMin (Number aDim) : Number


List of parameters:
  • Number aDim

toString () : String




Integrals

Properties

Name Type Comments
count Number
normValue Number

count : Number

Number of integrals

normValue : Number

Integrals normalization factor

Constructors

Integrals ()

Constructs an empty list

Integrals (Integrals aIntegralList)

Functions

Name Output Parameters
append Integral aIntegral
at Integral Number aIndex
clear
findIntegral Integral String aId
removeAt Number aIndex
toString String

append (Integral aIntegral)


List of parameters:
  • Integral aIntegral

at (Number aIndex) : Integral

Returns integral at the position aIndex


List of parameters:
  • Number aIndex

clear ()

findIntegral (String aId) : Integral

Finds integral by id


List of parameters:
  • String aId

removeAt (Number aIndex)


List of parameters:
  • Number aIndex

toString () : String




JList

Properties

Name Type Comments
count Number
length Number

count : Number

length : Number

Constructors

JList ()

Constructs an empty list

JList (JList aJList)

Functions

Name Output Parameters
append Number aJ
at Number
clear
removeAt Number aIndex
sort Boolean bAscending
toString String

append (Number aJ)


List of parameters:
  • Number aJ

at () : Number

clear ()

removeAt (Number aIndex)


List of parameters:
  • Number aIndex

sort (Boolean bAscending)


List of parameters:
  • Boolean bAscending

toString () : String




Label

Provides a label widget

Properties

Name Type Comments
text String

text : String

The text of the label

Constructors

Label ()

Functions

Name Output Parameters
setFont Font aFont
setPixmapPath String aPath

setFont (Font aFont)

Changes the label's text font


List of parameters:
  • Font aFont

setPixmapPath (String aPath)

Changes the label pixmap


List of parameters:
  • String aPath



LayoutTemplate

LayoutTemplate page item

Inherits PageItem

Properties

Name Type Comments
managedName String [read-only]

managedName : String [read-only]

Managed item name

Constructors

LayoutTemplate (LayoutTemplate aLayoutTemplate)




LineEdit

Provides one-line text editor with a label

Enumerations

Name Type Values
EchoMode Number NoEcho, Normal, Password, PasswordEchoOnEdit

Properties

Name Type Comments
echoMode LineEdit.EchoMode
enabled Boolean
label String
text String

echoMode : LineEdit.EchoMode

Describes how the line edit should display its contents.

enabled : Boolean

True if the widget is enabled

label : String

Label of the line edit

text : String

Text on the edit line

Constructors

LineEdit ()




LineSeries

Wrapper to Qt Charts QLineSeries

Enumerations

Name Type Values
PenStyle Number DashDotDotLine, DashDotLine, DashLine, DotLine, NoPen, SolidLine

Properties

Name Type Comments
color String
name String
style PenStyle
width Integer

color : String

name : String

style : PenStyle


var lineSeries = new LineSeries();
lineSeries.style = LineSeries.SolidLine;
			

width : Integer

Constructors

LineSeries ()

Functions

Name Output Parameters
append aValueX, aValueY
attachAxis aAxis

append ( aValueX, aValueY)


List of parameters:
  • aValueX
  • aValueY

See also: QXYSeries::append

attachAxis ( aAxis)


List of parameters:

See also: QAbstractSeries::attachAxis




ListWidget

Shows Items in a List

Properties

Name Type Comments
items Array
selectedRows Array [read-only]
selection Array [read-only]

items : Array

Array of items in the widget. Each item contains information about its state.

selectedRows : Array [read-only]

Array of selected rows

selection : Array [read-only]

Array of selected items

Signals

Constructors

ListWidget ()




LogValueAxis

Wrapper to QLogValueAxis

Properties

Name Type Comments
base Number
labelFormat String
max Number
min Number
minorTickCount Number
titleText String

base : Number

The base of the logarithm. The value has to be greater than 0 and cannot equal 1.

labelFormat : String

The label format of the axis. The format string supports the following conversion specifiers, length modifiers, and flags provided by printf() in the standard C++ library: d, i, o, x, X, f, F, e, E, g, G, c.

max : Number

The maximum value on the axis. When setting this property, the minimum value is adjusted if necessary, to ensure that the range remains valid. The value has to be greater than 0.

min : Number

The minimum value on the axis. When setting this property, the maximum value is adjusted if necessary, to ensure that the range remains valid. The value has to be greater than 0.

minorTickCount : Number

The number of minor tick marks on the axis. This indicates how many grid lines are drawn between major ticks on the chart. Labels are not drawn for minor ticks. The default value is 0. Set the value to -1 and the number of grid lines between major ticks will be calculated automatically.

titleText : String

The title of the axis. Empty by default.

Constructors

LogValueAxis ()




MainWindow

Main window object

Properties

Name Type Comments
activeDocument Document
enableUndo Boolean
hasGui Boolean

activeDocument : Document

Gets/sets current (active) document

enableUndo : Boolean

Enables/Disables the undo framework of the application. Disabling this is useful in order to save memory.

hasGui : Boolean

Constructors

MainWindow (MainWindow aMainWnd)

Functions

Name Output Parameters
abort
addDocument Document aDocument
blockEventHandlers Boolean String aEvent, Boolean aBlock
clearStatusMessage
doAction String aActName
documents Array
endBusy
getAction Action String aActName
getDockWidgetVisibility Boolean String aName
getObject String aObjectName
installEventHandler String aEventName, String aFunctionName
newDocument Document
processEvents
registerDockWidget String aDockWidgetName, String aTitle, String aCategory, function aCreationFunction
removeEventHandler String aEventName, String aFunctionName
reportActivity
restoreCursor
setBusy String aMessage
setDockWidgetVisibility String aName, Boolean aVisibility
setStatusMessage String aMessage
setWaitCursor
sleep Number aTime
waitForInput String aText, String aWindowTitle = ""

abort ()

Aborts execution of script

addDocument (Document aDocument)


List of parameters:
  • Document aDocument

    - Adds a document to the document list and makes it active.

blockEventHandlers (String aEvent, Boolean aBlock) : Boolean

Block all event handlers of the aEvent. Returns old block state of the aEvent.


List of parameters:
  • String aEvent

    - If empty then blocks all events. Otherwise blocks the aEvent only.

  • Boolean aBlock

See also: installEventHandler

clearStatusMessage ()

Clears any message from the status bar after a call to setStatusMessage.

doAction (String aActName)

Performs a GUI action


List of parameters:

documents () : Array

Returns array of all open documents.

endBusy ()

Clears any message from the status bar and restores the normal application cursor.

See also: setBusy

getAction (String aActName) : Action

Returns a Action object with a GUI action


List of parameters:

				
var mnovaAction = mainWindow.getAction("nmrPeakPickingOptions");
dialog.widgets.tbMnovaAction.setDefaultAction(mnovaAction);
			
			

getDockWidgetVisibility (String aName) : Boolean


List of parameters:
  • String aName

    - The dock widget identifier name

getObject (String aObjectName)

Get an object of the main window


List of parameters:
  • String aObjectName

    - The name of the object

installEventHandler (String aEventName, String aFunctionName)

Install a new event handler


List of parameters:
  • String aEventName

    - Name of the event

    Valid values: {"activeDocumentChanged", "arrowChanged", "dbItemsPasted", "itemMoved", "itemsCreated", "itemsDeleted", "KeyPress", "MouseButtonDblClick", "MouseButtonPress", "MouseButtonRelease", "MouseMove", "msChromPeaksChanged", "msSpectrumImported", "nmrAssignmentHighlighted", "nmrAssignmentMade", "nmrIntegralChanged", "nmrMultipletChanged", "nmrMultipletHighlighted", "nmrSpectrumChanged", "nmrSpectrumImported", "selectionChanged", "ShortcutOverride", "verificationResult"}

  • String aFunctionName

    - Name of the function that will be called when the event occurs

See also: blockEventHandlers

newDocument () : Document

Creates a new document window.

processEvents ()

Process the UI events

registerDockWidget (String aDockWidgetName, String aTitle, String aCategory, function aCreationFunction)


List of parameters:
  • String aDockWidgetName

    - A name used as identifier for this dock widget. It must be unique.

  • String aTitle

    - The title for the dock widget and the name shown in the tables dialog

  • String aCategory

    - The category name under it's shown in the tables dialog

  • function aCreationFunction

    - A function that must return a widget object which will be the dock widget contents

removeEventHandler (String aEventName, String aFunctionName)

Remove a event handler


List of parameters:
  • String aEventName

    - Name of the event

    Valid values: {"dbItemsPasted", "KeyPress", "MouseButtonDblClick", "MouseButtonPress", "MouseButtonRelease", "MouseMove", "nmrAssignmentHighlighted", "nmrAssignmentMade", "nmrIntegralChanged", "nmrMultipletChanged", "nmrMultipletHighlighted", "nmrSpectrumImported", "ShortcutOverride"}

  • String aFunctionName

    - Name of the function that will be removed from the event handlers

See also: blockEventHandlers

reportActivity ()

Tells that some activity is being done so Mnova will avoid to release floating license seats.

restoreCursor ()

Restores the application cursor to its normal state after a call to setWaitCursor.

See also: endBusy, setWaitCursor

setBusy (String aMessage)

Displays the given message in the status bar and sets the application cursor to the Wait Cursor. Each call to setBusy must eventually be followed by a call to endBusy.


List of parameters:
  • String aMessage

    - The message to be displayed in the status bar

See also: endBusy

setDockWidgetVisibility (String aName, Boolean aVisibility)


List of parameters:
  • String aName

    - The dock widget identifier name

  • Boolean aVisibility

    - True to show it. False to hide it.

setStatusMessage (String aMessage)

Displays the given message in the status bar.


List of parameters:
  • String aMessage

    - The message to be displayed

See also: clearStatusMessage, setBusy

setWaitCursor ()

Sets the application cursor to the Wait Cursor, indicating that the script is busy performing some task. Each call to setWaitCursor must eventually be followed by a call to restoreCursor.

See also: restoreCursor, setBusy

sleep (Number aTime)

Stops execution of script for aTime miliseconds


List of parameters:
  • Number aTime

    - Time in miliseconds

waitForInput (String aText, String aWindowTitle = "")

Stops the execution of the script and waits for some user action.


List of parameters:
  • String aText

    - Text to be shown in the dialog.

  • String aWindowTitle

    - Title of the dialog.




MassAdductPair

An adduct and a loss pair using chemical formulae and charge notation

Table of contents

  1. Properties

Properties

Name Type Comments
adduct String [read-only]
loss String [read-only]

adduct : String [read-only]

An adduct given by its atom/chemical formula with charge notation (H+)

loss : String [read-only]

A loss given by its atom/chemical formula with charge notation (H+)




MassChargeStateDeconvolutionSettings

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
abundanceThreshold Number
deconvolutedMassMax Number [read-only]
deconvolutedMassMin Number [read-only]
mzMax Number [read-only]
mzMin Number [read-only]
tolerance Number
zMax Number [read-only]
zMin Number [read-only]

abundanceThreshold : Number

The abundance threshold fraction. Default is 1% (0.01) of base peak in m/z range

deconvolutedMassMax : Number [read-only]

The deconvoluted mass range maximum. Charge state - peak combinations which are greater than this number are excluded.

deconvolutedMassMin : Number [read-only]

The deconvoluted mass range minimum. Charge state - peak combinations which are less than this number are excluded.

mzMax : Number [read-only]

The m/z range maximum to be deconvoluted. If it's negative, the range reverts to the default (i.e. use spectrum range)

mzMin : Number [read-only]

The m/z range minimum to be deconvoluted. If it's negative, the range reverts to the default (i.e. use spectrum range)

tolerance : Number

The tolerance for peak matching in ppm. Default is 5 ppm.

zMax : Number [read-only]

The charge state range maximum used for deconvolution

zMin : Number [read-only]

The charge state range minimum used for deconvolution

Functions

Name Output Parameters
setChargeStateRange Number aMin, Number aMax
setDeconvolutedMassRange Number aMin, Number aMax
setMzRange Number aMin, Number aMax

setChargeStateRange (Number aMin, Number aMax)

Sets the charge state range used for deconvolution


List of parameters:
  • Number aMin

    See also: zMin

  • Number aMax

    See also: zMax

setDeconvolutedMassRange (Number aMin, Number aMax)

Sets the deconvoluted mass range


List of parameters:

setMzRange (Number aMin, Number aMax)

Sets the m/z range to be deconvoluted


List of parameters:
  • Number aMin

    See also: mzMin

  • Number aMax

    See also: mzMax




MassChromPeak

A chromatogram's peak.

Table of contents

  1. Properties

Properties

Name Type Comments
area Number
baseline Object
center Object
end Object
fill String
height Number
label String
start Object
type MassItem.ChromatogramPeakType

area : Number

The peak's area

baseline : Object

The peak's baseline start and end position as an object like {"start": {"x": 0.0, "y": 1.0}, "end": {"x": 5.0, "y": 0.5}}

center : Object

The peak's center position as an object. The position will be hold in object's properties 'x' and 'y'

end : Object

The peak's end position as an object. The position will be hold in object's properties 'x' and 'y'

fill : String

The peak fill color in the hex format '#aarrggbb'

height : Number

The peak's height

label : String

The custom peak label set by the user

start : Object

The peak's start position as an object. The position will be hold in object's properties 'x' and 'y'

type : MassItem.ChromatogramPeakType

The peak's type




MassChromPeakPurityClusterOptions

Object to get/set the clustering settings when doing a peak purity calculation.

Table of contents

  1. Properties

Properties

Name Type Comments
maxDistance Number
minIntensityRatio Number

maxDistance : Number

The maximum cluster distance in daltons (Da)

minIntensityRatio : Number

The minimum intensity ratio to ignore a m/z stick in a cluster. The ratio is between the current peak and the cluster's base peak.




MassChromPeakPurityOptions

Object to get/set the chromatographic peak purity settings

Table of contents

  1. Properties

Properties

Name Type Comments
chromatogramsCount Number
clusterSettings MassChromPeakPurityClusterOptions
massRanges Array
mode String
tolerance Number

chromatogramsCount : Number

The number of highest ions to be extracted

The settings used to 'clusterize' the mass spectrum.

massRanges : Array

An array of doubles and/or objects following the syntax {"from":Number, "to":Number}

mode : String

The mode to get the underlying m/z values inside the chromatographic peak/range

Valid values: {"Clusters", "Peaks", "Predefined"}

tolerance : Number

The tolerance in Da used to calculate the coadded mass spectrum and the extracted ion chromatograms




MassChromPeakPurityResult

Object to read the chromatographic peak purity result

Table of contents

  1. Properties

Properties

Name Type Comments
eicData Array [read-only]
range Object [read-only]
totalArea Number [read-only]
valid Boolean [read-only]

eicData : Array [read-only]

An array of objects containing the EIC (Extracted Ion Chromatogram) data. One item per extracted chromatogram. Each item is an object with two properties:

  • mass: The extracted mass in Da
  • area: The EIC area in the range (Divided by the totalArea and multiplied by 100, it will give the abundance
  • from: The extracted mass range start. It can be undefined.
  • to: The extracted mass range end. It can be undefined.

range : Object [read-only]

An object with two properties: from, to. It tells the retention time range in minutes used to calculate the peak purity.

totalArea : Number [read-only]

The TIC total area in the range

valid : Boolean [read-only]

Tells if the result is valid/empty or not.




MassElCompResult

A elemental composition result object

Table of contents

  1. Properties

Properties

Name Type Comments
absErr Number
dbe Number
fitness Number
formula String
mass Number
mDaErr Number
ppmErr Number

absErr : Number

Absolute (unsigned) error (in ppm) between calculated and target masses

dbe : Number

Calculated double bond equivalent value for the formula. DBE = (2 * #C + #N - #H - #X + 2) / 2, where X = F, Cl, Br, I

fitness : Number

Fitness score from 1.0 (perfect match) to 0.0 (no match). Fitness is computed by matching the experimental isotope cluster to the computed cluster for the formula, taking into account both m/z and intensity.

formula : String

Chemical formula in Hill-sorted order

mass : Number

The calculated mass

mDaErr : Number

Signed error in mDa between calculated and target masses

ppmErr : Number

Signed error in ppm between calculated and target masses




MassElCompSettings

The elemental composition settings

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
adduct String
adductCharge Number
chargeState Number
dbe Object
electronMode String
elements Array
eqAdduct String [read-only]
eqLoss String [read-only]
fitnessTheshold Number
maxResults Number
tolerance Object

adduct : String

An adduct using chemical formulae and charge notation. Adducts are typically found in soft ionization techniques such as ESI. Proton (H) is most common for organic compounds, while H and/or Na (or other Group 1A alkali metal cation) may be found in protein, peptide, or polymer spectra.

adductCharge : Number

Adduct charge is a SIGNED quantity specifying the charge carried by the adduct or loss, usually 1 (eg. H, NH4, Na, etc.) and whether the adduct represents an addition to the neutral mass when forming an ion ([M + H]+) or represents a loss ([M - H]-).

chargeState : Number

Charge state is a signed integer. The magnitude (1, 2, 3, ...) is a function of the experimental ionization technique, while the sign (+/-) is determined by the mode in which the experimental spectrum was produced and detected.

dbe : Object

Double bond equivalents range. The object will have two properties: 'min' and 'max'


				
// Getting dbe
var myDBE = msItem.elementalComp.settings.dbe;
print(myDBE.min);
print(myDBE.max);
// Setting dbe
myDBE.min = 1.5;
myDBE.max = 25;
msItem.elementalComp.settings.dbe = myDBE;
// Setting dbe using another way
var myDBE2 = new Object();
myDBE2.min = -0.5;
myDBE2.max = 50.0;
msItem.elementalComp.settings.dbe = myDBE2;
			
			

electronMode : String

Electron mode can be even, odd, or both. Typically, EI (electron impact) produces negatively-charged, odd electron ions, whereas ESI produces even-electron ions with either a positive or negative charge.

Valid values: {"All", "Even", "Odd"}

elements : Array

eqAdduct : String [read-only]

The equivalent adduct formula. It returns an adduct formula taking into account the adduct charge and the charge state. It should be the same shown in the elemental composition constraints dialog. It's empty if a loss was set.

eqLoss : String [read-only]

The equivalent loss formula. It returns a loss formula taking into account the adduct charge and the charge state. It should be the same shown in the elemental composition constraints dialog. It's empty if an adduct was set.

fitnessTheshold : Number

The fitness threshold. Results that match the other criteria but have fitness lower than this threshold will be discarded.

maxResults : Number

Maximum number of results to return. Results will all satisfy the other constraints

tolerance : Object

Tolerance for matching computed composition to the target m/z. The object must have the properties:

  • 'units' as a String and valid values {"Da", "ppm"}
  • 'value' as a Number


				
// Getting tolerance
var tol = msItem.elementalComp.settings.tolerance;
print(tol.units);
print(tol.value);
// Setting tolerance
tol.units = "ppm";
tol.value = 10;
msItem.elementalComp.settings.tolerance = tol;
// Setting tolerance using another way
var tol2 = new Object();
tol2.units = "Da";
tol2.value = 0.5;
msItem.elementalComp.settings.tolerance = tol2;
			
			

Functions

Name Output Parameters
setAdductOrLoss String aFormula, String aType

setAdductOrLoss (String aFormula, String aType)

Sets either an equivalent adduct or loss. A helper method to set the right adduct, charge state and adduct charge settings through a molecular formula.


List of parameters:
  • String aFormula

    - The adduct or loss molecular formula. Examples: 2(H+), 2(H2OH+), Ca+2

  • String aType

    - Specifies if you want to set an adduct or a loss

    Valid values: {"adduct", "loss"}




MassElemComposition

Contains the elemental composition settings and the last elemental composition calculation results for a MassItem object

Table of contents

  1. Properties

Properties

Name Type Comments
relativeSettings MassElCompSettings
results Array [read-only]
settings MassElCompSettings

relativeSettings : MassElCompSettings

The elemental composition settings when using relative values

results : Array [read-only]

An array of elemental composition result objects.

settings : MassElCompSettings

The elemental composition settings




MassElementConstraint

An element count constraint for elemental composition settings

Table of contents

  1. Properties

Properties

Name Type Comments
max Number
min Number
symbol String

max : Number

The maximum allowed elment count.

min : Number

The minimum allowed elment count.

symbol : String

The element symbol (H, C, N, O, P, Na...)




MassFunctionInfo

An object holding info about a mass function

Table of contents

  1. Properties

Properties

Name Type Comments
analyzerType MassItem.MSAnalyzer [read-only]
count Number [read-only]
index Number [read-only]
msmsType MassItem.FunctionMSMSType [read-only]
msType MassItem.FunctionMSType [read-only]
name String [read-only]
order Number [read-only]
polarity MassItem.FunctionPolarity [read-only]

analyzerType : MassItem.MSAnalyzer [read-only]

The analyzer type used for the mass experiment

count : Number [read-only]

The spectra count

index : Number [read-only]

The function index in the MassFunctionsInfo object

msmsType : MassItem.FunctionMSMSType [read-only]

The MS/MS type of experiment. NOTE: Only in MS experiments where order > 1

msType : MassItem.FunctionMSType [read-only]

The type of mass experiment

name : String [read-only]

The function name as shown in the "MS browser"

order : Number [read-only]

The mass experiment order ( 1 => MS, 2 => MS/MS ... )

polarity : MassItem.FunctionPolarity [read-only]

The mass experiment polarity




MassFunctionsInfo

Contains one or several MassFunctionInfo objects

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
count Number [read-only]

count : Number [read-only]

The number of functions

Functions

Name Output Parameters
getItem MassFunctionInfo Number aIndex

getItem (Number aIndex) : MassFunctionInfo

Gets and function object from the functions set


List of parameters:
  • Number aIndex

    - An index between 0 and count - 1




MassInjectionInfo

An object holding info about a mass injection

Table of contents

  1. Properties

Properties

Name Type Comments
functions MassFunctionsInfo [read-only]
index Number [read-only]
name String [read-only]
traces MassTracesInfo [read-only]

functions : MassFunctionsInfo [read-only]

A set of objects holding the functions information

index : Number [read-only]

The injection index in the MassInjectionsInfo object

name : String [read-only]

The injection name as shown in the "MS browser"

traces : MassTracesInfo [read-only]

A set of objects holding the traces information




MassInjectionsInfo

Contains one or several MassInjectionInfo objects

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
count Number [read-only]

count : Number [read-only]

The number of injections

Functions

Name Output Parameters
getItem MassInjectionInfo Number aIndex

getItem (Number aIndex) : MassInjectionInfo

Gets and injection object from the injections set


List of parameters:
  • Number aIndex

    - An index between 0 and count - 1




MassItem

A mass item object

Inherits PageItem

Enumerations

Name Type Values
ChromatogramPeakType Number BB, BV, Shoulder, Unknown, VB, VV
ChromatogramType Number BPC, MZ, TIC, Trace, Unknown, UV, UVTAbs
DataTypes Number Chromatogram, Spectrum, Unknown, UVSpectrum
FunctionMSMSType Number NeutralLoss, None, Precursor, Product
FunctionMSType Number MS, MSn, SIMMS, SIMMSn, Unknown, ZoomMS, ZoomMSn
FunctionPolarity Number Mixed, Negative, Positive, Unknown
FunctionPolarity Number Mixed, Negative, Positive, Unknown
MSAnalyzer Number Constant, FTMS, Other, Proportional, TOF, Unknown
SpectrumSelMode Number Manual, Peak, PeakSub

Properties

Name Type Comments
appendSelected Boolean
automaticTraceAlignmentParameters AutoTraceAlignmentParams [read-only]
chargeStateDeconvolutionSettings MassChargeStateDeconvolutionSettings [read-only]
customRunTime Object
datasetFileName String [read-only] [deprecated]
datasets Array [read-only]
datasetsInfo Array [read-only]
deconvOnSelect Boolean
elementalComp MassElemComposition [read-only]
hasFullDataset Boolean [read-only]
info MassItemInfo [read-only] [deprecated]
layoutProperties MassLayoutProperties [read-only]
molMatch MassMolMatch [read-only]
parameters Object [read-only] [deprecated]
params MassItemParameters [read-only]
plotsCount Number [read-only]
selectionMode MassItem.SpectrumSelMode
spectrumSelectionTarget String

appendSelected : Boolean

If true the selected spectrum will be appended as new plot. If false the selected spectrum either will replace an already existant spectrum plot or will be appended if a "switchable" spectrum doesn't exist.

automaticTraceAlignmentParameters : AutoTraceAlignmentParams [read-only]

chargeStateDeconvolutionSettings : MassChargeStateDeconvolutionSettings [read-only]

customRunTime : Object

An object describing the custom run time range used by this mass item: { "Minimum": 0, "Maximum": 2 } The range is specified by a minimum and a maximum real numbers in minutes. If both are the same, the range is invalid and it means that no custom RT is applied.

datasetFileName : String [read-only] [deprecated]

The source dataset path.

datasets : Array [read-only]

The data set files used by this mass item. Returns an array of objects like: [{"id": "{CC7122BB-CB2A-43BA-8695-30BE99398C29}", "name": "c:\data\msdata.raw", "provider_id": "{05A74FC2-31B3-47D1-A925-A20EC65A66F4}", "provider_name": "Thermo Xcalibur"}]

  • id is the dataset UUID.
  • name is the source dataset path.
  • provider_id is the provider UUID.
  • provider_name is the provider name.

datasetsInfo : Array [read-only]

It returns an array of MassItemInfo objects containing the same information provided by the "MS browser" table in the application.

See also: MassItemInfo

deconvOnSelect : Boolean

If true a charge state deconvolution would be done in the selected spectrum.

elementalComp : MassElemComposition [read-only]

The elemental composition object. It holds the elemental composition settings and the last calculation results.

hasFullDataset : Boolean [read-only]

Tells if the full dataset contents are embedded into the item object.

See also: MassPlugin.fetchFullDataset, MassPlugin.releaseFullDataset

info : MassItemInfo [read-only] [deprecated]

It returns an object containing the same information provided by the "MS browser" table in the application for the first dataset.

layoutProperties : MassLayoutProperties [read-only]

The mass item's layout properties.

molMatch : MassMolMatch [read-only]

The molecular match object. It holds the molecular match settings and the last calculation results.

parameters : Object [read-only] [deprecated]

The mass item parameters. It returns an object where each property is named as a mass item parameter and the property's value is the same as the parameter's value. NOTE: The properties must be accessed using the brackets notation because it could contain spaces and other characters not allowed in conventional dot notation. For example to access to 'Acquired Date' parameter use parameters['Acquired Date'].

params : MassItemParameters [read-only]

An object to get and set the mass items parameters.

plotsCount : Number [read-only]

The total number of item's plots (included the hidden ones).

selectionMode : MassItem.SpectrumSelMode

The spectrum selection mode from a chromatogram


				
msItem.selectionMode = MassItem.SpectrumSelMode.Peak
			
			

spectrumSelectionTarget : String

An universally unique Identifier (UUID) in string representation to identify the plot used as target to spectrum selection operations. It can be undefined, in that case the first compatible spectrum is used as target for the selection operations.

See also: MassItem.selectSpectra, MassItemPlot.id

Constructors

MassItem (MassItem aItem)

  • MassItem aItem

Functions

Name Output Parameters
activeFunction Number Number aInjectionIndex, [String aDatasetId]
alignForBackgroundSubtraction Object MassItem aBackgroundMassItem, Number aForeInjectionIndex, Number aForeFunctionIndex, Number aBackInjectionIndex, Number aBackFunctionIndex, Array aReferenceIons, [String aAdduct], [String aLoss]
alignTracesRT Boolean Number aOldRT, Number aNewRT, Number aPlotIndex
alignTracesRT Boolean Number aOldRT, Number aNewRT, String aPlotId
alignTracesRT Boolean Array aOldRTs, Array aNewRTs, Number aPlotIndex
alignTracesRT Boolean Array aOldRTs, Array aNewRTs, String aPlotId
appendDataset String aDatasetIdOrFile
applyAutomaticTraceAlignment
applyMSBackgroundSubtraction Boolean MassItem aBackgroundMassItem, Number aForeInjectionIndex, Number aForeFunctionIndex, Number aBackInjectionIndex, Number aBackFunctionIndex, [Object aRTIndex]
applyUVBackgroundSubtraction Boolean MassItem aBackgroundMassItem, Number aForeInjectionIndex, Number aBackInjectionIndex, [Object aRTIndex]
assign String String aMoleculeDataID, Object aFeature, [String aPlotId]
assignments Array [String aPlotId]
calculatePeakPurity Object String aPlotId, Number aFromRT, [Number aToRT]
chargeStateDeconvolution MassItemPlot [String aPlotID]
clearMSBackgroundSubtraction Number aInjectionIndex, Number aFunctionIndex
clearPeakPurity [String aPlotId]
clearUVBackgroundSubtraction Number aInjectionIndex
correctTraceBaseline Object aSettings, [String aPlotId]
deleteOverlaidPlot String aOverlaidPlotId, [String aPlotId]
deletePlot Boolean Number aPlotIndex
deletePlot Boolean String aPlotId
dumpChromatogramMSSpectraToCSV String aOutFilename, [String aPlotId]
dumpChromatogramUVSpectraToCSV String aOutFilename, [String aPlotId]
extractOverlaidPlot String aOverlaidPlotId, [String aPlotId]
findragmentIonSpectrum Boolean String aPlotId
findragmentIonSpectrum Boolean Number aPlotIndex
hidePlot Boolean Number aPlotIndex
hidePlot Boolean String aPlotId
movePlot Boolean Number aSrcPlotIndex, Number aDstPlotIndex
movePlot Boolean Number aSrcPlotId, Number aDstPlotId
newChromatogram Boolean Object aChromDef, [String aDatasetId]
overlayPlots Array aPlotIds, [String aPlotId]
plot MassItemPlot [Number aPlotIndex]
plot MassItemPlot [String aPlotID]
plotByType MassItemPlot MassItem.DataTypes aType
removeAssignments [Array aIdsList]
removeDataset String aDatasetId
selectMolMatchResult Boolean Number aIndex
selectSpectra Boolean MassItemPlot aChromPlot, Number aRT, [Boolean aSubtract = false]
selectSpectra Boolean MassItemPlot aChromPlot, Number aStartRT, Number aEndRT, [Boolean aSubtract = false]
selectUVSpectra Boolean MassItemPlot aChromPlot, Number aRT
selectUVSpectra Boolean MassItemPlot aUVChromPlot, Number aStartRT, Number aEndRT
setActiveFunction Boolean Number aInjectionIndex, Number aFunctionIndex, [String aDatasetId]
setActivePlot Boolean [Number aPlotIndex]
setActivePlot Boolean [String aPlotID]
setAssignmentLabel String aAssignmentId, String aLabel
setOverlaidPlotCustomColor String aOverlaidPlotId, String aColor, [String aPlotId]
showPlot Boolean Number aPlotIndex
showPlot Boolean String aPlotId

activeFunction (Number aInjectionIndex, [String aDatasetId]) : Number

Gets the default function index for a given injection and dataset.


List of parameters:
  • Number aInjectionIndex

    - An integer specifying the injection index.

  • String aDatasetId [optional]

    - The dataset id. If not specified the first dataset will be used.

alignForBackgroundSubtraction (MassItem aBackgroundMassItem, Number aForeInjectionIndex, Number aForeFunctionIndex, Number aBackInjectionIndex, Number aBackFunctionIndex, Array aReferenceIons, [String aAdduct], [String aLoss]) : Object

Computes the retention time index between a background and a foreground spectra collections by searching for reference ion masses in both the current (foreground) and background MS collections and collating the results. It returns an object suitable to be used as aRTIndex parameter for applyMSBackgroundSubtraction and applyUVBackgroundSubtraction function if succeeds or an undefined value if fails.


List of parameters:
  • MassItem aBackgroundMassItem

    - A mass item containing the background spectra

  • Number aForeInjectionIndex

    - The injection index for the foreground spectra. The zero based index for the injection where the spectra to be subtracted is contained

  • Number aForeFunctionIndex

    - The function index for the foreground spectra. The zero based index for the function inside the injection where the spectra to be subtracted is contained

  • Number aBackInjectionIndex

    - The injection index for the background spectra. The zero based index for the injection where the spectra to subtract is contained

  • Number aBackFunctionIndex

    - The function index for the background spectra. The zero based index for the function inside the injection where the spectra to subtract is contained

  • Array aReferenceIons

    - An array where each item is an object following the next definition:

    • String formula: The molecular formula. [Example: H2O]
    • Object foreground [Optional]: An object specifying the retention time (RT) range where the Ion should be found in the foreground spectra. If not provided the entire run is used.
      • Number from: The RT from value of the range.
      • Number to: The RT to value of the range.
    • Object background [Optional]: An object specifying the retention time (RT) range where the Ion should be found in the background spectra. If not provided the entire run is used.
      • Number from: The RT from value of the range.
      • Number to: The RT to value of the range.

    
    					
    //Example 1
    var refIons = new Array();
    refIons[0] = new Object();
    refIons[0].formula = "C7H6O2";
    //The following lines are optional
    refIons[0].foreground = new Object();
    refIons[0].foreground.from = 5.2
    refIons[0].foreground.to = 7.3
    refIons[0].background = new Object();
    refIons[0].background.from = 4.5
    refIons[0].background.to = 6.8
    
    refIons[1] = new Object();
    refIons[1].formula = "CeI";
    //The following lines are optional
    refIons[1].foreground = new Object();
    refIons[1].foreground.from = 1.0
    refIons[1].foreground.to = 2.0
    refIons[1].background = new Object();
    refIons[1].background.from = 0.5
    refIons[1].background.to = 1.3
    //Example 2 same object as previous but using JSON syntax
    var refIons2 = [
    	{
    		"formula" : "C7H6O2",
    		"foreground" : { "from" : 5.2, "to" : 7.3 },
    		"background" : { "from" : 4.5, "to" : 6.8 },
    	},
    	{
    		"formula" : "CeI",
    		"foreground" : { "from" : 1.0, "to" : 2.0 },
    		"background" : { "from" : 0.5, "to" : 1.3 },
    	},
    ];
    				
    				
  • String aAdduct [optional]

    - Specify an adduct using proper atomic or chemical formulas without charge notation.

  • String aLoss [optional]

    - Specify a loss using proper atomic or chemical formulas without charge notation.

See also: applyMSBackgroundSubtraction aRTIndex parameter, applyUVBackgroundSubtraction aRTIndex parameter

alignTracesRT (Number aOldRT, Number aNewRT, Number aPlotIndex) : Boolean

Aligns external traces retention times


List of parameters:
  • Number aOldRT

    - A retention time in minutes to be aligned

  • Number aNewRT

    - The new value in minutes to be set to the retention time to be aligned.

  • Number aPlotIndex

    - A plot index from 0 to plotsCount - 1

alignTracesRT (Number aOldRT, Number aNewRT, String aPlotId) : Boolean

Aligns external traces retention times


List of parameters:
  • Number aOldRT

    - A retention time in minutes to be aligned

  • Number aNewRT

    - The new value in minutes to be set to the retention time to be aligned.

  • String aPlotId

    - The plot id

alignTracesRT (Array aOldRTs, Array aNewRTs, Number aPlotIndex) : Boolean

Aligns external traces retention times


List of parameters:
  • Array aOldRTs

    - An array of retention times in minutes

  • Array aNewRTs

    - An array of retention times in minutes.

  • Number aPlotIndex

    - A plot index from 0 to plotsCount - 1

alignTracesRT (Array aOldRTs, Array aNewRTs, String aPlotId) : Boolean

Aligns external traces retention times


List of parameters:
  • Array aOldRTs

    - An array of retention times in minutes

  • Array aNewRTs

    - An array of retention times in minutes.

  • String aPlotId

    - The plot id

appendDataset (String aDatasetIdOrFile)

Appends a MS dataset


List of parameters:
  • String aDatasetIdOrFile

    - A string containing either a dataset UUID from the same document or a path to a mass dataset to be opened.

applyAutomaticTraceAlignment ()

Applies an automatic trace aligment to all opened traces using the current alignment parameters

applyMSBackgroundSubtraction (MassItem aBackgroundMassItem, Number aForeInjectionIndex, Number aForeFunctionIndex, Number aBackInjectionIndex, Number aBackFunctionIndex, [Object aRTIndex]) : Boolean

Computes a MS background subtraction given the MS background spectra —aBackgroundMassItem(aBackInjectionIndex,aBackFunctionIndex)—, the MS foreground spectra —this MassItem(aForeInjectionIndex,aForeFunctionIndex)— and the retention times indes —aRTIndex—.


List of parameters:
  • MassItem aBackgroundMassItem

    - A mass item containing the MS background spectra

  • Number aForeInjectionIndex

    - The injection index for the MS foreground spectra. The zero based index for the injection where the spectra to be subtracted is contained

  • Number aForeFunctionIndex

    - The function index for the MS foreground spectra. The zero based index for the function inside the injection where the spectra to be subtracted is contained

  • Number aBackInjectionIndex

    - The injection index for the MS background spectra. The zero based index for the injection where the spectra to subtract is contained

  • Number aBackFunctionIndex

    - The function index for the MS background spectra. The zero based index for the function inside the injection where the spectra to subtract is contained

  • Object aRTIndex [optional]

    - The retention time index. It's a map between foreground retention times and background retention times used to align the foreground with the background spectra collections. If omitted both spectra collections are assumed aligned. The object must follow the next definition:

    • Array foreground: An array of numbers representing the retention times in minutes.
    • Array background: An array of numbers representing the retention times in minutes.
    The arrays must be the same size and each must be in strictly increasing order (They will be sorted to meet this). If the arrays are empty, background time is identical to foreground time. If there is one entry then background time is computed by adding a delta to foreground time. Otherwise linear interpolation and extrapolation are used to determine the background time.

    
    					
    // Example syntax 1:
    var rtIndex1 = new Object();
    rtIndex1.foreground = [0.5, 4.5];
    rtIndex1.background = [5.0, 10.0];
    // Example syntax 2:
    var rtIndex2 = { "foreground" : [0.5, 4.5], "background" : [5.0, 10.0] };
    				
    				

    See also: alignForBackgroundSubtraction

applyUVBackgroundSubtraction (MassItem aBackgroundMassItem, Number aForeInjectionIndex, Number aBackInjectionIndex, [Object aRTIndex]) : Boolean

Computes an UV background subtraction given the background UV spectra —aBackgroundMassItem(aBackInjectionIndex)—, the foreground UV spectra —this MassItem(aForeInjectionIndex)— and the retention times indes —aRTIndex—.


List of parameters:
  • MassItem aBackgroundMassItem

    - A mass item containing the UV background spectra

  • Number aForeInjectionIndex

    - The injection index for the UV foreground spectra. The zero based index for the injection where the spectra to be subtracted is contained

  • Number aBackInjectionIndex

    - The injection index for the UV background spectra. The zero based index for the injection where the spectra to subtract is contained

  • Object aRTIndex [optional]

    See also: applyMSBackgroundSubtraction aRTIndex parameter

assign (String aMoleculeDataID, Object aFeature, [String aPlotId]) : String

Assign a molecule to either a chromatographic peak or a RT value/range. Returns the assignment id on success.


List of parameters:
  • String aMoleculeDataID

    - The moledule ID

    See also: Molecule.moleculeId, PageItem.dataId

  • Object aFeature

    - An object which represents the assigned feature either a chromatographic peak:

    { "peakIndex" : 1 }
    or a RT value:
    { "rt": 2.5 }
    or a RT range:
    { "fromRT": 2.0, "toRT": 2.5 }
    or both:
    { "fromRT": 2.0, "toRT": 2.5, "rt": 2.2 }

  • String aPlotId [optional]

    - The selected plot id. If not specified the active plot will be used. Must be a chromatogram plot

assignments ([String aPlotId]) : Array

Return the list of assignmets for this item, or, if provided, for a chromatogram. Returns a list of objects like:

					
{
"Uuid" : "{896e1053-c19d-4647-afbf-a2fdbf2a7e26}", "FromRT" : 2.0, "RT" : 2.2, "ToRT" : 2.4,
"MolUuid" : "{b0459a5c-c90c-4b80-a3f3-5a596a5d8e1e}",
"Origin" : {
"DatasetUuid" : "{0e4f5003-7813-4aad-965e-7816860827be}",
"InjectionIndex" : 0,
"FunctionIndex" : 0,
"TraceIndex" : -1
},
"Features": 0,
"Label" : ""
}
					
				


List of parameters:
  • String aPlotId [optional]

    - The selected plot id.

calculatePeakPurity (String aPlotId, Number aFromRT, [Number aToRT]) : Object

Exctracts the ion chromatogram for the highest masses for the mass spectra under the provided retention time range/point for the chromatogram identified by aPlotId. It returns the peak purity result object for the provided plot (MassItemPlot.peakPurityResult).


List of parameters:
  • String aPlotId

    - The chromatogram plot id to be used. If the plot is not a valid chromatogram an error is returned.

  • Number aFromRT

    - A retention time in minutes

  • Number aToRT [optional]

    - A retention time in minutes. If not provided the caculus is done with a point instead of a range.

chargeStateDeconvolution ([String aPlotID]) : MassItemPlot

Calculate the charge state deconvolution of a mass spectrum. The resulting deconvoluted mass spectrum will be either appended or will substitute the selected one regarding the value of MassItemplot.appendSelected. If the function fails either an exception or an invalid value will be returned.


List of parameters:
  • String aPlotID [optional]

    - The plot id for the mass spectrum plot you want to use. If no parameter is specified the active one will be used

    See also: MassItemplot.id

See also: MassItemplot.appendSelected

clearMSBackgroundSubtraction (Number aInjectionIndex, Number aFunctionIndex)

Clears a MS background subtractrion previousy done with applyMSBackgroundSubtraction.


List of parameters:
  • Number aInjectionIndex

    - The injection index. The zero based index for the injection where the spectra to be cleared is contained

  • Number aFunctionIndex

    - The function index. The zero based index for the function inside the injection where the spectra to be cleared is contained

clearPeakPurity ([String aPlotId])

Deletes the peak purity result for a given plot or to all plots


List of parameters:
  • String aPlotId [optional]

    - The chromatogram plot id to be used. If the plot is not a valid chromatogram an error is returned. If the plot id is not provided, the result is deleted in all chromatograms

clearUVBackgroundSubtraction (Number aInjectionIndex)

Clears an UV background subtractrion previousy done with applyUVBackgroundSubtraction.


List of parameters:
  • Number aInjectionIndex

    - The injection index. The zero based index for the injection where the spectra to be cleared is contained

correctTraceBaseline (Object aSettings, [String aPlotId])

Corrects the baseline to a trace


List of parameters:
  • Object aSettings

    - The baseline correction settings to apply. An object like:

    						
    {
    "Filter" : -1,
    "Lambda" : -1
    }
    						
    					
    • Filter is a positive integer value. Set it to <= 0 to apply an automatic value.
    • Lambda is a positive interger. Set it to < 0 to apply an automatic value.

    See also: MassItemPlot.appliedBCSettings

  • String aPlotId [optional]

    - The selected plot id. If not specified the active plot will be used. Must be a chromatogram plot

deleteOverlaidPlot (String aOverlaidPlotId, [String aPlotId])

Delete an overlaid plot.


List of parameters:
  • String aOverlaidPlotId

    - A plot id which will be removed from the selected plot.

  • String aPlotId [optional]

    - The selected plot id from where plots will be removed. If not specified the active plot will be used.

deletePlot (Number aPlotIndex) : Boolean

Deletes the plot for the given plot index and returns true on succeed (otherwise false)


List of parameters:
  • Number aPlotIndex

    - A plot index from 0 to plotsCount - 1

deletePlot (String aPlotId) : Boolean

Deletes the plot for the given plot index and returns true on succeed (otherwise false)


List of parameters:

dumpChromatogramMSSpectraToCSV (String aOutFilename, [String aPlotId])

Given a mass chromatogram and an output file name, dumps the mass spectra conforming that chromatogram to CSV format


List of parameters:
  • String aOutFilename

    - The output file name where the CSV will be writen

  • String aPlotId [optional]

    - The mass chromatogram plot id to be used. If the selected plot is not a valid mass chromatogram an error is thrown.

dumpChromatogramUVSpectraToCSV (String aOutFilename, [String aPlotId])

Given a DAD chromatogram and an output file name, dumps the DA spectra conforming that chromatogram to CSV format


List of parameters:
  • String aOutFilename

    - The output file name where the CSV will be writen

  • String aPlotId [optional]

    - The DAD chromatogram plot id to be used. If the selected plot is not a valid DAD chromatogram an error is thrown.

extractOverlaidPlot (String aOverlaidPlotId, [String aPlotId])

Extracts an overlaid plot to a new plot.


List of parameters:
  • String aOverlaidPlotId

    - A plot id which will be extracted from the selected overlaid plot.

  • String aPlotId [optional]

    - The selected plot id from where plots will be extracted. If not specified the active plot will be used.

findragmentIonSpectrum (String aPlotId) : Boolean

Finds the fragmentation ion spectrum for a given mass spectrum. If found, true is returned and the new spectrum is added to the item.


List of parameters:
  • String aPlotId

    - The mass spectrum plot id to be used. If the selected plot is not a valid spectrum an error is thrown.

findragmentIonSpectrum (Number aPlotIndex) : Boolean

Finds the fragmentation ion spectrum for a given mass spectrum. If found, true is returned and the new spectrum is added to the item.


List of parameters:
  • Number aPlotIndex

    - The mass spectrum plot index from 0 to plotsCount - 1. If the selected plot is not a valid spectrum an error is thrown.

hidePlot (Number aPlotIndex) : Boolean

Hides the plot for the given plot index and returns true on succeed (otherwise false)


List of parameters:
  • Number aPlotIndex

    - A plot index from 0 to plotsCount - 1

hidePlot (String aPlotId) : Boolean

Hides the plot for the given plot index and returns true on succeed (otherwise false)


List of parameters:

movePlot (Number aSrcPlotIndex, Number aDstPlotIndex) : Boolean

Moves the plot for the given plot index to another position given by another index and returns true on succeed (otherwise false)


List of parameters:
  • Number aSrcPlotIndex

    - The source plot index from 0 to plotsCount - 1

  • Number aDstPlotIndex

    - The destination plot index from 0 to plotsCount - 1

movePlot (Number aSrcPlotId, Number aDstPlotId) : Boolean

Moves the plot for the given plot id to the position of another plot given by its plot id and returns true on succeed (otherwise false)


List of parameters:
  • Number aSrcPlotId

    - The source plot id

  • Number aDstPlotId

    - The destination plot id

newChromatogram (Object aChromDef, [String aDatasetId]) : Boolean

Opens a new chromatogram


List of parameters:
  • Object aChromDef

    - An object which describes the kind of chromatogram we want to open. See the example below

  • String aDatasetId [optional]

    - The dataset UUID selected to generate the chromatogram. If not specified, the first dataset will be used.


				
function test_NewChromatogram()
{
	var msItem = mass.activeItem();
	if( msItem != undefined ) {
		// Open a TIC (Total Ion Current chromatogram):
		// method 1:
		var parm1 = new Object();
		parm1.injectionIndex = 0;
		parm1.functionIndex = 0;
		// Open TIC for function 0 of injection 0
		msItem.newChromatogram(parm1);

		//method2:
		var parm2 = new Object();
		parm2.injectionIndex = 0;
		parm2.functionIndex = 0;
		parm2.type = "TIC";
		// Open TIC for function 0 of injection 0
		msItem.newChromatogram(parm2);

		// Open a BPC (Base Peak Chromatogram):
		var parm3 = new Object();
		parm3.injectionIndex = 0;
		parm3.functionIndex = 0;
		parm3.type = "BPC";
		// Open BPC for function 0 of injection 0
		msItem.newChromatogram(parm3);

		// Open a chromatogram for a given m/z value
		var parm4 = new Object();
		parm4.injectionIndex = 0;
		parm4.functionIndex = 0;
		parm4.type = "Mass";
		parm4.fromMZ = 20.0;
		// Following two parameters are optional.
		// If not specifed current merge tolerance will be used.
		parm4.tolerance = 10.0;
		parm4.units = "ppm" // 'Da', 'ppm'. If not specified Da are assumed
		// Open EIC for function 0 of injection 0
		// for m/z value 20.0 with a 10 ppm tolerance
		msItem.newChromatogram(parm4);

		// Open a chromatogram for a given m/z range
		var parm5 = new Object();
		parm5.injectionIndex = 0;
		parm5.functionIndex = 0;
		parm5.type = "Mass";
		parm5.fromMZ = 20.0;
		parm5.toMZ = 40.0;
		// Open EIC for function 0 of injection 0 for m/z range [ 20.0, 40.0 ]
		msItem.newChromatogram(parm5);

		// Open a DAD Total absorbance chromatogram
		var parm6 = new Object();
		parm6.injectionIndex = 0;
		parm6.traceIndex = "DAD";
		parm6.type = "TABS";
		msItem.newChromatogram(parm6);

		// Open a DAD chromatogram for a given wavelength
		var parm7 = new Object();
		parm7.injectionIndex = 0;
		parm7.traceIndex = "DAD";
		parm7.type = "UV";
		parm7.fromWaveLength = 250; //In nm
		parm7.tolerance = 0.5; //In nm. Optional, if not specified, 0.5 used
		msItem.newChromatogram(parm7);

		// Open a DAD chromatogram for a wavelength range
		var parm8 = new Object();
		parm8.injectionIndex = 0;
		parm8.traceIndex = "DAD";
		parm8.type = "UV";
		parm8.fromWaveLength = 200; //In nm
		parm8.toWaveLength = 300; //In nm
		msItem.newChromatogram(parm8);

		// Open a chromatogram for a list of masses
		var parm9 = new Object();
		parm9.injectionIndex = 0;
		parm9.functionIndex = 0;
		parm9.type = "Mass";
		parm9.masses = [20.0, 25.0];
		// Following two parameters are optional.
		// If not specifed current merge tolerance will be used.
		parm9.tolerance = 10.0;
		parm9.units = "ppm" // 'Da', 'ppm'. If not specified Da are assumed
		// Open EIC for function 0 of injection 0
		// for m/z values 20.0 and 25.0 with a 10 ppm tolerance
		msItem.newChromatogram(parm9);

		// Open a chromatogram for a list of ranges
		var parm10 = new Object();
		parm10.injectionIndex = 0;
		parm10.functionIndex = 0;
		parm10.type = "Mass";
		parm10.mass_ranges = [{"from": 20.0, "to":25.0}, {"from": 40.0, "to":45.0}];
		// Open EIC for function 0 of injection 0
		// for m/z ranges [20.0, 25.0] and [40.0, 45.0]
		msItem.newChromatogram(parm10);

		msItem.update();
	}
}
			
			

overlayPlots (Array aPlotIds, [String aPlotId])

Superimpose several plots into the same plot.


List of parameters:
  • Array aPlotIds

    - An array of plot ids which will be removed as item plots and superimposed into the selected plot.

  • String aPlotId [optional]

    - The selected plot id where plots will be superimposed. If not specified the active plot will be used.

plot ([Number aPlotIndex]) : MassItemPlot

Returns a mass plot object.


List of parameters:
  • Number aPlotIndex [optional]

    - A plot index from 0 to plotsCount - 1. If no parameter is specified the active one will be returned

    See also: plotsCount

plot ([String aPlotID]) : MassItemPlot

Returns the mass plot object with the given ID.


List of parameters:

plotByType (MassItem.DataTypes aType) : MassItemPlot

Returns a mass plot object for a given type


List of parameters:

removeAssignments ([Array aIdsList])

Removes a list of assignments or all if no list is provided


List of parameters:
  • Array aIdsList [optional]

    - A list of strings containing the assigment IDs to be removed.

removeDataset (String aDatasetId)

Removes a MS dataset


List of parameters:
  • String aDatasetId

    - A string containing a dataset UUID to be removed.

selectMolMatchResult (Number aIndex) : Boolean

Selects a molecular match result


List of parameters:

selectSpectra (MassItemPlot aChromPlot, Number aRT, [Boolean aSubtract = false]) : Boolean

Selects a single spectrum from a chromatogram to be shown/subtracted. Returns true/false when succeed/fail the operation.


List of parameters:
  • MassItemPlot aChromPlot

    - The source chromatogram plot object

  • Number aRT

    - The chromatogram retention time from we want to select a spectrum

  • Boolean aSubtract [optional]

    - A boolean flag. If true the selected spectrum will be subtracted to an existent spectrum. If false (default value) the normal behaviour will be performed.


				
function test_SpecSelection()
{
	var msItem = mass.activeItem();
	if( msItem != undefined ) {
		var tic = msItem.plot(0);
		var ok = msItem.selectSpectra(tic, 8.263);
		print(ok);
		ok = msItem.selectSpectra(tic, 9.0, true);
		print(ok);

		msItem.update();
	}
}
			
			

selectSpectra (MassItemPlot aChromPlot, Number aStartRT, Number aEndRT, [Boolean aSubtract = false]) : Boolean

Selects a spectra range from a chromatogram to be shown/subtracted. Returns true/false when succeed/fail the operation.


List of parameters:
  • MassItemPlot aChromPlot

    - The source chromatogram plot object

  • Number aStartRT

    - The starting chromatogram retention time

  • Number aEndRT

    - The ending chromatogram retention time

  • Boolean aSubtract [optional]

    - A boolean flag. If true the selected spectrum will be subtracted to an existent spectrum. If false (default value) the normal behaviour will be performed.


				
function test_SpecSelection()
{
	var msItem = mass.activeItem();
	if( msItem != undefined ) {
		var tic = msItem.plot(0);
		var ok = msItem.selectSpectra(tic, 8.0, 9.0);
		print(ok);
		ok = msItem.selectSpectra(tic, 8.3, 9.0, true);
		print(ok);

		msItem.update();
	}
}
			
			

selectUVSpectra (MassItemPlot aChromPlot, Number aRT) : Boolean

Selects a single UV spectrum from an UV chromatogram to be shown. Returns true/false when succeed/fail the operation.


List of parameters:
  • MassItemPlot aChromPlot

    - The source chromatogram plot object

  • Number aRT

    - The chromatogram retention time from we want to select an UV spectrum

selectUVSpectra (MassItemPlot aUVChromPlot, Number aStartRT, Number aEndRT) : Boolean

Selects an UV spectra range from an UV chromatogram to be shown. Returns true/false when succeed/fail the operation.


List of parameters:
  • MassItemPlot aUVChromPlot

    - The source chromatogram plot object

  • Number aStartRT

    - The starting chromatogram retention time

  • Number aEndRT

    - The ending chromatogram retention time

setActiveFunction (Number aInjectionIndex, Number aFunctionIndex, [String aDatasetId]) : Boolean

Sets the default function index for a given injection and injection


List of parameters:
  • Number aInjectionIndex

    - An integer specifying the injection index.

  • Number aFunctionIndex

    - An integer specifying the function index to be used as the default one.

  • String aDatasetId [optional]

    - The dataset id. If not specified the first dataset will be used.

setActivePlot ([Number aPlotIndex]) : Boolean

Sets the active plot and returns true on success.


List of parameters:
  • Number aPlotIndex [optional]

    - A plot index from 0 to plotsCount - 1.

    See also: plotsCount

setActivePlot ([String aPlotID]) : Boolean

Sets the active plot and returns true on success.


List of parameters:

setAssignmentLabel (String aAssignmentId, String aLabel)

Sets an assignment label


List of parameters:
  • String aAssignmentId

    - The assigment IDs to be edited.

  • String aLabel

    - The label

setOverlaidPlotCustomColor (String aOverlaidPlotId, String aColor, [String aPlotId])

Sets the custom color used to display the overlaid plot. NOTE: The selected plot must have the color mode property set to 'Custom'


List of parameters:
  • String aOverlaidPlotId

    - A plot id for which its color will be changed.

  • String aColor

    - The color to set like "#RRGGBB".

  • String aPlotId [optional]

    - The selected plot id to which superimposed chromatogram belongs. If not specified the active plot will be used.

showPlot (Number aPlotIndex) : Boolean

Shows the plot for the given plot index and returns true on succeed (otherwise false)


List of parameters:
  • Number aPlotIndex

    - A plot index from 0 to plotsCount - 1

showPlot (String aPlotId) : Boolean

Shows the plot for the given plot index and returns true on succeed (otherwise false)


List of parameters:



MassItemInfo

The object wich holds the "MS browser" information for a given MassItem

Table of contents

  1. Properties

Properties

Name Type Comments
injections MassInjectionsInfo [read-only]
valid Boolean [read-only]

injections : MassInjectionsInfo [read-only]

A set of objects holding the injections information

valid : Boolean [read-only]

It says if the object contains valid info (true) or not (false)




MassItemParameters

The mass item parameters object

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
parameters Object [read-only]

parameters : Object [read-only]

It returns an object where each property is named as a mass item parameter and the property's value is the same as the parameter's value. NOTE: The properties must be accessed using the brackets notation because it could contain spaces and other characters not allowed in conventional dot notation. For example to access to 'Acquired Date' parameter use parameters['Acquired Date'].

Functions

Name Output Parameters
getParameter Variant String aMeaning
parameterMeaning String String aName
parameterName String String aMeaning
setParameter String aMeaning, Variant aValue, [Boolean aForce = False]

getParameter (String aMeaning) : Variant

Returns the parameter value for a given parameter meaning.


List of parameters:
  • String aMeaning

parameterMeaning (String aName) : String

Returns the parameter meaning for a given parameter name as shown in the parameters table.


List of parameters:
  • String aName

parameterName (String aMeaning) : String

Returns the parameter name as shown in the parameters table for a given parameter meaning.


List of parameters:
  • String aMeaning

setParameter (String aMeaning, Variant aValue, [Boolean aForce = False])

Sets the parameter value for a given parameter meaning.


List of parameters:
  • String aMeaning

    - The parameter's meaning.

  • Variant aValue

    - The new parameter's value.

  • Boolean aForce [optional]

    - A boolean flag to force to set the parameter value on non-custom parameters.




MassItemPlot

A mass item's plot

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
appliedBCSettings Object
chromatogramDefinition Object [read-only]
chromatogramRange Object [read-only] [deprecated]
chromatogramType MassItem.ChromatogramType [read-only] [deprecated]
dataPoints Array [read-only]
description String [read-only]
fullScale Object [read-only]
functionIndex Number [read-only]
id String [read-only]
injectionIndex Number [read-only]
minAreaThreshold Number [deprecated]
overlaidChromatogramUuids Array
peakDetectionSettings Object
peakPurityOptions MassChromPeakPurityOptions
peakPurityResult MassChromPeakPurityResult [read-only]
peaks Array [read-only]
pointsCount Number [read-only]
properties MassPlotProperties [read-only]
scale Object [read-only]
specMode String
times Object [read-only]
traceIndex Number [read-only]
type MassItem.DataTypes [read-only]
visible Boolean [read-only]

appliedBCSettings : Object

Returns the applied baseline correction settings or undefined if no correction were applied or when it's not a valid trace chromatogram plot. NOTE: This method is only meaningful for chromatogram trace plots. Check the MassItemPlot's type property and that traceIndex property is >= 0.

See also: MassItem.correctTraceBaseline

chromatogramDefinition : Object [read-only]

Returns a chromatogram definition object suitable to be used as parameter in newChromatogram to recreate the same chromatogram

See also: MassItem.newChromatogram

chromatogramRange : Object [read-only] [deprecated]

The chromatogram range either of masses, for mass chromatograms, or wavelenghts for UV chromatograms. It will return an oject like {from: "", to: ""} and the 'to' property is optional.

See also: chromatogramDefinition

chromatogramType : MassItem.ChromatogramType [read-only] [deprecated]

The chromatogram type if the plot is a chromatogram or Or Unknown if the plot is a spectrum

See also: chromatogramDefinition

dataPoints : Array [read-only]

Returns an array with the data points as objects with two properties 'x' and 'y'


				
function example()
{
	var msItem = mass.activeItem();
	if( msItem != undefined ) {
		var plot = msItem.plot(0);
		var firstPoint = plot.dataPoints[0];
		print("First point is: (" + firstPoint.x + ", " + firstPoint.y + ")");
	}
}
			
			

description : String [read-only]

The plot description (As shown in the MS browser MNova's table)

fullScale : Object [read-only]

The plot full scales object


				
function example()
{
	var msItem = mass.activeItem();
	if( msItem != undefined ) {
		var plot = msItem.plot(0);
		var scale = plot.fullScale;
		print("Horz Scale: [" + scale.horizontal.from + ";" + scale.horizontal.to + "]");
		print("Vert Scale: [" + scale.vertical.from + ";" + scale.vertical.to + "]");
	}
}
			
			

functionIndex : Number [read-only]

The function index where this plot item come from. -1 if it comes from a trace.

See also: MassFunctionsInfo.getItem

id : String [read-only]

An universally unique Identifier (UUID) in string representation to identify the plot.

injectionIndex : Number [read-only]

The injection index where this plot item come from.

See also: MassInjectionsInfo.getItem

minAreaThreshold : Number [deprecated]

The minimum area threshold used for chromatographic automatic peak detection.
NOTE: This method is only meaningfull for chromatogram plots. Check the MassItemPlot's type property.

overlaidChromatogramUuids : Array

An array of strings with the overlaid chromatogram plot ids. NOTE: It's only available in chromatograms showing another superimposed chromatograms.

peakDetectionSettings : Object

The peak detection settings. For chromatograms see MSChromPeakDetectionSettings. For mass spectra this property is invalid.

peakPurityOptions : MassChromPeakPurityOptions

The peak purity settings. NOTE: It's only available in mass chromatograms.

peakPurityResult : MassChromPeakPurityResult [read-only]

The peak purity result. NOTE: It's only available in mass chromatograms.

peaks : Array [read-only]

The plot peaks array. If plot is a chromatogram the array items are of type MassChromPeak objects. Else the items are of type MassPeak

pointsCount : Number [read-only]

Return the number of data points

properties : MassPlotProperties [read-only]

The plot properties

scale : Object [read-only]

The plot scales object


				
function example()
{
	var msItem = mass.activeItem();
	if( msItem != undefined ) {
		var plot = msItem.plot(0);
		var scale = plot.scale;
		print("Horz Scale: [" + scale.horizontal.from + ";" + scale.horizontal.to + "]");
		print("Vert Scale: [" + scale.vertical.from + ";" + scale.vertical.to + "]");
	}
}
			
			

specMode : String

When a charge state deconvolution was done tell which spectrum you wan to show. The normal one, "default" or the deconvoluted one. Undefined if the plot is not a mass spectrum.

Valid values: {"deconvoluted", "default"}

times : Object [read-only]

Returns an Object with two properties "foreTimes" and "backTimes". Each of these properties is an Array of interval objects. Each of these inteval objects has two properties "from" and "to". NOTE: This method is only meaningful for Mass spectrum plots. Check the MassItemPlot's type property.

traceIndex : Number [read-only]

The trace index where this plot item come from. -1 if it comes from a function

See also: MassTracesInfo.getItem

type : MassItem.DataTypes [read-only]

The plot type (chromatogram or spectrum)

visible : Boolean [read-only]

The plot visibility state as visible (true) or hidden (false)

Functions

Name Output Parameters
appendPeak Boolean Number aStartRT, Number aEndRT
appendPeak Boolean Number aFrom, Number aTo, Number aThreshold
clearPeaks
detectPeaks
fitIntensityToHeight
modifyPeak Boolean Number aPeakIndex, Number aStartRT, Number aEndRT
removePeak Boolean Number aPeakIndex
removePeak Boolean Number aStartRT, Number aEndRT
removePeak Boolean Number aFrom, Number aTo, Number aThreshold
retentionTimeToScan Number Number aRT
scanToRetentionTime Number Number aScan
setPeakFillColor Boolean Number aPeakIndex, String aFillColor
setPeakFillColor Boolean Number aStartRT, Number aEndRT, String aFillColor
setPeakLabel Boolean Number aPeakIndex, String aLabel
setPeakLabel Boolean Number aStartRT, Number aEndRT, String aLabel
zoom [String aScale], [Object aRange]

appendPeak (Number aStartRT, Number aEndRT) : Boolean

Appends a chromatographic peak for a given RT range.
NOTE: This method is only available for chromatogram plots. Check the MassItemPlot's type property.


List of parameters:
  • Number aStartRT

    - The starting RT peak position.

  • Number aEndRT

    - The ending RT peak position.

appendPeak (Number aFrom, Number aTo, Number aThreshold) : Boolean

Appends spectrum peaks above a threshold for a given m/z range.
NOTE: This method is only available for spectrum plots. Check the MassItemPlot's type property.


List of parameters:
  • Number aFrom

    - The lower bound of the range.

  • Number aTo

    - The upper bound of the range.

  • Number aThreshold

    - The threshold value.

clearPeaks ()

Clears all the chromatographic peaks.
NOTE: This method is only available for chromatogram plots. Check the MassItemPlot's type property.

detectPeaks ()

Performs an automatic chromatographic peak detection.
NOTE: This method is only available for chromatogram plots. Check the MassItemPlot's type property.

fitIntensityToHeight ()

Fits the intensisty scale to the plot's vertical size

modifyPeak (Number aPeakIndex, Number aStartRT, Number aEndRT) : Boolean

Modify a chromatographic peak by setting a new RT range.
NOTE: This method is only available for chromatogram plots. Check the MassItemPlot's type property.


List of parameters:
  • Number aPeakIndex

    - The index of the peak to be modified.

  • Number aStartRT

    - The starting RT peak position.

  • Number aEndRT

    - The ending RT peak position.

removePeak (Number aPeakIndex) : Boolean

Removes a chromatographic or spectrum peak.
NOTE: This method is only available for chromatogram or spectrum plots. Check the MassItemPlot's type property.


List of parameters:
  • Number aPeakIndex

    - The index of the peak to be removed.

removePeak (Number aStartRT, Number aEndRT) : Boolean

Removes all the chromatographic peak in a RT range.
NOTE: This method is only available for chromatogram plots. Check the MassItemPlot's type property.


List of parameters:
  • Number aStartRT

    - The starting RT range value.

  • Number aEndRT

    - The ending RT range value.

removePeak (Number aFrom, Number aTo, Number aThreshold) : Boolean

Removes all spectrum peaks below a threshold for a given m/z range.
NOTE: This method is only available for spectrum plots. Check the MassItemPlot's type property.


List of parameters:
  • Number aFrom

    - The lower bound of the range.

  • Number aTo

    - The upper bound of the range.

  • Number aThreshold

    - The threshold value.

retentionTimeToScan (Number aRT) : Number

Converts a chromatogram retention time to the closest (>=) scan number. NOTE: This method is only available for chromatogram plots. Check the MassItemPlot's type property.


List of parameters:
  • Number aRT

    - The retention time to convert in minutes.

scanToRetentionTime (Number aScan) : Number

Converts a scan number to the corresponding chromatogram retention time. NOTE: This method is only available for chromatogram plots. Check the MassItemPlot's type property.


List of parameters:
  • Number aScan

    - The scan number to convert from 0 to the total scans count.

setPeakFillColor (Number aPeakIndex, String aFillColor) : Boolean

Set a chromatographic peak fill color.
NOTE: This method is only available for chromatogram plots. Check the MassItemPlot's type property.


List of parameters:
  • Number aPeakIndex

    - The index of the peak to be modified.

  • String aFillColor

    - A color name in the format '#rrggbb' or '#aarrggbb'

setPeakFillColor (Number aStartRT, Number aEndRT, String aFillColor) : Boolean

Set the chromatographic peak fill color in a RT range.
NOTE: This method is only available for chromatogram plots. Check the MassItemPlot's type property.


List of parameters:
  • Number aStartRT

    - The starting RT range value.

  • Number aEndRT

    - The ending RT range value.

  • String aFillColor

    - A color name in the format '#rrggbb' or '#aarrggbb'

setPeakLabel (Number aPeakIndex, String aLabel) : Boolean

Set a peak label.


List of parameters:
  • Number aPeakIndex

    - The index of the peak to be modified.

  • String aLabel

    - The label to set

setPeakLabel (Number aStartRT, Number aEndRT, String aLabel) : Boolean

Set the peak label in a range, RT range for chromatograms and m/z range for mass spectra.


List of parameters:
  • Number aStartRT

    - The starting RT range value.

  • Number aEndRT

    - The ending RT range value.

  • String aLabel

    - The label to set

zoom ([String aScale], [Object aRange])

Performs a zoom operation in the plot. With no parameter at all it sets both scales (vertical and horizontal) to full zoom out.


List of parameters:
  • String aScale [optional]

    - Says which scale will be zoomed. If it's the only provided parameter a full zoom out is performed in the indicated scale (vertical or horizontal).

    Valid values: {"horizontal", "horz", "vert", "vertical"}

  • Object aRange [optional]

    - An object with the following properties: aRange.from and aRange.to. Where from and to are two numbers.




MassLayoutGroupProperties

Table of contents

  1. Properties

Properties

Name Type Comments
dataTypes Number
layout MassLayoutProperties.LayoutTypes
order Number
plotTypes Number
polarity MassLayoutProperties.Polarity

dataTypes : Number

A combination of the values from the MassLayoutProperties Datatypes enumeration.

The kind of layout used to display the plot belonging to this group.

order : Number

An integer value indicating the desired mass order. Set it to 0 to don't filter by the order.

plotTypes : Number

A combination of the values from the MassLayoutProperties PlotTypes enumeration.

One of the values from the MassLayoutProperties Polarity enumeration.




MassLayoutProperties

Enumerations

Name Type Values
DataTypes Number AnyData, DADData, MassData, TracesData
LayoutTypes Number GridHorizontal, GridVertical, Horizontal, Vertical
PlotTypes Number AnyPlot, ChromatogramPlot, MassSpectrumPlot, UVSpectrumPlot
Polarity Number AnyPol, MixedPol, NegativePol, PositivePol

Properties

Name Type Comments
groups Array [read-only]
layout LayoutTypes

groups : Array [read-only]

layout : LayoutTypes

The kind of layout used to display the different layout groups

Functions

Name Output Parameters
addGroup Number Object aGroupDesc
removeGroup Number aIndex

addGroup (Object aGroupDesc) : Number

Adds a group to the groups array and returns the index for the added group or -1 in case of error.


List of parameters:

removeGroup (Number aIndex)

Removes a group for the given index from the groups array. (Note: The default group, at index 0, can't be removed).


List of parameters:
  • Number aIndex

    - The group index to be removed.




MassMolMatch

Contains the molecular match settings and the last molecular match calculation results for a MassItem object

Table of contents

  1. Properties

Properties

Name Type Comments
results Array [read-only]
settings MassMolMatchSettings

results : Array [read-only]

An array of MassMolMatchResult objects.

The molecular match settings




MassMolMatchResult

A molecular match result. NOTE: Some fields could be undefined regarding the molecular match done.

Table of contents

  1. Properties

Properties

Name Type Comments
adduct String [read-only]
functionIndex Number [read-only]
loss String [read-only]
matched Boolean [read-only]
matchedMz Number [read-only]
moleculeId String [read-only]
msDaError Number [read-only]
msPpmError Number [read-only]
polarity MassItem.FunctionPolarity [read-only]
predictedMz Number [read-only]
purity Number [read-only]
retTime Number [read-only]
scan Number [read-only]
score Number [read-only]
similarity Number [read-only]

adduct : String [read-only]

The adduct assumed for this match. NOTE: The property will not be present if matched was false or there is no adduct or MS data was not used.

functionIndex : Number [read-only]

The function index where this result was matched. NOTE: The property will not be present if matched was false.

See also: MassFunctionsInfo.getItem, MassInjectionInfo.functions

loss : String [read-only]

The loss assumed for this match. NOTE: The property will not be present if matched was false or MS data was not used.

matched : Boolean [read-only]

Retrieve the match status ( true: matched, false: not-matched )

matchedMz : Number [read-only]

The matched isotopic cluster base peak m/z value. NOTE: The value could be undefined.

moleculeId : String [read-only]

A string containing the molecule ID used to get the molecule (from the molecules table in the document) for the given result

msDaError : Number [read-only]

The error between the matched and predicted isotope cluster base peaks in Da. NOTE: The value could be undefined.

msPpmError : Number [read-only]

The error between the matched and predicted isotope cluster base peaks in ppm. NOTE: The value could be undefined.

polarity : MassItem.FunctionPolarity [read-only]

The function polarity where this result was matched. NOTE: The property will not be present if matched was false.

See also: MassFunctionInfo.polarity

predictedMz : Number [read-only]

The theoretical or predicted isotopic cluster base peak m/z value. NOTE: The value could be undefined.

purity : Number [read-only]

The best purity score (cluster match, weighted by relative intensity) as a real number from 0 to 1. NOTE: The property will not be present if matched was false or MS data was not used.

retTime : Number [read-only]

The chromatogram peak retention time corresponding to the best-matched chromatogram region. NOTE: The property will not be present if matched was false.

scan : Number [read-only]

The chromatogram peak scan number corresponding to the best-matched chromatogram region. NOTE: The property will not be present if matched was false.

score : Number [read-only]

The combined score for matching against spectra as a real number from 0 (poor matched) to 1 (perfect match). NOTE: The property will not be present if matched was false.

similarity : Number [read-only]

The best similarity score for matching cluster against spectrum as a real number from 0 to 1. NOTE: The property will not be present if matched was false or MS data was not used.




MassMolMatchSettings

The molecular match settings

Properties

Name Type Comments
adductsNeg Array
adductsPos Array
averageSpectraWindow Number
enableDimers Boolean
ignorePrecursors Boolean
maxChargeNeg Number
maxChargePos Number
maxMatchesPerMolecule Number
maxMatchesPerSpectrum Number
ms2SearchFor String
msmsTolerance Number
msTolerance Number
scoreThreshold Number
toleranceUnits String

adductsNeg : Array

An array of adduct/loss pairs for the negative mass spectra

adductsPos : Array

An array of adduct/loss pairs for the positive mass spectra

averageSpectraWindow : Number

The number of spectra to add from left and right to average. 0 means no average is performed.

Valid values: {0, 1, 2, 3, 4, 5}

enableDimers : Boolean

Set to enable consideration of dimers when matching

ignorePrecursors : Boolean

When using MS/MS data, if it's set, the precursor information will be ignored when searching for molecular fragments.

maxChargeNeg : Number

The maximum negative charge states to consider

maxChargePos : Number

The maximum positive charge states to consider

maxMatchesPerMolecule : Number

The maximum number of results per molecule

maxMatchesPerSpectrum : Number

The maximum number of molecules allowed to match a spectrum

ms2SearchFor : String

It tells what to look for when using only MS/MS data: either to search for a molecular ion match (so the MS/MS function would be used as a MS one) or to search for molecular fragments.

Valid values: {"Fragments", "Ion"}

msmsTolerance : Number

The m/z tolerance for matching predicted MS/MS spectra to experimental

msTolerance : Number

The m/z tolerance for matching predicted MS spectra to experimental

scoreThreshold : Number

The match score threshold for acceptable results

toleranceUnits : String

The tolerance units. Either Da or ppm.

Valid values: {"Da", "Ppm"}

Constructors

MassMolMatchSettings ()




MassPeak

A mass spectrum's peak.

Table of contents

  1. Properties

Properties

Name Type Comments
center Object
label String

center : Object

The peak's center position as an object. The position will be hold in object's properties 'x' and 'y'

label : String

The custom peak label set by the user




MassPlotAssignmentProps

An object to set and get the mass items plot's assignment properties

Table of contents

  1. Properties

Properties

Name Type Comments
defaultColor String
elementsVisibility String
font Font
labelPosition String
labelTemplate String
marksVisible Boolean
positionRatio Number
useCompoundColor Boolean
visible Boolean

defaultColor : String

The assignments default color

elementsVisibility : String

Tells which elements are visible

Valid values: {"Both", "Labels", "Ranges"}

font : Font

The assignment label font

labelPosition : String

Describes where the assignment label is placed: Above or below the assignment range

Valid values: {"Above", "Below"}

labelTemplate : String

The label template used to generate the final label using macros

marksVisible : Boolean

The assignment label marks visibility (show: true; hide: false)

positionRatio : Number

The assignments vertical position ratio. A value between 0 and 1, both inclusive

useCompoundColor : Boolean

If true will use the assigned compound color, otherwise the default color will be used.

visible : Boolean

The assignments visibility (show: true; hide: false)




MassPlotAxesProps

An object to set and get the mass item plot's axes properties

Inherits Plot1DAxesProps

Table of contents

  1. Properties

Properties

Name Type Comments
horizontal MassPlotAxisProps
vertical MassPlotAxisProps

horizontal : MassPlotAxisProps

The horizontal axis properties

vertical : MassPlotAxisProps

The vertical axis properties




MassPlotAxisProps

An object to set and get a plot axis properties

Inherits PlotAxisProps

Table of contents

  1. Properties

Properties

Name Type Comments
units String

units : String

The vertical axis units for mass spectrum plots.

Valid values: {"AbsIntensity", "Abundance"}




MassPlotHighlightProps

An object to set and get the mass item plot's highlight properties

Table of contents

  1. Properties

Properties

Name Type Comments
color String
isBoxVisible Boolean
opacity Number

color : String

The highlight color

Valid values: {"#RRGGBB", "Color Keywords"}

isBoxVisible : Boolean

The highlight box area visibility (show: true; hide: false)

opacity : Number

The highlight opacity from 0 (transparent) to 100 (opaque)




MassPlotOverlaidProps

Object to get/set the overlaid settings

Table of contents

  1. Properties

Properties

Name Type Comments
colorMode

colorMode :

The mode used to set the color for the superimposed plots

Valid values: {Brightness, Custom, Hue, Opacity, Saturation, Sequence}




MassPlotPeakPurityHldProps

An object to set and get the mass item plot's peak purity highlight properties

Table of contents

  1. Properties

Properties

Name Type Comments
color String
opacity Number
visible Boolean

color : String

The highlight color

Valid values: {"#RRGGBB", "Color Keywords"}

opacity : Number

The highlight opacity from 0.0 (transparent) to 1.0 (opaque)

visible : Boolean

The highlight visibility (show: true; hide: false)




MassPlotPeakPurityProps

An object to set and get the mass item plot's peak purity properties

Table of contents

  1. Properties

Properties

Name Type Comments
colorMode String
highlight MassPlotPeakPurityHldProps
visible Boolean

colorMode : String

The mode used to set the color for the extracted ion chromatograms

Valid values: {"Brightness", "Hue", "Opacity", "Saturation", "Sequence"}

The peak purity higlight properties

visible : Boolean

The peak purity information visibility (show: true; hide: false)




MassPlotProperties

An object to set and get the mass item plot's properties

Table of contents

  1. Properties
  2. Example

Properties

Name Type Comments
assignments MassPlotAssignmentProps
axes MassPlotAxesProps
background PlotBackgroundProps
chromOverlaid MassPlotOverlaidProps
grid PlotGridProps
highlight MassPlotHighlightProps
line Plot1DLineProps
peakPurity MassPlotPeakPurityProps
peaks PlotMassPeaksProps
title PlotTitleProps

The plot's assignment properties. NOTE: Only available for chromatogram plots

The plot's axes properties

background : PlotBackgroundProps

The plot's background properties

chromOverlaid : MassPlotOverlaidProps

The plot's superimposed chromatogram properties. NOTE: Only available for chromatogram plots

The plot's grid properties

The plot's highlight properties

The plot's line properties

The plot's peak purity properties. NOTE: Only available for chromatogram plots

The plot's peaks properties

The plot's title properties

Example:




MassPlugin

The Mass plug-in object

Table of contents

  1. Constructors
  2. Functions

Constructors

MassPlugin (MassPlugin aMassPlugin)

Functions

Name Output Parameters
activeItem MassItem
changeDatasetFileName Boolean String aFileName, MassItem aMassItem, [String aDataseId]
elementalComposition Boolean MassItem aMassItem, [Number aPlotIndex], Number aMZValue
exportChromatograms Array MassItem aMassItem, [Number aPlotIndex]
fetchFullDataset MassItem aMassItem
loadParametersCustomization Boolean String aFileName, [String aFileFormat]
moleculeMatch Boolean MassItem aMassItem
moleculeMatch Boolean MassItem aMassItem, Array aFormula
predict MassItem String aFormula, String aAdduct, String aLoss, Number aResolution, String aResolutionUnits
relativeElementalComposition Boolean MassItem aMassItem, Number aMZDelta
releaseFullDataset MassItem aMassItem
showMoleculeMatchSettingsDialog [Widget aParentWidget], [MassMolMatchSettings aSettingsObj]

activeItem () : MassItem

Returns the active mass item

changeDatasetFileName (String aFileName, MassItem aMassItem, [String aDataseId]) : Boolean

Changes the dataset file name for a given MassItem


List of parameters:
  • String aFileName

    - The new file name

  • MassItem aMassItem

    - The mass item to be altered

  • String aDataseId [optional]

    - The dataset UUID to be changed. If not specified the first one will be used

elementalComposition (MassItem aMassItem, [Number aPlotIndex], Number aMZValue) : Boolean

Performs a elemental composition in a mass spectrum.


List of parameters:
  • MassItem aMassItem
  • Number aPlotIndex [optional]

    - An integer number indicating the MassItem plot from 0 to plotsCount - 1. The plot must be a mass spectrum. The parameter is optional, if it's not specified then the fitness is not calculated for each result.

  • Number aMZValue

    - The desired m/z value.


				
function print_Results( res )
{
	print("==== Elemental Composition Results ====");
	for(var i=0; i&lt;res.length; i++) {
		var cur = res[i];
		print("Result " + (i+1) + ":");
		print("  formula: " + cur.formula);
		print("  calc. mass: " + cur.mass);
		print("  double bond equiv: " + cur.dbe);
		print("  abs. error: " + cur.absErr);
		print("  error (mDa): " + cur.mDaErr);
		print("  error (ppm): " + cur.ppmErr);
		print("  fitness: " + cur.fitness);
		print("");
	}
}

function test_MassElementalComposition()
{
	// 1st open your mol/sdf files containing the molecules to match
	var msItem = mass.activeItem();
	if( msItem != undefined ) {
			var selPlot = 0;
			var mzValue = 0;
			// Selects the plot and the m/z value
			print("Selected item has: " + msItem.plotsCount + "plots.");
			for(i=0; i&lt;msItem.plotsCount; ++i) {
				var plot = msItem.plot(i);
				// Selects the first mass spectrum
				if( plot.type == MassItem.DataTypes.Spectrum ) {
					selPlot = i;
					// Selects the highest peak
					var plotPeaks = msItem.plot(selPlot).peaks;
					if(plotPeaks.length > 0) {
						var max = 0;
						for(j=1; j&lt;plotPeaks.length; ++j) {
							if( plotPeaks[j].center.y &gt; plotPeaks[max].center.y )
							max = j;
						}
						mzValue = plotPeaks[max].center.x;
					}
					break;
				}
			}
		print("Selected plot: " + selPlot + " Selected m/z: " + mzValue);
		var ok = mass.elementalComposition(msItem, selPlot, mzValue);
		if( ok )
			print_Results(msItem.elementalComp.results);
	}
}
			
			

exportChromatograms (MassItem aMassItem, [Number aPlotIndex]) : Array

Export either all the chromatograms or the one given by aPlotIndex to be a ChromatogramItem. Returns an array with the created item ids.


List of parameters:
  • MassItem aMassItem
  • Number aPlotIndex [optional]

    - An integer number indicating the MassItem plot from 0 to plotsCount - 1. The plot must be a chromatogram. The parameter is optional, if it's not specified then all item chromatograms will be exported.

fetchFullDataset (MassItem aMassItem)

Embeds the full dataset contents into the item


List of parameters:

See also: releaseFullDataset

loadParametersCustomization (String aFileName, [String aFileFormat]) : Boolean

Loads a parameter customization file associated to the file format and sets it as default.


List of parameters:
  • String aFileName
  • String aFileFormat [optional]

moleculeMatch (MassItem aMassItem) : Boolean

Performs a molecular match for a given MassItem using the current molecules table


List of parameters:

				
function print_MolMatchResults( res )
{
	print("=== Molecular Match Results ===");
	for(var i=0; i &lt; res.length; i++) {
		var cur = res[i];
		print("Result " + (i+1) + ":");
		print("  molID: " + cur.moleculeId);
		var mol = new Molecule( mainWindow.activeDocument.getMolTableItem(cur.moleculeId) );
		print("  molFormula: " + mol.molecularFormula());
		print("  molWeight: " + mol.molecularWeight());
		print("  matched: " + cur.matched);
		if( cur.matched ) {
			print("  score: " + cur.score);
			print("  similarity: " + cur.similarity);
			print("  purity: " + cur.purity);
			print("  RT: " + cur.retTime);
			print("  scan: " + cur.scan);
		}
		print("");
	}
}

function test_MassMolMatch()
{
	// 1st open your mol/sdf files containing the molecules to match
	var msItem = mass.activeItem();
	if( msItem != undefined ) {
		var ok = mass.moleculeMatch(msItem);
		if( ok )
			print_MolMatchResults(msItem.molMatch.results);
	}
}
			
			

moleculeMatch (MassItem aMassItem, Array aFormula) : Boolean

Performs a molecular match for a given MassItem and given molecular formulas


List of parameters:
  • MassItem aMassItem
  • Array aFormula

    - An array of strings containing molecular formulas like C15H16Si

predict (String aFormula, String aAdduct, String aLoss, Number aResolution, String aResolutionUnits) : MassItem

Predicts a mass spectrum given a formula, an adduct/loss and a resolution. On succeed it returns a MassItem containing the predicted spectrum. On fail, an invalid value is returned


List of parameters:
  • String aFormula

    - The formula to predict.

  • String aAdduct

    - The adduct fomula or an empty string if there is no adduct.

  • String aLoss

    - The loss formula or an empty string if there is no loss.

  • Number aResolution

    - The resolution in the given units

  • String aResolutionUnits

    - The resolution units

    Valid values: {"Dalton", "Ppm"}


				
function predict_example()
{
	var curPage = mainWindow.activeDocument.curPage();
	var predItem = mass.predict("C22H34N4O3","H+","",2.0,"Ppm");
	if(predItem) {
		curPage.addItem(predItem);
		curPage.update();
	}
}
			
			

relativeElementalComposition (MassItem aMassItem, Number aMZDelta) : Boolean

Performs a elemental composition for a relative m/z value using the relative settings.


List of parameters:
  • MassItem aMassItem
  • Number aMZDelta

    - The desired m/z value.

releaseFullDataset (MassItem aMassItem)

Detaches full dataset contents from the item


List of parameters:

See also: fetchFullDataset

showMoleculeMatchSettingsDialog ([Widget aParentWidget], [MassMolMatchSettings aSettingsObj])

Shows the molecule match settings dialog. Regarding if the second parameter aSettingsObj is passed, the dialog, either will show the default parameters and, if OK is pressed, it will update the default settings. Or it will show the passed settings and if OK is pressed, the passed settings will be updated acordingly to what the user sets in the dialog.


List of parameters:
  • Widget aParentWidget [optional]

    - The parent widget of the dialog. If not specified the main window will be used.

  • MassMolMatchSettings aSettingsObj [optional]

    - An object containing the molecule match settings you want to display in the dialog. If not specified the default ones will be used.




MassTraceInfo

An object holding info about a mass trace

Table of contents

  1. Properties

Properties

Name Type Comments
index Number [read-only]
name String [read-only]

index : Number [read-only]

The trace index in the MassTracesInfo object

name : String [read-only]

The trace name as shown in the "MS browser"




MassTracesInfo

Contains one or several MassTraceInfo objects

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
count Number [read-only]
hasDAD Boolean [read-only]

count : Number [read-only]

The number of traces

hasDAD : Boolean [read-only]

True if there is Diode Array Data present. False otherwise.

Functions

Name Output Parameters
getItem MassTraceInfo Number aIndex

getItem (Number aIndex) : MassTraceInfo

Gets and trace object from the traces set


List of parameters:
  • Number aIndex

    - An index between 0 and count - 1




MassVerifyPeakDetectionSettings

The chromatographic peak detection settings used for verification

Table of contents

  1. Properties

Properties

Name Type Comments
exclusionRegions MSChromPeakDetectionExclusionRegs
minAreaThreshold Number
widPeaks Bool

An object describing the exclusion regions

minAreaThreshold : Number

The minimum area threshold

widPeaks : Bool

If true, the peak detection will try to find wider peaks (merging adjacent peaks, for example) that if it's false.




MassVerifySettings

The MS verification settings

Table of contents

  1. Properties

Properties

Name Type Comments
majorPeakMinAreaRatio Number
peaks MassVerifyPeakDetectionSettings
rtTolerance Number
traces MassVerifyTraceSettings

majorPeakMinAreaRatio : Number

The minimum area ration that a chromatographic peak must have to be considered a major peak

The chromatographic peak detection settings

rtTolerance : Number

The retention time (RT) tolerance in minutes to match peaks from traces to MS chromatograms

The settings related with traces




MassVerifyTraceSettings

The MS verification settings related with traces

Table of contents

  1. Properties

Properties

Name Type Comments
keywordsCLND Array
keywordsELSD Array
keywordsUV Array
useCLND Boolean
useELSD Boolean
useUV Boolean

keywordsCLND : Array

An array of strings which are the keywords used to identify the traces. If any of the keywords mathces the trace name, then is considered an CLND trace.

keywordsELSD : Array

An array of strings which are the keywords used to identify the traces. If any of the keywords mathces the trace name, then is considered an ELSD trace.

keywordsUV : Array

An array of strings which are the keywords used to identify the traces. If any of the keywords mathces the trace name, then is considered an UV trace.

useCLND : Boolean

Indicates if the CLND trace is used in the verification

useELSD : Boolean

Indicates if the ELSD trace is used in the verification

useUV : Boolean

Indicates if the UV trace is used in the verification




Menu

Wrapper to QMenu.

Constructors

Menu ()

Functions

Name Output Parameters
addAction Action String aActionName, String aIconPath
addSeparator

addAction (String aActionName, String aIconPath) : Action

Adds an action to the menu, and returns the Action object needed for connecting the signals.


List of parameters:
  • String aActionName

    - Text that will appear in the action.

  • String aIconPath

    - Path to the icon that will appear in the action.

addSeparator ()

Adds a separator between the previous and next actions.

Example:




MessageBox

The MessageBox object provides a modal dialog with a short message, an icon, and buttons laid out depending on the arguments

Table of contents

  1. Enumerations
  2. Functions

Enumerations

Name Type Values
Buttons Number Abort, Apply, Cancel, Close, Discard, Help, Ignore, No, NoButton, NoToAll, Ok, Open, Reset, RestoreDefaults, Retry, Save, SaveAll, Yes, YesToAll

Functions

Name Output Parameters
critical Buttons String aText, Buttons aButton1, Buttons aButton2, Buttons aButton3, String aTitle
information Buttons String aText, Buttons aButton1, Buttons aButton2, Buttons aButton3, String aTitle
question Buttons String aText, Buttons aButton1, Buttons aButton2, Buttons aButton3, String aTitle
warning Buttons String aText, Buttons aButton1, Buttons aButton2, Buttons aButton3, String aTitle

MessageBox.critical (String aText, Buttons aButton1, Buttons aButton2, Buttons aButton3, String aTitle) : Buttons

Opens a critical message box with the title aTitle, the text aText and the buttons specified. Returns the identity of the button that was activated


List of parameters:
  • String aText
  • Buttons aButton1
  • Buttons aButton2
  • Buttons aButton3
  • String aTitle

MessageBox.information (String aText, Buttons aButton1, Buttons aButton2, Buttons aButton3, String aTitle) : Buttons

Opens an information message box with the title aTitle, the text aText and the buttons specified. Returns the identity of the button that was activated


List of parameters:
  • String aText
  • Buttons aButton1
  • Buttons aButton2
  • Buttons aButton3
  • String aTitle

MessageBox.question (String aText, Buttons aButton1, Buttons aButton2, Buttons aButton3, String aTitle) : Buttons

Opens a question message box with the title aTitle, the text aText and the buttons specified. Returns the identity of the button that was activated


List of parameters:
  • String aText
  • Buttons aButton1
  • Buttons aButton2
  • Buttons aButton3
  • String aTitle

MessageBox.warning (String aText, Buttons aButton1, Buttons aButton2, Buttons aButton3, String aTitle) : Buttons

Opens a warning message box with the title aTitle, the text aText and the buttons specified. Returns the identity of the button that was activated


List of parameters:
  • String aText
  • Buttons aButton1
  • Buttons aButton2
  • Buttons aButton3
  • String aTitle



Molecule

Molecule page item

Inherits PageItem

Properties

Name Type Comments
aliases Array
atomCount Number [read-only]
bondCount Number [read-only]
description String
label String
moleculeId String [read-only]
molName String

aliases : Array

Array of molecule aliases.

atomCount : Number [read-only]

bondCount : Number [read-only]

description : String

The molecule description.

label : String

The label displayed in peaks/multiplets.

moleculeId : String [read-only]

An alias for PageItem.dataId

molName : String

The molecule name.

Constructors

Molecule (Molecule aMolecule)

Functions

Name Output Parameters
addExplicitHydrogens
aromaticAtoms Array
atom Atom Number aIndex
atoms Array
averageMass Number
bond Bond Number aIndex
bonds Array
calcPartialCharges Array
canBeNeutralized Boolean
canBeProtonated Boolean
codeAtomACMC Array Number aIndex
createIUPACName String Boolean aDoSetName = true, Boolean aConvertToHTML = false, Boolean aPasteToDocument = false
detectAromaticAtoms
detectCyclicBonds
diastereotopicDistanceList Array
distanceBetween Number Number atomFrom, Number atomTo
generateInChi String
generateSMILES String
getConformers Array
getMolfile String
getParam Variant String aParamName
getSDFData Variant String aSDFTagName
graphicProperties Object
isAromaticAtom Boolean Number aIndex
isCyclicAtom Boolean Number aIndex
isLabileProton Boolean Number aIndex
makeStereodescriptorsString String
molecularFormula String
monoisotopicMass Number
neutralizeMolecule Boolean
nmrAssignments Array
nmrPrediction Array String aNucleus, Boolean aGrouped
normalizeExplicitHydrogensNumbering
normalizeNumbering
paramNames Array
protonateMolecule Boolean
protonateMoleculeList Array
removeExplicitHydrogens
sdfNames Array
setGraphicProperties Object Object aProperties
setNMRAssignments Array aAtomNMRAssignmentDataArray
setNMRPrediction Object String aNucleus, Array aPredictionObjectArray, Boolean aFillImplicitH
setSDFData Variant String aSDFTagName, String aValue
symmetricalAtoms Array Number aIndex
toString String

addExplicitHydrogens ()

Add explicite hydrogens

See also: removeExplicitHydrogens

aromaticAtoms () : Array

Returns an array with indexes of all aromatic atoms in molecule

See also: detectAromaticAtoms, isAromaticAtom

atom (Number aIndex) : Atom

Returns the Atom object at aIndex


List of parameters:
  • Number aIndex

    - Atom index, from 1 to atomCount

atoms () : Array

Returns array of Atom objects

averageMass () : Number

Returns the average molecular mass as the sum of the average (abundance weighted mean) atomic masses of all the atoms in the molecule

bond (Number aIndex) : Bond

Returns the Bond object at aIndex


List of parameters:
  • Number aIndex

bonds () : Array

Returns array of Bond objects

calcPartialCharges () : Array

Returns an array with atoms partial charges calculated according to Gasteiger algorithm

canBeNeutralized () : Boolean

Returns TRUE if molecule can be neutralized

canBeProtonated () : Boolean

Returns TRUE if molecule can be protonated

codeAtomACMC (Number aIndex) : Array

Returns an array with codes of atom aIndex created according to Atom-Centered Multilayer Code algorithm


List of parameters:
  • Number aIndex

createIUPACName (Boolean aDoSetName = true, Boolean aConvertToHTML = false, Boolean aPasteToDocument = false) : String

Returns string with the IUPAC name of the molecule.


List of parameters:
  • Boolean aDoSetName

    - If true, the molName parameter of the Molecule will be filled with the generated IUPAC name.

  • Boolean aConvertToHTML
  • Boolean aPasteToDocument

    - If true, the IUPAC name will be pasted as text in the current page of the document, with type = "Molecule Property" and subtype = "IUPAC Name".

detectAromaticAtoms ()

Detects aromatic atoms in molecule. Should be called before usage of isAromaticAtom, aromaticAtoms and symmetricalAtoms methods

See also: aromaticAtoms, isAromaticAtom

detectCyclicBonds ()

Detects cyclic bonds in molecule. Should be called before usage of isCyclicAtom method

See also: isCyclicAtom

diastereotopicDistanceList () : Array

Returns an array with distances between diastereotopic atom and nearest chiral center. 0 in array[i] means that atom is not diastereotopic

distanceBetween (Number atomFrom, Number atomTo) : Number

Returns the length of the shortest path between two atoms or -1 if they are not connected


List of parameters:
  • Number atomFrom
  • Number atomTo

generateInChi () : String

Returns the InChI notation of molecule

generateSMILES () : String

Returns the SMILES notation of molecule

getConformers () : Array

Returns an array with the molfiles of each one of the conformers. Undefined if none.

getMolfile () : String

getParam (String aParamName) : Variant


List of parameters:
  • String aParamName

    - Parameter name. Example: getParam("filename")

See also: paramNames

getSDFData (String aSDFTagName) : Variant


List of parameters:
  • String aSDFTagName

    - Name of an SDF tag. Example: getSDFData("COMMENT")

See also: sdfNames, setSDFData

graphicProperties () : Object

Returns a object with the molecule graphic properties

isAromaticAtom (Number aIndex) : Boolean

Returns TRUE if atom with index aIndex is aromatic


List of parameters:
  • Number aIndex

See also: aromaticAtoms, detectAromaticAtoms

isCyclicAtom (Number aIndex) : Boolean

Returns TRUE if atom with index aIndex is cyclic


List of parameters:
  • Number aIndex

See also: detectCyclicBonds

isLabileProton (Number aIndex) : Boolean

Returns TRUE if atom with index aIndex is labile


List of parameters:
  • Number aIndex

makeStereodescriptorsString () : String

Returns a string containing the stereo descriptors of molecule (e.g. RRSRZ)

molecularFormula () : String

Returns the molecular formula

monoisotopicMass () : Number

Returns the monoisotopic molecular mass as the sum of the individual isotopic masses (for the most abundant isotope) of all the atoms in the molecule

neutralizeMolecule () : Boolean

Neutralize charged salt. Returns TRUE if neutralization was successful

nmrAssignments () : Array

Returns the assignments associated to this molecule or null if none.

See also: AtomNMRAssignmentData

nmrPrediction (String aNucleus, Boolean aGrouped) : Array

Returns the prediction data associated to this molecule or null if none.


List of parameters:
  • String aNucleus
  • Boolean aGrouped

See also: AtomNMRPredictionData

normalizeExplicitHydrogensNumbering ()

Normalize only explicit hydrogens numbering

See also: normalizeNumbering

normalizeNumbering ()

Normalize full molecule numbering

See also: normalizeExplicitHydrogensNumbering

paramNames () : Array

Returns an array with all defined parameter names.

See also: getParam

protonateMolecule () : Boolean

Protonate uncharged molecule. Works only for molecules with alone amino group. Returns TRUE if protonation was successful

protonateMoleculeList () : Array

Protonate uncharged molecule. Returns QStringList with molfiles of resulted molecules. Еach resulted molecule is obtained from the original one by protonation of one of the amino groups.

removeExplicitHydrogens ()

Remove explicit hydrogens

See also: addExplicitHydrogens

sdfNames () : Array

Returns an array with all defined SDF tag names.

See also: getSDFData

setGraphicProperties (Object aProperties) : Object

Sets the molecule graphic properties


List of parameters:
  • Object aProperties

setNMRAssignments (Array aAtomNMRAssignmentDataArray)

Sets the assignments data associated to this molecule.


List of parameters:
  • Array aAtomNMRAssignmentDataArray

    - An array of AtomNMRAssignmentData objects.

See also: AtomNMRAssignmentData

setNMRPrediction (String aNucleus, Array aPredictionObjectArray, Boolean aFillImplicitH) : Object

Sets the prediction data associated to this molecule.


List of parameters:
  • String aNucleus
  • Array aPredictionObjectArray

    - An array of AtomNMRPredictionData objects.

  • Boolean aFillImplicitH

    - If true, for H prediction, when the h index is not specified the values are set to all the H in the atom. It's true by default.

See also: AtomNMRPredictionData

setSDFData (String aSDFTagName, String aValue) : Variant


List of parameters:
  • String aSDFTagName

    - Name of an SDF tag.

  • String aValue

    - Value.

See also: getSDFData, sdfNames

symmetricalAtoms (Number aIndex) : Array

Returns an array with indexes of all atoms symetrical with atom aIndex


List of parameters:
  • Number aIndex

See also: detectAromaticAtoms

toString () : String




MoleculePlugin

An object to access Mnova Molecule plug-in functionality.

Table of contents

  1. Constructors
  2. Functions

Constructors

MoleculePlugin (MoleculePlugin aMoleculePlugin)

Functions

Name Output Parameters
activeMolecule Molecule
containsMolecule Boolean PageItem aMolecule1, PageItem aMolecule2
create3DConformersList Boolean String aMolDataId, Boolean aGMMXFlag
getSFBestSolutionData Object String aMoleculeID
importConformers Number String aFileName, String aMolDataId
importMolfile String String aMolfileString
importSMILES String String aSMILESString
parseMolecularFormula Object String aFormula
sameAssignmentsData Boolean PageItem aMolecule1, PageItem aMolecule2

activeMolecule () : Molecule

Returns the active molecule

containsMolecule (PageItem aMolecule1, PageItem aMolecule2) : Boolean

Returns true if the first molecule contains the second one. The function takes into account stereochemistry.


List of parameters:

create3DConformersList (String aMolDataId, Boolean aGMMXFlag) : Boolean

Returns true when the list of conformers has been calculated successfully. False otherwise.


List of parameters:
  • String aMolDataId

    - The molecule dataId.

  • Boolean aGMMXFlag

    - A flag indicating the sofware to be used (true for GMMX, false for Balloon).

getSFBestSolutionData (String aMoleculeID) : Object

Returns the data of the best StereoFitter Solution, in the form of an Object map. It contains the fields 'AIC', 'RelativeProb', and 'Chi2'. It returns an undefined value when there is no StereoFitter data.


List of parameters:

importConformers (String aFileName, String aMolDataId) : Number

Returns the number of conformers if successfully, an undefined value otherwise.


List of parameters:
  • String aFileName

    - The file name containing the conformers (.sdf, .mae, .xyz).

  • String aMolDataId

    - The molecule dataId.

importMolfile (String aMolfileString) : String

This function takes a molfile string, creates a molecule and returns the itemId of the created item.


List of parameters:
  • String aMolfileString

    - A string with the contents of a molfile.

importSMILES (String aSMILESString) : String

This function takes a SMILES string, creates a molecule and returns the itemId of the created item.


List of parameters:
  • String aSMILESString

    - A string with the contents of a molfile.

parseMolecularFormula (String aFormula) : Object

Parses the aFormula and returns the result in the properties of an object: "valid", "normalized","averageMass","monoisotopicMass" and one property per each element of the formula. See example.


List of parameters:
  • String aFormula

				
var parsed = molecule.parseMolecularFormula("C2H5OH")
print(parsed.valid) // => true
print(parsed.normalized) // => C2H6O
print(parsed.averageMass) // => 46.068439999999995
print(parsed.monoisotopicMass) // => 46.041864999999994
print(parsed.atoms["C"]) // => 2
print(parsed.atoms["H"]) // => 6
print(parsed.atoms["O"]) // => 1
print(parsed.atoms["N"]) // => undefined
			
			

sameAssignmentsData (PageItem aMolecule1, PageItem aMolecule2) : Boolean

Returns true if both molecules have the same assignments data. The comparison is done atom by atom, the function expects two molecules with the same molfile.


List of parameters:



MouseModeAction

An object to define a mouse interaction with a PageItem in the CanvasItemView

Enumerations

Name Type Values
BehaviorFlags Number HeightThresholdBehavior, HideCrosshairsBehavior, NormalBehavior, OneClickBehavior
SelectionModes Number SelModeHorizontal, SelModeNormal, SelModeVertical

Properties

Name Type Comments
flags Number
uuid String [read-only]

flags : Number

A combination of flags to set the mouse mode action behavior.

See also: MouseModeAction.BehaviorFlags

uuid : String [read-only]

The mouse mode UUID

Functions

Name Output Parameters
onAction Boolean PageItem aItem, Object aScaleRange
onLeftBtnReleased Boolean PageItem aItem, Object aScalePoint
wantsSetCursor Object PageItem aItem, Number aSelectionMode

onAction (PageItem aItem, Object aScaleRange) : Boolean

This method must be implemented by the programmer to do something when the user selects a range and releases the mouse It must return true to accept the action.


List of parameters:
  • PageItem aItem

    - The PageItem on which the action has been taken

  • Object aScaleRange

    - An object with the horizontal and, regarding the selection mode, vertical ranges in scale units like: {"Horizontal": {"From": 1.25, "To": 2.5}}

onLeftBtnReleased (PageItem aItem, Object aScalePoint) : Boolean

This method must be implemented by the programmer to do something when the user selects a point with the mouse. This method is only called if the behavior flag OneClickBehavior was set. It must return true to accept the action.


List of parameters:
  • PageItem aItem

    - The PageItem on which the action has been taken

  • Object aScalePoint

    - An object with the clicked point in scale units like: {"x": 1.25, "y": 124.45}

wantsSetCursor (PageItem aItem, Number aSelectionMode) : Object

This method must be implemented by the programmer to set a custom cursor for this mouse mode action. It must return an object specifying the cursor pixmap and the cursor position. If the cursor position was not set, the center will be used. {"pixmap" : ":/cursors/my-cursor.png", "x":1, "y":1}


List of parameters:
  • PageItem aItem

    - The PageItem on which the action has been taken

  • Number aSelectionMode

    - The selection mode

    See also: MouseModeAction.SelectionModes




MSChromPeakDetectionExclusionRegs

Table of contents

  1. Properties

Properties

Name Type Comments
after Number
afterEnabled Boolean
units String
upTo Number
upToEnabled Boolean

after : Number

The after region value: The points after this value will be excluded into the peak detection

afterEnabled : Boolean

Toggles the after region

units : String

The units used to specify the exclusion regions. Either a percentage of the total run or a time value in minutes. Modifying the units could alter the upTo and after values. So first you must tune the units and then the values.

Valid values: {"Percentage", "Time"}

upTo : Number

The upTo region value: The points upto this value will be excluded into the peak detection

upToEnabled : Boolean

Toggles the upTo region




MSChromPeakDetectionSettings

Object to get/set the chromatographic peak detection settings

Table of contents

  1. Properties

Properties

Name Type Comments
exclusionRegions MSChromPeakDetectionExclusionRegs
minAreaThreshold Number
sensitivity Number
shoulderSensitivity Number
smoothWindowSize Number
widePeaks Boolean

An object describing the exclusion regions

minAreaThreshold : Number

The minimum area threshold

sensitivity : Number

A dimensionless factor, the higher it is the higher is the peak detection sensitivity. NOTE: The usage is for advanced users only and for very specific cases.

shoulderSensitivity : Number

A dimensionless factor, the higher it is, the higher it is the peak shoulder sensitivity. NOTE: The usage is for advanced users only and for very specific cases.

smoothWindowSize : Number

The size in points of the smoothing window applied before detecting the peaks. NOTE: The usage is for advanced users only and for very specific cases.

widePeaks : Boolean

If true, the peak detection will try to find wider peaks (merging adjacent peaks, for example) that if it's false. NOTE: The usage is for advanced users only and for very specific cases.




Multiplet

Enumerations

Name Type Values
PeakFlags Number UsedForIntegral, UsedForJCalc

Properties

Name Type Comments
calculationParams Object [read-only]
category String
centroid Number [read-only]
color String
delta Number [read-only]
effPeaks Number [read-only]
fullCategory String [read-only]
kurtosis Number [read-only]
name String
nH Number
peaks Array [read-only]
qGSDresidual Number [read-only]
rangeMax Number [read-only]
rangeMin Number [read-only]
rmsWidth Number [read-only]
skewness Number [read-only]
uuid String [read-only]

calculationParams : Object [read-only]

The parameters used to calculate the integral. The object has the following properties:

  • 'method' as a String and valid values {"Sum", "Peaks", "SumEdited"}. The method of calculation.
  • 'peaksInc' as a Number. The flags telling which peaks to include in the calculus. Only relevant for "Peaks" and "SumEdited" methods.
  • 'peaksExc' as a Number. The flags telling which peaks to exclude in the calculus. Only relevant for "Peaks" and "SumEdited" methods.
  • 'ellipticalShape' as a Boolean. Only relevant for 2D spectra. If true the integral shapes are elliptical instead of rectangular.

category : String

Category (m,s,d)

centroid : Number [read-only]

color : String

delta : Number [read-only]

effPeaks : Number [read-only]

fullCategory : String [read-only]

Full Multiplet Category (multiplet,singlet,doublet)

kurtosis : Number [read-only]

name : String

nH : Number

peaks : Array [read-only]

A peak id's (Strings) array

See also: Peak.id

qGSDresidual : Number [read-only]

Residual (as a fraction of the total integral) of qGSD models

rangeMax : Number [read-only]

rangeMin : Number [read-only]

rmsWidth : Number [read-only]

skewness : Number [read-only]

uuid : String [read-only]

The multiplet UUID (unique identifier)

Constructors

Multiplet (Multiplet aMultiplet)

Multiplet (SpectrumRegion aSpectrumRegion, String aCategory)

Multiplet (NMRSpectrum aSpectrum, SpectrumRegion aSpectrumRegion)

Multiplet (Array aPeakIds, NMRSpectrum aSpectrum)

Functions

Name Output Parameters
clearPeakFlag String aPeakUuid, Multiplet.PeakFlags aPeakFlag
integralValue Number Number aNormFactor
jList JList Boolean aReduced
peakFlags Number String aPeakUuid
removePeak Boolean String aPeakUuid
setJList JList aJList
setPeakFlag String aPeakUuid, Multiplet.PeakFlags aPeakFlag
toString String

clearPeakFlag (String aPeakUuid, Multiplet.PeakFlags aPeakFlag)

Clears one of the peak flags for a given peak ID


List of parameters:

integralValue (Number aNormFactor) : Number


List of parameters:
  • Number aNormFactor

jList (Boolean aReduced) : JList


List of parameters:
  • Boolean aReduced

peakFlags (String aPeakUuid) : Number

Returns the peak flags set for a given peak ID


List of parameters:

removePeak (String aPeakUuid) : Boolean

Removes the peak identified by a given peak ID from the multiplet. Returns false if the peak doesn't belong to the multiplet and true otherwise. NOTE: The multiplet must be updated after removePeak is called.


List of parameters:

setJList (JList aJList)


List of parameters:

setPeakFlag (String aPeakUuid, Multiplet.PeakFlags aPeakFlag)

Sets one of the peak flags for a given peak ID


List of parameters:

toString () : String




Multiplets

Properties

Name Type Comments
count Number

count : Number

Number of multiplets

Constructors

Multiplets ()

Constructs an empty list

Multiplets (Multiplets aMultipletList)

Functions

Name Output Parameters
append Multiplet aMultiplet
at Multiplet Number aIndex
clear
findMultiplet Multiplet String aId
normalizeWithNuclideCount NMRSpectrum aSpc
removeAt Number aIndex
sort Boolean bAscending
toString String

append (Multiplet aMultiplet)


List of parameters:

at (Number aIndex) : Multiplet

Returns multiplet at the position aIndex


List of parameters:
  • Number aIndex

clear ()

findMultiplet (String aId) : Multiplet

Finds multiplet by id


List of parameters:
  • String aId

normalizeWithNuclideCount (NMRSpectrum aSpc)


List of parameters:
  • NMRSpectrum aSpc

removeAt (Number aIndex)


List of parameters:
  • Number aIndex

sort (Boolean bAscending)

Sort Ascending/Descending


List of parameters:
  • Boolean bAscending

toString () : String




MultipletTable

Table of contents

  1. Constructors
  2. Functions

Constructors

MultipletTable (MultipletTable aMultipletTable)

Functions

Name Output Parameters
spectrum NMRSpectrum
toString String

spectrum () : NMRSpectrum

toString () : String




NetworkAccessManager

Provides an interface to the relevant methods of QNetworkAccessManager. Check its documentation for more information.

See also: NetworkReply, NetworkRequest

Enumerations

Name Type Values
NetworkAccessibility Number Accessible, NotAccessible, UnknownAccessibility
Operation Number CustomOperation, DeleteOperation, GetOperation, HeadOperation, PostOperation, PutOperation, UnknownOperation

Properties

Name Type Comments
networkAccesible

networkAccesible :

Returns one of the NetworkAccessibility values

Signals

Constructors

NetworkAccessManager ()

Functions

Name Output Parameters
get NetworkReply NetworkRequest request
head NetworkReply NetworkRequest request
post NetworkReply NetworkRequest request, data
put NetworkReply NetworkRequest request, data

get (NetworkRequest request) : NetworkReply


List of parameters:
  • NetworkRequest request

head (NetworkRequest request) : NetworkReply


List of parameters:
  • NetworkRequest request

post (NetworkRequest request, data) : NetworkReply


List of parameters:
  • NetworkRequest request
  • data

    - It can be either a String or a File

put (NetworkRequest request, data) : NetworkReply


List of parameters:
  • NetworkRequest request
  • data

    - It can be either a String or a File




NetworkReply

Provides an interface to the relevant methods of QNetworkReply. Check its documentation for more information.

See also: NetworkAccessManager, NetworkRequest

Enumerations

Name Type Values
NetworkError Number AuthenticationRequiredError, ConnectionRefusedError, ContentAccessDenied, ContentNotFoundError, ContentOperationNotPermittedError, ContentReSendError, HostNotFoundError, NoError, OperationCanceledError, ProtocolFailure, ProtocolInvalidOperationError, ProtocolUnknownError, ProxyAuthenticationRequiredError, ProxyConnectionClosedError, ProxyConnectionRefusedError, ProxyNotFoundError, ProxyTimeoutError, RemoteHostClosedError, SslHandshakeFailedError, TemporaryNetworkFailureError, TimeoutError, UnknownContentError, UnknownNetworkError, UnknownProxyError

Properties

Name Type Comments
bytesAvailable Number
errorString String
isFinished Boolean
isRunning Boolean
manager NetworkAccessManager
networkError NetworkError
operation Operation
readBufferSize Number
request NetworkRequest

bytesAvailable : Number

errorString : String

isFinished : Boolean

isRunning : Boolean

manager : NetworkAccessManager

networkError : NetworkError

See also: NetworkError

operation : Operation

See also: Operation

readBufferSize : Number

request : NetworkRequest

Signals

Functions

Name Output Parameters
abort
attribute Variant Number aAttr
close
hasRawHeader Boolean String aHeader
header Variant
markForDeletion
rawHeader String String aHeader
read Number aMaxLength
readAll String
readLine Number aMaxLength

abort ()

attribute (Number aAttr) : Variant


List of parameters:

close ()

hasRawHeader (String aHeader) : Boolean


List of parameters:
  • String aHeader

header () : Variant

Any of the NetworkRequest.KnownHeaders values.

markForDeletion ()

Marks this object to be deleted. This function must be called after the NetworkReply was processed.

rawHeader (String aHeader) : String


List of parameters:
  • String aHeader

read (Number aMaxLength)


List of parameters:
  • Number aMaxLength

readAll () : String

readLine (Number aMaxLength)


List of parameters:
  • Number aMaxLength



NetworkRequest

Provides an interface to the relevant methods of QNetworkRequest. Check its documentation for more information.

See also: NetworkAccessManager, NetworkReply

Enumerations

Name Type Values
Attribute Number AuthenticationReuseAttribute, CacheLoadControlAttribute, CacheSaveControlAttribute, ConnectionEncryptedAttribute, CookieLoadControlAttribute, CookieSaveControlAttribute, CustomVerbAttribute, DoNotBufferUploadDataAttribute, HttpPipeliningAllowedAttribute, HttpPipeliningWasUsedAttribute, HttpReasonPhraseAttribute, HttpStatusCodeAttribute, RedirectionTargetAttribute, SourceIsFromCacheAttribute
KnownHeaders Number ContentDispositionHeader, ContentLengthHeader, ContentTypeHeader, CookieHeader, LastModifiedHeader, LocationHeader, SetCookieHeader
Priority Number HighPriority, LowPriority, NormalPriority

Properties

Name Type Comments
priority Priority
url String

priority : Priority

See also: Priority

url : String

Signals

Functions

Name Output Parameters
attribute Variant Number aAttr, Variant aDefValue
hasRawHeader Boolean String aHeader
header Variant
rawHeader String String aHeader
rawHeaderList Array
setAttribute Number aAttr, Variant aValue
setHeader Number aHeader, Variant aValue
setRawHeader String aHeader, String aValue

attribute (Number aAttr, Variant aDefValue) : Variant


List of parameters:

hasRawHeader (String aHeader) : Boolean


List of parameters:
  • String aHeader

header () : Variant

Any of the NetworkRequest.KnownHeaders values.

rawHeader (String aHeader) : String


List of parameters:
  • String aHeader

rawHeaderList () : Array

setAttribute (Number aAttr, Variant aValue)


List of parameters:

setHeader (Number aHeader, Variant aValue)


List of parameters:

setRawHeader (String aHeader, String aValue)


List of parameters:
  • String aHeader
  • String aValue



NMRArithmetic

Properties

Name Type Comments
lastError String
spectraList Array

lastError : String

String that contains the last error of the arithmetic engine.

spectraList : Array

The elements of this array describe the spectra that can be used in the runFormula function. Each one of them contains an "item" property with the NMRSpectrum object, a "id" property with a string that can be use when writing formulas and also can have an "index" with the index of the spectrum in an arrayed spectrum.

Constructors

NMRArithmetic ()

Functions

Name Output Parameters
add Boolean NMRSpectrum aFirstSpc, [Number aFirstSpcIndex], NMRSpectrum aSecondSpc, [Number aSecondSpcIndex], NMRSpectrum aResultSpc, [Number aResultSpcIndex]
mul Boolean NMRSpectrum aFirstSpc, [Number aFirstSpcIndex], NMRSpectrum aSecondSpc, [Number aSecondSpcIndex], NMRSpectrum aResultSpc, [Number aResultSpcIndex]
runFormula Boolean String aFormula, aResultId
scale Boolean Number aNumber, NMRSpectrum aSpc, [Number aSpcIndex], NMRSpectrum aResultSpc, [Number aResultSpcIndex]
sub Boolean NMRSpectrum aFirstSpc, [Number aFirstSpcIndex], NMRSpectrum aSecondSpc, [Number aSecondSpcIndex], NMRSpectrum aResultSpc, [Number aResultSpcIndex]

add (NMRSpectrum aFirstSpc, [Number aFirstSpcIndex], NMRSpectrum aSecondSpc, [Number aSecondSpcIndex], NMRSpectrum aResultSpc, [Number aResultSpcIndex]) : Boolean

Sums two spectra. Return false on fail.


List of parameters:
  • NMRSpectrum aFirstSpc
  • Number aFirstSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.

  • NMRSpectrum aSecondSpc
  • Number aSecondSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.

  • NMRSpectrum aResultSpc

    - The result spectrum. It can be one of the previous.

  • Number aResultSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.

mul (NMRSpectrum aFirstSpc, [Number aFirstSpcIndex], NMRSpectrum aSecondSpc, [Number aSecondSpcIndex], NMRSpectrum aResultSpc, [Number aResultSpcIndex]) : Boolean

Multiplies two spectra. Returns false on fail.


List of parameters:
  • NMRSpectrum aFirstSpc
  • Number aFirstSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.

  • NMRSpectrum aSecondSpc
  • Number aSecondSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.

  • NMRSpectrum aResultSpc

    - The result spectrum. It can be one of the previous.

  • Number aResultSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.

runFormula (String aFormula, aResultId) : Boolean

Runs the formula and returns true if success.


List of parameters:
  • String aFormula

    - The formula created using the ids present in the spectraList property to be executed.

  • aResultId

    - The id containded by the spectraList in which the result will be stored.

scale (Number aNumber, NMRSpectrum aSpc, [Number aSpcIndex], NMRSpectrum aResultSpc, [Number aResultSpcIndex]) : Boolean

Multiplies a spectrum by a number. Returns false on fail.


List of parameters:
  • Number aNumber
  • NMRSpectrum aSpc
  • Number aSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.

  • NMRSpectrum aResultSpc

    - The result spectrum.

  • Number aResultSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.

sub (NMRSpectrum aFirstSpc, [Number aFirstSpcIndex], NMRSpectrum aSecondSpc, [Number aSecondSpcIndex], NMRSpectrum aResultSpc, [Number aResultSpcIndex]) : Boolean

Subtracts two spectra. Return false on fail.


List of parameters:
  • NMRSpectrum aFirstSpc
  • Number aFirstSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.

  • NMRSpectrum aSecondSpc
  • Number aSecondSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.

  • NMRSpectrum aResultSpc

    - The result spectrum. It can be one of the previous.

  • Number aResultSpcIndex [optional]

    - In arrayed spectra the spectrum index to be used. By default the active one.




NMRAssignments

Represents the NMR assignment in a molecule

Table of contents

  1. Constructors
  2. Functions

Constructors

NMRAssignments (Molecule aMolecule)

Functions

Name Output Parameters
ambigJs Array Number aAtomNumber, Number aHIndex
chemShift Object Number aAtomNumber, Number aIndex
chemShiftArr Object Number aAtomNumber, Number aIndex
correlatedAtoms Array Number aAtomIndex, Number aIndex, String aCorrelationType
correlations Array
hasAssignments Boolean String aElement
hasCouplings Boolean String aType
jConts Object Number aAtomNumber, Number aIndex
multipletAssignment String String aMultipletId
NOEs Object
notEqHs Array Number aAtomIndex
peakAssignment String String aPeakId, String aNucleus
RDCs Object
realAssignedExp String String aType
removeChemShift Number aAtomNumber, Number aIndex
setAmbigJs Number aAtomNumber, Number aHIndex, Arrays aValues
setChemShift Number aAtomNumber, Number aIndex, Number aFrom, Number aTo, Number aShift
setJConts Number aAtomNumber, Number aHIndex, Number aValue
setNOEs
setRDCs

ambigJs (Number aAtomNumber, Number aHIndex) : Array

Get the ambiguous Js of an atom


List of parameters:
  • Number aAtomNumber

    - Atom index, from 1 to atomCount

  • Number aHIndex

    - 0 for heavy index. Bigger values to specify a proton number.

    Valid values: {0, 1, 2, 3}

chemShift (Number aAtomNumber, Number aIndex) : Object

Get the chemical shift assigned to an atom. Returns the value of the assignment as a {max, min, shift} object.


List of parameters:
  • Number aAtomNumber

    - Atom index, from 1 to atomCount

  • Number aIndex

    - 0 for heavy index. Bigger values to specify a proton number.

    Valid values: {0, 1, 2, 3}

chemShiftArr (Number aAtomNumber, Number aIndex) : Object

Get the chemical shifts assigned to an atom. Returns the value of the assignment as an array of {max, min} object.


List of parameters:
  • Number aAtomNumber
  • Number aIndex

    - 0 for heavy index. Bigger values to specify a proton number.

    Valid values: {0, 1, 2, 3}

correlatedAtoms (Number aAtomIndex, Number aIndex, String aCorrelationType) : Array

Returns the atoms correlated to the aAtomIndex atom. Returns an array of objects, each one has two fields, "atom" which is the correlated atom number and "indexes" an array with the equivalent indexes in "atom"


List of parameters:
  • Number aAtomIndex
  • Number aIndex

    - 0 for heavy index. Bigger values to specify a proton number.

    Valid values: {0, 1, 2, 3}

  • String aCorrelationType

    - The desired correlation, the possible values are the same as in the assignments table

correlations () : Array

Returns the list of correlations present in the molecule

hasAssignments (String aElement) : Boolean

Returns true if the molecule contains some assignment. False otherwise.


List of parameters:
  • String aElement

    - If specified returns true only if the molecule has assignments for the specified element.

hasCouplings (String aType) : Boolean

Returns true if the molecule contains some coupling of the specified type. False otherwise.


List of parameters:
  • String aType

    - Coupling Type

    Valid values: {"J", "NOE", "RDC"}

jConts (Number aAtomNumber, Number aIndex) : Object

Get the coupling constants of the atom (aAtomNumber, aIndex). Returns an array of objects, each one with two fields, "atom" and "value". "Value" is the j coupling value. "Atom" is an object with fields 'index' and 'h', as in AtomNMRAssignmentData.


List of parameters:
  • Number aAtomNumber

    - Atom index, from 1 to atomCount

  • Number aIndex

    - 0 for heavy index. Bigger values to specify a proton number.

    Valid values: {0, 1, 2, 3}


				
For these Js in the Assignments Table: "-1.00(5'),-1.00(5''),6.20(6),7.90(7)" (atoms 5CH2, 6H, 7CH2 (equivalents)),
we will have:

{ atom:{ index:'5', h:'a'}, value:'-1'},
{ atom:{ index:'5', h:'b'}, value:'-1'},
{ atom:{ index:'6'}, value:'6.2'},
{ atom:{ index:'7', h:'a'}, value:'7.9'},
{ atom:{ index:'7', h:'b'}, value:'7.9'}
				
			

multipletAssignment (String aMultipletId) : String

Returns a string with the assignments related to the given multiplet id


List of parameters:
  • String aMultipletId

    - The id of the multiplet

NOEs () : Object

Get the NOE constants of the atom

See also: NMRAssignments.jConts

notEqHs (Number aAtomIndex) : Array

For a given atom number returns the not equivalent H indexes


List of parameters:
  • Number aAtomIndex

    - Atom index, from 1 to atomCount

peakAssignment (String aPeakId, String aNucleus) : String

Returns a string with the assignments related to the given peak id


List of parameters:
  • String aPeakId

    - The id of the peak

  • String aNucleus

    - If specified, it returns only the assignments to this kind of nucleus

RDCs () : Object

Get the RDC constants of the atom

See also: NMRAssignments.jConts

realAssignedExp (String aType) : String

Return the real assigned experiment. If not specified, return aType.


List of parameters:
  • String aType

    - The unified experiment name, the values returned in the correlations() function. (E.g. "NOESY" is the unified name for "NOESY" and "ROESY" experiments).

removeChemShift (Number aAtomNumber, Number aIndex)

Remove chemical shift informatin from an atom


List of parameters:
  • Number aAtomNumber
  • Number aIndex

    - 0 for heavy index. Bigger values to specify a proton number.

    Valid values: {0, 1, 2, 3}

setAmbigJs (Number aAtomNumber, Number aHIndex, Arrays aValues)

Set the ambiguous Js of an atom


List of parameters:
  • Number aAtomNumber

    - Atom index, from 1 to atomCount

  • Number aHIndex

    - 0 for heavy index. Bigger values to specify a proton number.

    Valid values: {0, 1, 2, 3}

  • Arrays aValues

setChemShift (Number aAtomNumber, Number aIndex, Number aFrom, Number aTo, Number aShift)

Assign a chemical shift to an atom


List of parameters:
  • Number aAtomNumber
  • Number aIndex

    - 0 for heavy index. Bigger values to specify a proton number.

    Valid values: {0, 1, 2, 3}

  • Number aFrom

    - From Chemical shift

  • Number aTo

    - To Chemical shift. If not specified, the atom will be assigned to the aFrom position

  • Number aShift

    - Chemical Shift value. If not specified, the atom will be assigned to the range = (aFrom-aTo) and the shift = range middle point

setJConts (Number aAtomNumber, Number aHIndex, Number aValue)

Set the Js for an atom


List of parameters:
  • Number aAtomNumber

    - Atom index, from 1 to atomCount

  • Number aHIndex

    - 0 for heavy index. Bigger values to specify a proton number.

    Valid values: {0, 1, 2, 3}

  • Number aValue

setNOEs ()

Set the NOE constants of the atom

See also: NMRAssignments.setJConts

setRDCs ()

Set the RDC constants of the atom

See also: NMRAssignments.setJConts




NMRForensics

Object with utility tools for NMR Forensics use cases

Table of contents

  1. Enumerations
  2. Functions

Enumerations

Name Type Values
IntegralTransformType Number ChebyshevPolynomial, EuclideanDistance

Functions

Name Output Parameters
calcEffPeaks Number Array aSticksArray, Number aLinewidth
calcIntegralTransforms Array NMRSpectrum aSpectrum, Number aMinPpm, Number aMaxPpm, Number aCount, [IntegralTransformType aIntegralTransformType = ChebyshevPolynomial], [Number aMaxOrder = 10], [Array aExclusionRegions]
calcQuantification Array NMRSpectrum aMixtureSpectrum, Array aCompoundSpectra, Array aNumberOfProtons, [Array aInitialProportions], [Array aExclusionRegions], [IntegralTransformType aIntegralTransformType = ChebyshevPolynomial], [Number aMaxOrder = 10], [Boolean aCalcVarianceAnalysis = false]
calcShapeMoments Object Array aSticksArray, Number aLinewidth
checkSticksPatternCompatibility Boolean Array aRefSticks, Array aSticks, Number aLineWidth, Number aAreaRatio
compareShapeMoments Object Object aShapeMomentsA, Object aShapeMomentsB, [Object aSettings]
createSticksList Array NMRSpectrum aNMRItem, Array aPeakUuids
createSticksList Array Array aCouplings, Number aCentroid, Number aLinewidth, [Number aNormValue]
createSticksList Array NMRSpectrum aNMRItem
findSticksMultiplet Array Array aRefSticks, Array aSticks, [Object aSettings]
findSticksPattern Array Array aRefSticks, Array aSticks, [Object aSettings]
lineWidtEstimateFromPeaks Object NMRSpectrum aNMRItem
patternIsolationFactor Number Array aRefSticks, Array aSticks, Object aLineWidth
stickListPatternSimilarity Number Array aFirstSticks, Array aSecondSticks, [Number aShiftTol]
toMainStickList Object Array aSticksArray, Number aLinewidth

NMRForensics.calcEffPeaks (Array aSticksArray, Number aLinewidth) : Number

Calculates the number of effective peaks for a set of sticks. This value is already included in the shape moments calculation.


List of parameters:
  • Array aSticksArray

    - An array of stick ojbects

  • Number aLinewidth

    - A normalized linewidth value in the same units as the stick's "x" property

See also: NMRForensics.createSticksList

NMRForensics.calcIntegralTransforms (NMRSpectrum aSpectrum, Number aMinPpm, Number aMaxPpm, Number aCount, [IntegralTransformType aIntegralTransformType = ChebyshevPolynomial], [Number aMaxOrder = 10], [Array aExclusionRegions]) : Array

Returns an Array of numbers containing the integral transforms of the spectrum.


List of parameters:
  • NMRSpectrum aSpectrum

    - The NMR Spectrum to which we want to calculate the integral transforms.

  • Number aMinPpm

    - The minimum ppm of the interval in which we want to calculate the integral transforms.

  • Number aMaxPpm

    - The maximum ppm of the interval in which we want to calculate the integral transforms.

  • Number aCount

    - The number of points (resolution) of the interval.

  • IntegralTransformType aIntegralTransformType [optional]

    - The type of the integral transforms.

  • Number aMaxOrder [optional]

    - The maximum order of the integral transforms (if the selected type is ChebyshevPolynomial).

  • Array aExclusionRegions [optional]

    - An Array of Arrays containing a pair of numbers each that will be used as minimum and maximum ppm respectively for the regions that should be ignored in the analysis.


			
var count, exclRegions, its, itType, maxOrder, maxPpm, minPpm, spec;

spec = nmr.activeSpectrum();
minPpm = -1.0;
maxPpm = 10.0;
count = 65536;
itType = NMRForensics.IntegralTransformType.ChebyshevPolynomial;
maxOrder = 15;
exclRegions = [[4.74, 4.89], [-0.006, 0.006]];
its = NMRForensics.calcIntegralTransforms(spec, minPpm, maxPpm, count, itType, maxOrder, exclRegions);
print(its);
			
		

NMRForensics.calcQuantification (NMRSpectrum aMixtureSpectrum, Array aCompoundSpectra, Array aNumberOfProtons, [Array aInitialProportions], [Array aExclusionRegions], [IntegralTransformType aIntegralTransformType = ChebyshevPolynomial], [Number aMaxOrder = 10], [Boolean aCalcVarianceAnalysis = false]) : Array

Returns an Array of numbers between 0 and 1 with the relative amount of each compound in the mixture.


List of parameters:
  • NMRSpectrum aMixtureSpectrum

    - The NMR Spectrum of the mixture we want to analyze.

  • Array aCompoundSpectra

    - An Array of NMRSpectrum containing all the compounds whose amount we want to analyze in the mixture.

  • Array aNumberOfProtons

    - An Array of integers representing the number of protons of each compound. Its length must be equal to that of aCompoundSpectra.

  • Array aInitialProportions [optional]

    - An Array of numbers between 0 and 1 with the initial proportions for each compound that will be passed as starting point to the optimizer. The default proportions will be the same for each compound. If its length is not equal to that of aCompoundSpectra, it will be ignored and the default proportions will be used instead.

  • Array aExclusionRegions [optional]

    - An Array of Arrays containing a pair of numbers each that will be used as minimum and maximum ppm respectively for the regions that should be ignored in the analysis.

  • IntegralTransformType aIntegralTransformType [optional]

    - The type of the integral transforms used in the optimization.

  • Number aMaxOrder [optional]

    - The maximum order of the integral transforms (if the selected type is ChebyshevPolynomial).

  • Boolean aCalcVarianceAnalysis [optional]

    - Performs an additional variance analysis for each compound that will be attached to the general result.


			
var i, compoundSpectra, document, exclusionRegions, initialProportion, mixtureSpectrum, result, spectraCount;

document = mainWindow.activeDocument;
spectraCount = document.itemCount("NMR Spectrum");
mixtureSpectrum = document.item(0, "NMR Spectrum");
compoundSpectra = [];
initialProportion = [];
for (i = 1; i < spectraCount; ++i) {
	compoundSpectra.push(document.item(i, "NMR Spectrum"));
	initialProportion.push(1.0);
}

numberOfProtons = [10, 7, 4];
exclusionRegions = [[4.75, 4.88], [0.0151, 0.0172]];

result = NMRForensics.calcQuantification(mixtureSpectrum, compoundSpectra, numberOfProtons, initialProportion, exclusionRegions, NMRForensics.IntegralTransformType.ChebyshevPolynomial, 10, true);
print(result);
			
		

NMRForensics.calcShapeMoments (Array aSticksArray, Number aLinewidth) : Object

Calculates the spectral moments for a set of sticks. It returns an object like: { "linewidth": 0.003, "effpeaks": 1.02, "centroid": 4.25, "rmswidth": 0.24, "shapeM1": 1.0, "symmetry": 0.5, "skewness": -0.02, "shapeM3": 0.13, "symm3": 0.04, "kurtosis": 2.96, "symm4": -1.05 }


List of parameters:
  • Array aSticksArray

    - An array of stick ojbects

  • Number aLinewidth

    - A normalized linewidth value in the same units as the stick's "x" property

See also: NMRForensics.createSticksList

NMRForensics.checkSticksPatternCompatibility (Array aRefSticks, Array aSticks, Number aLineWidth, Number aAreaRatio) : Boolean

Returns if reference sticks are compatible, can be contained, in another sticks list.


List of parameters:
  • Array aRefSticks

    - The reference array of stick ojbects to check if they are compatible.

  • Array aSticks

    - The array of sticks where we have to check for compatibility.

  • Number aLineWidth

    - A line widht estimation for the sticks.

  • Number aAreaRatio

    - The area ratio used to normalize the reference sticks.

NMRForensics.compareShapeMoments (Object aShapeMomentsA, Object aShapeMomentsB, [Object aSettings]) : Object

Returns an object with the probability of the shape moments being the same and the individual probabilities for each moment. { "overall": 0.95, "individual": [1.0, 0.99,...] }


List of parameters:
  • Object aShapeMomentsA

    - A shape moments object returned by calcShapeMoments

  • Object aShapeMomentsB

    - Another shape moments object returned by calcShapeMoments

  • Object aSettings [optional]

    - The settings object

See also: NMRForensics.calcShapeMoments

NMRForensics.createSticksList (NMRSpectrum aNMRItem, Array aPeakUuids) : Array

Creates a stick list from a list of NMR spectrum peaks to calculate later the shape moments. Returns an array of stick objects {"x":1.25, "y":20.45, "uuid":"8798ca25-f5b3-4734-a5a8-821328d671a5"}


List of parameters:
  • NMRSpectrum aNMRItem

    - The NMR spectrum to get the peaks.

  • Array aPeakUuids

    - An array containing the selected peak IDs

    See also: Peak.id

NMRForensics.createSticksList (Array aCouplings, Number aCentroid, Number aLinewidth, [Number aNormValue]) : Array

Creates a stick list from a list of couplings, a centroid and a linewidth Returns an array of stick objects {"x":1.25, "y":20.45, "uuid":"8798ca25-f5b3-4734-a5a8-821328d671a5"}


List of parameters:
  • Array aCouplings

    - An array of coupling constants (real numbers)

  • Number aCentroid

    - The centroid position

  • Number aLinewidth

    - The linewidth

  • Number aNormValue [optional]

    - The normalization value of total areas. By default is 1.0

NMRForensics.createSticksList (NMRSpectrum aNMRItem) : Array

Creates a stick list from the compound peaks of a NMR spectrum


List of parameters:
  • NMRSpectrum aNMRItem

    - The NMR spectrum to get the peaks.

NMRForensics.findSticksMultiplet (Array aRefSticks, Array aSticks, [Object aSettings]) : Array

Returns an array of stick objects array (stick list) with the found matches for the reference stick list using just the range information.


List of parameters:
  • Array aRefSticks

    - An array of stick ojbects used as reference. The stick multiplet to search.

  • Array aSticks

    - An array of stick ojbects where the reference sticks will be searched.

  • Object aSettings [optional]

    - The settings object

NMRForensics.findSticksPattern (Array aRefSticks, Array aSticks, [Object aSettings]) : Array

Returns an array of stick objects array (stick list) with the found matches for the reference stick list pattern.


List of parameters:
  • Array aRefSticks

    - An array of stick ojbects used as reference. The stick pattern to search.

  • Array aSticks

    - An array of stick ojbects where the pattern sticks will be searched.

  • Object aSettings [optional]

    - The settings object

NMRForensics.lineWidtEstimateFromPeaks (NMRSpectrum aNMRItem) : Object

Returns an object with several average line widths from peaks of the given spectrum. It returns the weighted average, the average and robust average line widths like: {"weighted": 0.25, "average": 0.21, "robust": 0.23}


List of parameters:
  • NMRSpectrum aNMRItem

    - The NMR spectrum to get the peaks.

NMRForensics.patternIsolationFactor (Array aRefSticks, Array aSticks, Object aLineWidth) : Number

Returns a number from 0 to 1, both inclusive telling how isolated a sticks pattern is inside a set of sticks containing it.


List of parameters:
  • Array aRefSticks

    - The reference array of stick ojbects where we want to see how isolated they are from the other sticks.

  • Array aSticks

    - The complete sticks array containing the reference ones.

  • Object aLineWidth

    - A line widht estimation for the sticks.

NMRForensics.stickListPatternSimilarity (Array aFirstSticks, Array aSecondSticks, [Number aShiftTol]) : Number

Returns a distance between two stick sets.


List of parameters:
  • Array aFirstSticks

    - An array of sticks to compare.

  • Array aSecondSticks

    - An array of sticks to compare.

  • Number aShiftTol [optional]

    - The chemical shift tolerance allowed.

NMRForensics.toMainStickList (Array aSticksArray, Number aLinewidth) : Object

Creates a new sticks list from a give one, selecting only the main ones. Those which contribute with the majority of thet total area. Returns an array of stick objects {"x":1.25, "y":20.45, "uuid":"8798ca25-f5b3-4734-a5a8-821328d671a5"}


List of parameters:
  • Array aSticksArray

    - An array of stick ojbects

  • Number aLinewidth

    - A normalized linewidth value in the same units as the stick's "x" property

See also: NMRForensics.createSticksList




NMRPeaksPatternFinder

An object to find NMR peak patterns

Properties

Name Type Comments
centroidTolerance Number
useCentroidMetric Boolean

centroidTolerance : Number

The tolerance in ppm to be used when the centroid metric is used to compute the probability of a reference match. Default value is 0.1 ppm.

useCentroidMetric : Boolean

A boolean flag which toggles the use of the centroid metric in the probability computation. By default is set to true.

Constructors

NMRPeaksPatternFinder ()

Functions

Name Output Parameters
createReference Object NMRSpectrum aNMRSpectrum, [Number aSpectrumIndex], Array aPeakIds
createSpinSimReference Object Molecule aMolItem, Number aAtomIndex, [Number aHIndex], NMRSpectrum aNMRSpectrum, [Number aResolution]
findReference Object Object aReference, NMRSpectrum aNMRSpectrum, [Number aSpectrumIndex], Array aPeakIds

createReference (NMRSpectrum aNMRSpectrum, [Number aSpectrumIndex], Array aPeakIds) : Object

Creates a pattern reference object to be used later on in the findReference method. The pattern reference is the pattern made by the aPeakIds argument belonging to the aNMRSpectrum argument.


List of parameters:

See also: Peak.id

createSpinSimReference (Molecule aMolItem, Number aAtomIndex, [Number aHIndex], NMRSpectrum aNMRSpectrum, [Number aResolution]) : Object

Creates a pattern reference object from a spin system to be used later on in the findReference method. The pattern reference is the pattern made by the peaks belonging to a atom's molecule calculated from a prediction/simulation.


List of parameters:
  • Molecule aMolItem

    - Molecule where the prediction/simulation was done

  • Number aAtomIndex

    - The atom index.

  • Number aHIndex [optional]

    - The proton index.

  • NMRSpectrum aNMRSpectrum

    - The target NMR spectrum. Here it's used to get the spectrum parameters to simulate the spin system.

  • Number aResolution [optional]

    - The resolution in Hz to be used to generate the reference. Default: 0.5 Hz

findReference (Object aReference, NMRSpectrum aNMRSpectrum, [Number aSpectrumIndex], Array aPeakIds) : Object

Finds a pattern reference (created by createReference or createSpinSimReference) in the peaks set provided by the aPeakIds argument belonging to the aNMRSpectrum argument. The object returnted has the following properties:

  • found [Boolean]: A flag indicating if the reference pattern was found.
  • incompleteSearch [Boolean]: A flag indicating if during the search some combinations couldn't be explored.
  • noSearch [Boolean]: A flag which it's set to true if any combination couldn't be explored during the search.
  • probability [Number]: If found is true it shows the probability that the found pattern matches the reference.
  • pattern [Array]: An array having the peak id's that matches best the pattern reference which are among the provided by the parameter aPeakIds.


List of parameters:



NMRPlugin

Enumerations

Name Type Values
SyntheticSpectrumMode Number Proportional, Sticks, Synthetic, Uniform

Constructors

NMRPlugin (NMRPlugin aNMRPlugin)

Functions

Name Output Parameters
activeSpectrum NMRSpectrum
autoAssign Boolean NMRSpectrum aNMRItem, PageItem aMolItem
beginFidModification NMRSpectrum aSpectrum
beginModification NMRSpectrum aSpectrum
calculate1DSpectraDistance Number NMRSpectrum aSpectrumA, NMRSpectrum aSpectrumB
calculate1DSpectraDistance Number NMRSpectrum aSpectrumA, Number aIndexA, NMRSpectrum aSpectrumB, Number aIndexB
createArrayedItem NMRSpectrum Array aSpectra, [Boolean aStacked]
endFidModification NMRSpectrum aSpectrum
endModification NMRSpectrum aSpectrum
extractSpectrumFromArrayedItem NMRSpectrum NMRSpectrum aSpectrum, [Number aIndex]
isValid Boolean
loadParametersCustomization Boolean String aFileName, [String aFileFormat]
multipletTable MultipletTable
numberOfNuclidesTest NNTestSolution Array aIntegrals, Number aCountFrom, [Number aCountTo]
peakTable PeakTable
process String aProcFile
processSpectrum NMRSpectrum aSpectrum, String aProcFile
syntheticAssignmentsSpectrum Object String aXML
syntheticPeaksSpectrum NMRSpectrum NMRSpectrum aNMRItem, Number aIncPeakFlags, Number aExcPeakFlags, Number aMode, [Number aModeParm1], [Number aModeParm2]
syntheticPeaksSpectrum NMRSpectrum NMRSpectrum aNMRItem, Array aPeakIdsArray, Number aMode, [Number aModeParm1], [Number aModeParm2]
toString String

activeSpectrum () : NMRSpectrum

Returns the active spectrum

autoAssign (NMRSpectrum aNMRItem, PageItem aMolItem) : Boolean

Assigns automatically a molecule structure to a spectrum


List of parameters:
  • NMRSpectrum aNMRItem

    - The NMR spectrum to be assigned

  • PageItem aMolItem

    - The molecule item to assign

beginFidModification (NMRSpectrum aSpectrum)

Should be used when modifying FID data points from a script by means of fidSetReal/fidSetImag. Paired with endFidModification.


List of parameters:

beginModification (NMRSpectrum aSpectrum)

Should be used when modifying spectrum data points from a script by means of setReal/setImag. Paired with endModification.


List of parameters:

calculate1DSpectraDistance (NMRSpectrum aSpectrumA, NMRSpectrum aSpectrumB) : Number

Calculates the spectral distance between two 1D spectra. It returns either the distance as a number or an undefined value. The distance is enclosed between [0,1]. 0 means that spectra is equal and 1 that spectra is completelly different.


List of parameters:
  • NMRSpectrum aSpectrumA

    - The first spectrum to be compared

  • NMRSpectrum aSpectrumB

    - The second spectrum to be compared

calculate1DSpectraDistance (NMRSpectrum aSpectrumA, Number aIndexA, NMRSpectrum aSpectrumB, Number aIndexB) : Number

Calculates the spectral distance between two 1D spectra. It returns either the distance as a number or an undefined value. The distance is enclosed between [0,1]. 0 means that spectra is equal and 1 that spectra is completelly different.


List of parameters:
  • NMRSpectrum aSpectrumA

    - The first spectrum to be compared

  • Number aIndexA

    - The index of the spectrum to be used in an arrayed NMR item. If the index is invalid the active spectrum will be used.

  • NMRSpectrum aSpectrumB

    - The second spectrum to be compared

  • Number aIndexB

    - The index of the spectrum to be used in an arrayed NMR item. If the index is invalid the active spectrum will be used.

createArrayedItem (Array aSpectra, [Boolean aStacked]) : NMRSpectrum

Creates an arrayed NMRSpectrum from an array of NMRSpectrum objects


List of parameters:
  • Array aSpectra

    - An array of NMRSpectrum objects with at least two objects. Returns the created NMRSpectrum

  • Boolean aStacked [optional]

    - If true (the default) the arrayed item will be stacked. If false it will be superimposed

endFidModification (NMRSpectrum aSpectrum)

Should be used when modifying FID data points from a script by means of fidSetReal/fidSetImag. Paired with beginFidModification.


List of parameters:

endModification (NMRSpectrum aSpectrum)

Should be used when modifying spectrum data points from a script by means of setReal/setImag. Paired with beginModification.


List of parameters:

extractSpectrumFromArrayedItem (NMRSpectrum aSpectrum, [Number aIndex]) : NMRSpectrum

Extracts a NMRSpectrum object from an arrayed NMRSpectrum


List of parameters:
  • NMRSpectrum aSpectrum

    - The arrayed NMRSpectrum item.

  • Number aIndex [optional]

    - The spectrum index (From 0 to specCount-1) to be extracted. By default the active one will be extracted.

isValid () : Boolean

Is a valid NMR object

loadParametersCustomization (String aFileName, [String aFileFormat]) : Boolean

Loads a parameter customization file associated to the file format and sets it as default.


List of parameters:
  • String aFileName
  • String aFileFormat [optional]

multipletTable () : MultipletTable

Returns the current Multiplet Table

numberOfNuclidesTest (Array aIntegrals, Number aCountFrom, [Number aCountTo]) : NNTestSolution

Given an array of integral values it provides you either the probability of those integrals to match a given number of nuclides or given a number of nuclides range, the highest match probability for a nuclides number in the range.


List of parameters:
  • Array aIntegrals

    - The array of integral values (real numbers).

  • Number aCountFrom

    - If no more parameters are provided then it's the number of nuclides we want to test. If aCountTo is also provided it's the starting number of nuclides to test.

  • Number aCountTo [optional]

    - It's the ending number of nuclides to test.


				
function nnTest()
{
	var integrals = [ 0.5, 0.95, 0.42, 0.1];
	var nnOut = nmr.numberOfNuclidesTest(integrals, 1, 8);
	if( nnOut ) {
		print("Integrals: " + integrals);
		print("Total Nuclides: " + nnOut.totalNuclides);
		print("Nuclides Count: " + nnOut.nuclidesCount);
		print("Likelyhood: " + nnOut.likelyhood);
		print("Likelyhoods: " + nnOut.likelyhoods);
		print("Normalization Factor: " + nnOut.normFactor);
		print("Most Offending: " + integrals[nnOut.offendingIdx] + "[" + nnOut.offendingIdx + "]");
		print("LikelyhoodEx: " + nnOut.likelyhoodEx);
	}
	var nnOut = nmr.numberOfNuclidesTest(integrals, 4);
	if( nnOut ) {
		print("Integrals: " + integrals);
		print("Total Nuclides: " + nnOut.totalNuclides);
		print("Nuclides Count: " + nnOut.nuclidesCount);
		print("Likelyhood: " + nnOut.likelyhood);
		print("Likelyhoods: " + nnOut.likelyhoods);
		print("Normalization Factor: " + nnOut.normFactor);
		print("Most Offending: " + integrals[nnOut.offendingIdx] + "[" + nnOut.offendingIdx + "]");
		print("LikelyhoodEx: " + nnOut.likelyhoodEx);
	}
}
			
			

peakTable () : PeakTable

Returns the current Peak Table

process (String aProcFile)

Reads a processing file and apply it to the active spectrum


List of parameters:
  • String aProcFile

    - File Name

See also: NMRProcessing, NMRSpectrum.proc, NMRSpectrum.process

processSpectrum (NMRSpectrum aSpectrum, String aProcFile)

Reads a processing file and applies it to a spectrum


List of parameters:

See also: NMRProcessing, NMRSpectrum.proc, NMRSpectrum.process

syntheticAssignmentsSpectrum (String aXML) : Object

Makes a synthetic spectrum from the content of a XML file. Returns an object with two fields: "nmrItemId", with the itemId of the obtained spectrum, and "error"


List of parameters:
  • String aXML

    - A string with the assignments converted in a Spin System, in XML format

syntheticPeaksSpectrum (NMRSpectrum aNMRItem, Number aIncPeakFlags, Number aExcPeakFlags, Number aMode, [Number aModeParm1], [Number aModeParm2]) : NMRSpectrum

Makes a synthetic spectrum from the peaks list of a given spectrum. With only one argument expects a XML string describing the peaks.


List of parameters:
  • NMRSpectrum aNMRItem

    - The source spectrum which provides the peaks list

  • Number aIncPeakFlags

    - The including peaks flags. See valid values in Peak.FlagsInc

    See also: Peak.FlagsInc

  • Number aExcPeakFlags

    - The excluding peaks flags. See valid values in Peak.FlagsExc

    See also: Peak.FlagsExc

  • Number aMode

    - The synthetic spectrum mode:

    • Synthetic: The peak line widths are kept.
    • Sticks: The peak line widths are set to 0.
    • Uniform: The peak line widths are set to a predefined value.
    • Proportional: The peak line widths are multiplied by a factor.

    See also: NMRPlugin.SyntheticSpectrumMode

  • Number aModeParm1 [optional]

    - The peak line widths parameter regarding the mode. If the mode is Uniform indicates the desired line width in Hz. If the mode is Proportional then indicates the factor to be multiplied by the peak line widths. Else the parameter will be ignored.

  • Number aModeParm2 [optional]

    - If the NMR item is a 2D, then it's the parameter for the direct dimension (f2) and the previous parameter it is for the indirect one (f1). If it is not 2D then will be ignored.

syntheticPeaksSpectrum (NMRSpectrum aNMRItem, Array aPeakIdsArray, Number aMode, [Number aModeParm1], [Number aModeParm2]) : NMRSpectrum

Makes a synthetic spectrum from the peaks list of a given spectrum


List of parameters:
  • NMRSpectrum aNMRItem

    - The source spectrum which provides the peaks list

  • Array aPeakIdsArray

    - An array containing the peak ids to use to generate the synthetic spectrum.

    See also: Peak.id

  • Number aMode

    - The synthetic spectrum mode:

    • Synthetic: The peak line widths are kept.
    • Sticks: The peak line widths are set to 0.
    • Uniform: The peak line widths are set to a predefined value.
    • Proportional: The peak line widths are multiplied by a factor.

    See also: NMRPlugin.SyntheticSpectrumMode

  • Number aModeParm1 [optional]

    - The peak line widths parameter regarding the mode. If the mode is Uniform indicates the desired line width in Hz. If the mode is Proportional then indicates the factor to be multiplied by the peak line widths. Else the parameter will be ignored.

  • Number aModeParm2 [optional]

    - If the NMR item is a 2D, then it's the parameter for the direct dimension (f2) and the previous parameter it is for the indirect one (f1). If it is not 2D then will be ignored.

toString () : String




NMRPredictorParams

Properties

Name Type Comments
frequency Number
fromPPM Number
lineWidth Number
nucleus String
size Number
solvent Number
toPPM Number

frequency : Number

fromPPM : Number

lineWidth : Number

nucleus : String

size : Number

solvent : Number

toPPM : Number

Constructors

NMRPredictorParams ()




NMRPredictorPlugin

NMR Predictor Plugin object

Properties

Name Type Comments
silentMode Boolean

silentMode : Boolean

Set true to disable the prediction dialogs

Constructors

NMRPredictorPlugin (NMRPredictorPlugin aNMRPredictorPlugin)

Functions

Name Output Parameters
availablePredictors Array
predict String Molecule aMolecule, String aNucleus
predictHSQC String Molecule aMolecule
predictMolecule Object File aFile, String aNucleus, Array aPredArray, String aSolvent
samePredictionsData Boolean PageItem aMolecule1, PageItem aMolecule2
spinSimulationDataText String Molecule aMolecule, String aNucleus, Number aPrecision
updateUserDB String String aNucleus, String aSDFilePath, String aDBLetter, String aSolvent

availablePredictors () : Array

predict (Molecule aMolecule, String aNucleus) : String

Runs the prediction of the molecule and returns the id of the predicted spectrum


List of parameters:

				
var actWindow = mainWindow.activeDocument,
	itCount = actWindow.itemCount("Molecule"),
	i = 0,
	item,
	specId;
print("Molecule Count: "+itCount);
for (i=0; i < itCount; ++i) {
	item = actWindow.item(i, "Molecule");
	print(i+": "+item.uuid);
	spcId = Application.NMRPredictor.predict(item, "1H");
	print("Predicted Id: "+spcId);
}

			

predictHSQC (Molecule aMolecule) : String

Runs the HSQC prediction of the molecule and returns the id of the predicted spectrum


List of parameters:

				
var mol = new Molecule(Application.molecule.activeMolecule()),
		nmrItem;

nmrItem = Application.NMRPredictor.predictHSQC(mol);
print(nmrItem);
			
			

predictMolecule (File aFile, String aNucleus, Array aPredArray, String aSolvent) : Object


List of parameters:
  • File aFile
  • String aNucleus
  • Array aPredArray

    - A array with the names of the predictors to be used

  • String aSolvent

samePredictionsData (PageItem aMolecule1, PageItem aMolecule2) : Boolean

Returns true if both molecules have the same predictions data. The comparison is done atom by atom, the function expects two molecules with the same molfile.


List of parameters:

spinSimulationDataText (Molecule aMolecule, String aNucleus, Number aPrecision) : String

Returns a text with the Spin Simulation Data of the molecule aMolecule, using the aPrecision value in the numbers. Format text example: 1' = 2.15, J(1'-2) = 12.5, 2 = 4.5, J(2-1') = 12.5


List of parameters:
  • Molecule aMolecule
  • String aNucleus
  • Number aPrecision

updateUserDB (String aNucleus, String aSDFilePath, String aDBLetter, String aSolvent) : String

Sends the SDFile to the selected prediction database


List of parameters:
  • String aNucleus
  • String aSDFilePath
  • String aDBLetter
  • String aSolvent

				
function updateUserDB()
{
	if(Application.NMRPredictor == undefined)
		throw "Predictor Plugin not loaded";

	Application.NMRPredictor.silentMode = true
	Application.NMRPredictor.updateUserDB("1H","all1h.sdf","P", "CDCl3"); //nucleus, sdfile path, dbletter, solvent
	Application.NMRPredictor.silentMode = false
}
			
			



NMRProcessing

Enumerations

Name Type Values
ProcStop Number Default, FT1, FT2, OriginalFID, ProcessedFID

Properties

Name Type Comments
isValid Boolean
stopProc Number

isValid : Boolean

stopProc : Number

Processing step after which the process will be stopped

See also: NMRProcessing.ProcStop

Constructors

NMRProcessing (NMRProcessing aNMRProcessing)

  • NMRProcessing aNMRProcessing

				
var spectrum = nmr.activeSpectrum();
var proc = new NMRProcessing(spectrum.proc);
			
			

NMRProcessing (String aTemplateFile)

  • String aTemplateFile

				
var proc = new NMRProcessing("C:/test/aTemplate.mnp");
			
			

Functions

Name Output Parameters
getParameter Variant String aArgumentString
open Boolean aFilename
save Boolean aFilename
setApplyNothing
setParameter Variant String aArgumentString, Variant aValue
toString String

getParameter (String aArgumentString) : Variant

Returns the value of the aArgumentString processing parameter


List of parameters:

open ( aFilename) : Boolean

Fills this object with the processing template stored in a file


List of parameters:
  • aFilename

    - A path to the processing template file

save ( aFilename) : Boolean

Save this object to a file


List of parameters:
  • aFilename

    - A path to the processing template file

setApplyNothing ()

Clears all processing instructions

setParameter (String aArgumentString, Variant aValue) : Variant

Sets the value of the aArgumentString processing parameter


List of parameters:
  • String aArgumentString

    - See details

  • Variant aValue

    - Value

toString () : String




NMRReactionMonitor

Object that allows to create graph object to monitor a reaction. RMPlugin is necessary to use it.

Properties

Name Type Comments
documentId Document
fitModels Array
graphId Graph
responseFactor GraphResponseFactor
specId NMRSpectrum
stackedView Boolean
yModels Array

documentId : Document

The uuid of the document to be saved.

fitModels : Array

Array of GraphFitModel objects. Describes the fit to be done in each serie

See also: GraphFitModel

graphId : Graph

The uuid of the created graph object. It is undefined until some spectrum is added

responseFactor : GraphResponseFactor

Response Factor of the created graph

See also: GraphResponseFactor

specId : NMRSpectrum

The uuid of the NMR spectrum in which the imported spectra will be added

stackedView : Boolean

If true, the final spectrum will be displayed used Stacked View, if false Superimposed will be used

yModels : Array

Array of GraphYModel objects. Each one of them describes a serie in the graph

See also: GraphYModel

Signals

Functions

Name Output Parameters
finish
fitModelsFromXML Boolean String aXML
fromXML Boolean String aXML
graphItem Graph
init
nmrItem NMRSpectrum
onNewData Boolean NMRSpectrum aSpc
setFitModels Boolean Array aFitModelsArray
yModelsFromXML Boolean String aXML

finish ()

Cleans up the NMRReactionMonitor internal data

fitModelsFromXML (String aXML) : Boolean

Imports the reaction monitoring fit models from a XML file


List of parameters:
  • String aXML

fromXML (String aXML) : Boolean

Imports the reaction monitoring data from a XML file


List of parameters:
  • String aXML

graphItem () : Graph

Returns the Graph object with the NMRReactionMonitor.graphId uuid.

init ()

Initializes the NMRReactionMonitor

nmrItem () : NMRSpectrum

Returns the NMR Spectrum object with the NMRReactionMonitor.specId uuid.

onNewData (NMRSpectrum aSpc) : Boolean

Function to be called to add a new spectrum to the graph


List of parameters:

setFitModels (Array aFitModelsArray) : Boolean

Set the graph object fit models


List of parameters:
  • Array aFitModelsArray

yModelsFromXML (String aXML) : Boolean

Imports the reaction monitoring extraction data from a XML file


List of parameters:
  • String aXML



NMRSpectrum

NMRSpectrum page item

Inherits PageItem

Enumerations

Name Type Values
ArrayedDataType Number Diffusion, Kinetics, None, Relaxation, Unknown
ArrayedMode Number Active, Bitmap, Queued, Stacked, Superimposed, WhiteWashed

Properties

Name Type Comments
arrayedData Array
arrayedMode ArrayedMode
blindRegions Array of BlindRegion
className String
comment String
curSpecIndex Number
dimCount Number [read-only]
experimentType String
formattedTitle String [read-only]
isReal Boolean [read-only]
originalFormat String [read-only]
proc NMRProcessing
realMax Number [read-only]
realMin Number [read-only]
solvent String
specCount Number [read-only]
spectra Array
subtype String
temperature Number [read-only]
threshold Number
title String [read-only]

arrayedData : Array

Returns data visualized with the table Arrayed Data. Returned object has the following additional to Array properties: k, delay, pw, gamma, gtFormula, zFormula, type. See 'testArrayedData.qs' sample script for usage details.

arrayedMode : ArrayedMode

Arrayed view mode

See also: NMRSpectrum.ArrayedMode

blindRegions : Array of BlindRegion

See also: BlindRegion

className : String

Spectrum class

comment : String

Spectrum comment

curSpecIndex : Number

Controls active spectrum index of arrayed experiment. Index from zero to specCount-1.

dimCount : Number [read-only]

Number of dimensions

experimentType : String

Valid values: {"1D", "1D-APT", "1D-CPMG", "1D-DEPT-135", "1D-DEPT-45", "1D-DEPT-90", "1D-EDITED-CH", "1D-EDITED-CH2", "1D-EDITED-CH3", "1D-EDITED-CHn", "1D-EDITED-CQ", "1D-HAHN", "1D-INEPT", "1D-INVREC", "1D-JMOD", "1D-LOWFIELD", "1D-NOESY", "1D-ROESY", "1D-TOCSY", "2D-ADEQUATE", "2D-COSY", "2D-DOSY", "2D-DOSY", "2D-DQF-COSY", "2D-H2BC", "2D-HETCOR", "2D-HMBC", "2D-HMQC", "2D-HMQC-MB", "2D-HSQC", "2D-HSQC-EDITED", "2D-HSQC-TOCSY", "2D-HSQC-TOCSY-EDITED", "2D-INADEQUATE", "2D-JRES", "2D-NOESY", "2D-ROESY", "2D-ROSY", "2D-TOCSY"}

formattedTitle : String [read-only]

Formatted spectrum title shown on the spectrum

See also: NMRSpectrum.title

isReal : Boolean [read-only]

Is spectrum real or complex?

originalFormat : String [read-only]

Returns a file format from which the spectrum was imported.

Valid values: {"ASCII", "Bruker Aspect", "Bruker WIN-NMR", "Bruker XWIN-NMR", "Elscint", "GE/Nicolet", "JCAMP-DX", "JEOL Alice", "JEOL Delta", "JEOL EX/GX", "JEOL Lambda", "Lumisys", "Magritek Prospa", "MestReC", "MNova", "NMRPipe", "Nuts Type 1", "Nuts Type 2", "Nuts Type 3", "Old Gemini", "Predictor", "Siemens", "Spinsight", "SWANMR", "Tecmag", "Unknown", "Varian", "VHelper"}

realMax : Number [read-only]

The maximum of the spectrum.

realMin : Number [read-only]

The minimum of the spectrum.

solvent : String

Experiment solvent

specCount : Number [read-only]

Returns number of spectra for arrayed experiments

spectra : Array

Returns the array of NMRSpectrum for arrayed experiments.

subtype : String

Returns the spectrum subtype, with format: {nucleus} if dimCount = 1, i.e. "1H"; {nuclei, experimentType} if dimCount > 1, i.e. "1H13C, HSQC"

See also: Experiment Type, Nucleus

temperature : Number [read-only]

Experiment temperature

threshold : Number

Threshold

title : String [read-only]

Spectrum title from the table of parameters

See also: NMRSpectrum.formattedTitle

Constructors

NMRSpectrum (NMRSpectrum aSpectrum)

NMRSpectrum (String aXML)

Create a 1D spectrum from XML

  • String aXML

    - An XML describing peaks or multiplets

NMRSpectrum (Object aArgsObject)

Constructs an empty 1D or 2D spectrum

  • Object aArgsObject

				
var spec2D = new NMRSpectrum({
        1: {nucleus: myf1nuc, frequency: myf1mhz, from_ppm: myf1ppm1, to_ppm: myf1ppm2, size: myf1Size},
        2: {nucleus: myf2nuc, frequency: myf2mhz, from_ppm: myf2ppm1, to_ppm: myf2ppm2, size: myf2Size},
        filename: myFilename,
        origin: 'My DB',
        title: 'My Title'
        }
        );
var spec1D = new NMRSpectrum({
        1: {nucleus: myNucleus, frequency: myMhz, from_ppm: myppm1, to_ppm: myppm2, size: mySize},
        filename: myFilename,
        origin: 'My DB',
        title: 'My Title'
        }
        );
			
			

NMRSpectrum (Object aPredictArgs)

Constructs a 1D or 2D spectrum from the given peak list

  • Object aPredictArgs

    - An object with the properties 'args' and 'metadata'. The property 'args' should have the same list of parameters as defined in the constructors for 1D and 2D spectra. The property 'metadata' is a dictionary of metadata to attach to the spectrum. The predefined keys of the dictionary are 'filename', 'title', 'origin'.


				
var spec1D = new NMRSpectrum({args: [mySpecInfo, myPeaks], metadata: {title: 'My Title', origin: 'My DB', filename: myFilename}});
var spec2D = new NMRSpectrum({args: [f2SpecInfo, f2Peaks, f1SpecInfo, f1Peaks],
                              metadata: {title: 'My Title', origin: 'My DB', filename: myFilename}});
			
			

NMRSpectrum (NMRPredictorParams aSpecInfo, Array aPeakList, Boolean aAddPeaks = false)

Creates a 1D spectrum from the given peak list

  • NMRPredictorParams aSpecInfo
  • Array aPeakList

    - Array of peaks to simulate. Peak format: {"frequency", "intensity", "lineWidth", "nH"}

  • Boolean aAddPeaks

    - Add peaks to the spectrum peak list.

NMRSpectrum (NMRPredictorParams aSpecInfo F2, Array aPeakList F2, NMRPredictorParams aSpecInfo F1, Array aPeakList F1, Boolean aAddPeaks = false)

Creates a 2D spectrum from the given peak list

  • NMRPredictorParams aSpecInfo F2
  • Array aPeakList F2

    - Array of peaks to simulate. Peak format: {"frequency", "intensity", "lineWidth", "nH"}

  • NMRPredictorParams aSpecInfo F1
  • Array aPeakList F1

    - Array of peaks to simulate. Peak format: {"frequency", "intensity", "lineWidth", "nH"}

  • Boolean aAddPeaks

    - Add peaks to the spectrum peak list.

Functions

Name Output Parameters
align Boolean String aRefItemId, Number aRefSpc, Array aIndexArray
alignRegions Boolean Object aObject
appendSpectrum NMRSpectrum aNMRSpectrum
assignPeakToMultiplet String aMultipletUuid, String aPeakID
autoDetectNoiseRegions Array
autoFitting Boolean Boolean aShowDialog
autoScaleArrayed Number aFromHorz, Number aToHorz, Number aFromVert, Number aToVert
calcPeaksPurity Number
checkPeakVisibility Boolean Peaks aPeak
corrPearson Number NMRSpectrum aSpectrum
count Number Number aDim
count Number
deselectSpectra Array aSpecIndexes
exportFittingCurves Boolean String aFilePath, Object aOptions, [FitRegion aFitRegion]
exportFittingOptions Boolean String aFilePath
extractInnerTrace NMRSpectrum String aOrientation, String Number aTrace
fidCount Number
fidCount Number Number aDim
fidImag Number | Array Number | String | Object aIndex
fidImag Number | Array Number | String | Object aRow, Number | String | Object aCol
fidIsFID Boolean
fidReal Number | Array Number | String | Object aIndex
fidReal Number | Array Number | String | Object aRow, Number | String | Object aCol
fidSetImag Boolean Number | String | Object aIndex, Number | Array aValue
fidSetImag Boolean Number | String | Object aRow, Number | String | Object aCol, Number | Array aValue
fidSetReal Boolean Number | String | Object aIndex, Number | Array aValue
fidSetReal Boolean Number | String | Object aRow, Number | String | Object aCol, Number | Array aValue
fit FitRegion FitRegion aFitRegion, Boolean aShowDialog
fitRegions Array
fitToHeight
fitToHighestCompound
frequency
frequency Number aDim
getFullScaleLimits Object
getNMRAssignedMolecules Array
getNusSchema Array
getParam Variant String aParamName, [Boolean aPrecision = false]
getProperty Variant String aParam
getScaleLimits Object
gsdMultiplets GSDMultiplets
gsdPeaks GSDPeaks
hideSpectra Array aSpecIndexes
horzZoom Number aFrom, Number aTo, [String hUnits]
hz Number
hz Number Number aDim
imag Number | Array Number | String | Object aIndex
imag Number | Array Number | String | Object aRow, Number | String | Object aCol
importFittingOptions Boolean String aFilePath
integrals Integrals
isFID Boolean Number aDim
isInBlindHorzRegion Boolean Number aXPos
isInBlindVertRegion Boolean Number aYPos
isInCutHorzRegion Boolean Number aXPos
isInCutVertRegion Boolean Number aYPos
isInHiddenHorzRanges Boolean Number aXPos
isInHiddenVertRanges Boolean Number aYPos
isReadOnlyParam Boolean String aParam
isSpectrumSelected Boolean Number aSpecIndex
isSpectrumVisible Boolean Number aSpecIndex
isValid Boolean
isValid Boolean Number aDim
loadJeolProcList String aFileName
multiplets Multiplets
noiseFreeRegions Array minimumRegSizePPM
nucleus String Boolean aHtml
nucleus String Number aDim, Boolean aHtml
paramNames Array
peaks Peaks
process Boolean [NMRProcessing aProc]
processCurSpec Boolean [NMRProcessing aProc]
proposePhase1D Object
real Number | Array Number | String | Object aIndex
real Number | Array Number | String | Object aRow, Number | String | Object aCol
recalculateIntegrals Object aParameters, [String aIntgUuid]
recalculateMultipletIntegrals Object aParameters, [String aMultUuid]
reference Number aDim, Number aOldShift, Number aNewShift, Boolean aAutoTune, Number aAutoTuneTolerance, String aAnnotation, Boolean aAutoTuneAbsolute
removeSpectrum Boolean Number aSpecIndex
restoreFIDParameters
scaleToPage Object
scaleWidth Number Number aDim
scaleWidth Number
selectSpectra Array aSpecIndexes
setFitRegions Array aArrayOfFitRegions
setHiddenRanges Array of SpectrumRegion aHorzRanges, Array of SpectrumRegion aVertRanges
setImag Boolean Number | Array aIndex, Number | String | Object aValue
setImag Boolean Number | String | Object aRow, Number | String | Object aCol, Number | Array aValue
setIntegrals Integrals aIntegralsList
setMultiplets Multiplets aMultipletList
setNusSchema Array aSchema
setParam String aParamName, Variant aValue
setPeaks Peaks aPeakList
setProperty String aParam, Variant aValue
setReal Boolean Number | String | Object aIndex, Number | Array aValue
setReal Boolean Number | String | Object aRow, Number | String | Object aCol, Number | Array aValue
setTrace NMRSpectrum aSpc, Boolean aHorz, [Number aId]
showSpectra Array aSpecIndexes
solventName String Boolean aExtended
toString String
unitsToUnits Number String aFromUnits, String aToUnits, Number aValue, Number aDim
updateMultiplet [String aMultipletUuid]
updateTraces
vertZoom Number aFrom, Number aTo, [String vUnits]
zero Number Number aDim
zero Number
zoom Number aHFrom, Number aHTo, Number aVFrom, Number aVTo, [String hUnits], [String vUnits]
zoom Object aZoomObject

align (String aRefItemId, Number aRefSpc, Array aIndexArray) : Boolean

Align stacked spectra


List of parameters:
  • String aRefItemId

    - Uuid of the nmr item that contains the reference spectrum. If not specified the reference spectrum will be searched in this item.

  • Number aRefSpc

    - Index in the array of the reference spectrum

  • Array aIndexArray

    - If specified the alignment only be applied to the spectra of the array with these indexes

alignRegions (Object aObject) : Boolean

Align stacked spectra based on a list of regions


List of parameters:
  • Object aObject

    - An object with the following attributes:

    • String 'refItem'. The id of the reference item. If not defined the current item is used.
    • Number 'refIndex'. The index of the spectrum in the stack to be used as reference.
    • Array 'indexes'. An array with the spectrum indexes to be aligned. Empty or undefined to align all.
    • Array 'regions'. An array of {from, to} objects describing the regions to be aligned
    • Boolean 'global'. Set to true to run a global alignment in addition.

appendSpectrum (NMRSpectrum aNMRSpectrum)

Append all the spectra contained in NMRSpectrum passed as argument


List of parameters:
  • NMRSpectrum aNMRSpectrum

    - The NMR spectrum item to append. NOTE: It only works with arrayed items.

assignPeakToMultiplet (String aMultipletUuid, String aPeakID)

Assigns a peak to a multiplet.


List of parameters:

autoDetectNoiseRegions () : Array

Return a list of noise regions, only for 1D

autoFitting (Boolean aShowDialog) : Boolean

Detects and fits the line fitting regions automatically, using the line fitting options defined in the registry. If there are already regions in the spectrum (integration regions or multiplets), use them as fitting regions, if not, it detects the regions by using the autoIntegration algorithm defined in the registry. The parameter is optional, if true a progress dialog will be shown, by default is false.


List of parameters:
  • Boolean aShowDialog

autoScaleArrayed (Number aFromHorz, Number aToHorz, Number aFromVert, Number aToVert)

Auto adjust the intensity of arrayed spectra.


List of parameters:
  • Number aFromHorz

    - Optional paramater that defines the start value of the horizontal range in ppm

  • Number aToHorz

    - Optional paramater that defines the end value of the horizontal range in ppm

  • Number aFromVert

    - Optional paramater that defines the start value of the vertical range in ppm (only valid for 2D spectra)

  • Number aToVert

    - Optional paramater that defines the end value of the vertical range in ppm (only valid for 2D spectra)

calcPeaksPurity () : Number

Calculates the purity based on the peak types and returns its value. Purity values are enclosed in the range [0,1].

checkPeakVisibility (Peaks aPeak) : Boolean

Returns true if the user selected to show this type of peak in the properties dialog


List of parameters:

corrPearson (NMRSpectrum aSpectrum) : Number


List of parameters:
  • NMRSpectrum aSpectrum

count (Number aDim) : Number

Number of points in the dimension aDim


List of parameters:
  • Number aDim

count () : Number

Number of points in the last dimension

deselectSpectra (Array aSpecIndexes)

Deselects the spectra corresponding to the given indexes.


List of parameters:
  • Array aSpecIndexes

    - An array of indexes or a single index from zero to specCount-1. If no parameter is passed all the spectra will be used.

exportFittingCurves (String aFilePath, Object aOptions, [FitRegion aFitRegion]) : Boolean

Exports the fitting data set to true in the input aOptions to a CSV file specified in the input aFilePath. The CSV file will always have the column ppm with the "x" coordinates, and the respective columns with the "y" coordinates of those type of data selected in aOptions. The values are separated by commas.


List of parameters:
  • String aFilePath
  • Object aOptions

    - The export fitting options: {Intensities: Boolean, Sum: Boolean, Residue: Boolean, Peaks: Boolean}. In the case of Peaks, there will be one column for each peak in the fit region (or in the spectrum if no fit region is specified). By default, all options are set to true.

  • FitRegion aFitRegion [optional]

    - If a valid fit region is specified, it exports the data corresponding to this region, if not it exports the data for the whole spectrum.

exportFittingOptions (String aFilePath) : Boolean

Exports the current Line Fitting options to a JSON file specified in the input aFilePath


List of parameters:
  • String aFilePath

extractInnerTrace (String aOrientation, String Number aTrace) : NMRSpectrum

Extracts a trace of the spectrum. Returns the created NMR spectrum.


List of parameters:
  • String aOrientation

    - Select the desired type of trace

    Valid values: {"horizontal", "vertical"}

  • String Number aTrace

    - If aTrace is a number it describes the number of the column or row. If it is a string it can be "sum" to get the sum of all traces or "max" to get only the maximums in each trace.

See also: getInnerTracePoints

fidCount () : Number

Number of points in the FID

fidCount (Number aDim) : Number

Number of points in the dimension aDim if the FID


List of parameters:
  • Number aDim

fidImag (Number | String | Object aIndex) : Number | Array

Returns the imag value of the aIndex point in the FID. Ranges of points can be set as arguments. See description of real


List of parameters:
  • Number | String | Object aIndex

See also: fidReal, fidSetImag

fidImag (Number | String | Object aRow, Number | String | Object aCol) : Number | Array

Returns the imag value of a 2D FID at the position (aRow, aCol). Ranges of points can be set as arguments. See description of real


List of parameters:
  • Number | String | Object aRow
  • Number | String | Object aCol

See also: fidReal, fidSetImag

fidIsFID () : Boolean

Returns false if the initial FID was imported from processed data

fidReal (Number | String | Object aIndex) : Number | Array

Returns the real value of the aIndex point in the FID. Ranges of points can be set as arguments. See description of real


List of parameters:
  • Number | String | Object aIndex

See also: fidImag, fidSetReal

fidReal (Number | String | Object aRow, Number | String | Object aCol) : Number | Array

Returns the real value of a 2D FID at the position (aRow, aCol). Ranges of points can be set as arguments. See description of real


List of parameters:
  • Number | String | Object aRow
  • Number | String | Object aCol

See also: fidImag, fidSetReal

fidSetImag (Number | String | Object aIndex, Number | Array aValue) : Boolean

Sets the imag value of the aIndex point in the FID. Ranges of points can be set as arguments. See description of setReal. Should be framed with nmr.beginFidModification/ nmr.endFidModification .


List of parameters:
  • Number | String | Object aIndex
  • Number | Array aValue

See also: fidImag, fidSetReal

fidSetImag (Number | String | Object aRow, Number | String | Object aCol, Number | Array aValue) : Boolean

Sets the imag aValue at the position (aRow, aCol) of a 2D FID. Ranges of points can be set as arguments. See description of nmr.setReal . Should be framed with nmr.beginFidModification/ nmr.endFidModification .


List of parameters:
  • Number | String | Object aRow
  • Number | String | Object aCol
  • Number | Array aValue

See also: fidImag, fidSetReal

fidSetReal (Number | String | Object aIndex, Number | Array aValue) : Boolean

Sets the real value of the aIndex point in the FID. Ranges of points can be set as arguments. See description of setReal. Should be framed with nmr.beginFidModification/ nmr.endFidModification .


List of parameters:
  • Number | String | Object aIndex
  • Number | Array aValue

See also: fidReal, fidSetImag

fidSetReal (Number | String | Object aRow, Number | String | Object aCol, Number | Array aValue) : Boolean

Sets the real aValue at the position (aRow, aCol) of a 2D FID. Ranges of points can be set as arguments. See description of nmr.setReal . Should be framed with nmr.beginFidModification/ nmr.endFidModification .


List of parameters:
  • Number | String | Object aRow
  • Number | String | Object aCol
  • Number | Array aValue

See also: fidReal, fidSetImag

fit (FitRegion aFitRegion, Boolean aShowDialog) : FitRegion

Fits the region send as first parameter and returns a new fitted region. The second parameter is optional, if true a fit dialog will be shown, by default is false


List of parameters:
  • FitRegion aFitRegion
  • Boolean aShowDialog

fitRegions () : Array

Returns the array of fit regions

fitToHeight ()

Fits spectrum intensity to height

fitToHighestCompound ()

Fits spectrum intensity to heightest compound peak

frequency ()

frequency (Number aDim)


List of parameters:
  • Number aDim

getFullScaleLimits () : Object

Returns an object with the full scale of the spectrum. The returned object has these attributes: fromX, toX, fromY, toY.

getNMRAssignedMolecules () : Array

Returns the array of molecule items assigned to the spectrum

getNusSchema () : Array

Returns the NUS sampling schema

getParam (String aParamName, [Boolean aPrecision = false]) : Variant


List of parameters:
  • String aParamName

    - Parameter name as it appears in the table of parameters. If the parameter is N-dimensional then specify the dimension in []. Example: getParam("Nucleus[2]"). Additionally, it is possible to access vendor parameters. Example: getParam("procpar(axis)").

  • Boolean aPrecision [optional]

    - If true and the parameter is a floating point number, it returns the value with the precision displayed at the parameters table. Otherwise, returns the value as is.

See also: paramNames, setParam

getProperty (String aParam) : Variant


List of parameters:

See also: setProperty

getScaleLimits () : Object

Returns an object with the current zoom of the spectrum. The returned object has these attributes: fromX, toX, fromY, toY


				
function scaleLimitsTest()
{
	var spc = nmr.activeSpectrum();
	var sLimits = spc.getScaleLimits();
	var resultString = new String("%1 Axis: From %2, To %3");
	print(resultString.replace("%1", "Horizontal").replace("%2",sLimits.fromX).replace("%3",sLimits.toX));
	print(resultString.replace("%1", "Vertical").replace("%2",sLimits.fromY).replace("%3",sLimits.toY));
}
			
			

gsdMultiplets () : GSDMultiplets

Returns the list of GSD multiplets

gsdPeaks () : GSDPeaks

Returns the list of GSD peaks

hideSpectra (Array aSpecIndexes)

Hides the spectra corresponding to the given indexes.


List of parameters:
  • Array aSpecIndexes

    - An array of indexes or a single index from zero to specCount-1. If no parameter is passed the active spectrum index will be used.

horzZoom (Number aFrom, Number aTo, [String hUnits])

Without parameters makes a full zoom


List of parameters:
  • Number aFrom
  • Number aTo
  • String hUnits [optional]

hz () : Number

hz (Number aDim) : Number


List of parameters:
  • Number aDim

imag (Number | String | Object aIndex) : Number | Array

Returns the imag value of the aIndex point in the spectrum data. Ranges of points can be set as arguments. See description of real.


List of parameters:
  • Number | String | Object aIndex

See also: real, setImag

imag (Number | String | Object aRow, Number | String | Object aCol) : Number | Array

Returns the imag value of a 2D spectrum at the position (aRow, aCol). Ranges of points can be set as arguments. See description of real.


List of parameters:
  • Number | String | Object aRow
  • Number | String | Object aCol

See also: real, setImag

importFittingOptions (String aFilePath) : Boolean

Imports the Line Fitting options from the JSON file specified in the input aFilePath


List of parameters:
  • String aFilePath

integrals () : Integrals

Returns the list of integrals of the spectrum

isFID (Number aDim) : Boolean


List of parameters:
  • Number aDim

isInBlindHorzRegion (Number aXPos) : Boolean

Returns true if the position aXPos is inside of a blind region. False otherwise.


List of parameters:
  • Number aXPos

    - Horizontal value, in ppm's.

isInBlindVertRegion (Number aYPos) : Boolean

Returns true if the position aYPos is inside of a blind region. False otherwise.


List of parameters:
  • Number aYPos

    - Vertical value, in ppm's.

isInCutHorzRegion (Number aXPos) : Boolean

Returns true if the position aXPos is inside of a cut region. False otherwise.


List of parameters:
  • Number aXPos

    - Horizontal value, in ppm's.

isInCutVertRegion (Number aYPos) : Boolean

Returns true if the position aYPos is inside of a cut region. False otherwise.


List of parameters:
  • Number aYPos

    - Vertical value, in ppm's.

isInHiddenHorzRanges (Number aXPos) : Boolean

Returns true if the position aXPos is inside of a cut range or a blind region. False otherwise.


List of parameters:
  • Number aXPos

    - Horizontal value, in ppm's.

isInHiddenVertRanges (Number aYPos) : Boolean

Returns true if the position aYPos is inside of a cut range or a blind region. False otherwise. Valid for 2D spectra only.


List of parameters:
  • Number aYPos

    - Vertical value, in ppm's.

isReadOnlyParam (String aParam) : Boolean


List of parameters:
  • String aParam

isSpectrumSelected (Number aSpecIndex) : Boolean

Returns true if the spectrum for the given index is selected, and return false otherwise.


List of parameters:
  • Number aSpecIndex

    - A index from zero to specCount-1.

isSpectrumVisible (Number aSpecIndex) : Boolean

Returns true if the spectrum for the given index is visible, and return false otherwise.


List of parameters:
  • Number aSpecIndex

    - A index from zero to specCount-1.

isValid () : Boolean

Is a valid spectrum object

isValid (Number aDim) : Boolean

This dimension is less than dimCount


List of parameters:
  • Number aDim

loadJeolProcList (String aFileName)

Loads Jeol processing list from the specified file


List of parameters:
  • String aFileName

multiplets () : Multiplets

Returns the list of multiplets of the spectrum

noiseFreeRegions ( minimumRegSizePPM) : Array

Returns an array of noise free regions


List of parameters:
  • minimumRegSizePPM

nucleus (Boolean aHtml) : String


List of parameters:
  • Boolean aHtml

nucleus (Number aDim, Boolean aHtml) : String

Returns the nucleus of the dimension, if aHtml is true uses html


List of parameters:
  • Number aDim
  • Boolean aHtml

paramNames () : Array

Returns an array with all defined parameter names as they appear in the table of parameters.


				
function test()
{
	var spc = nmr.activeSpectrum();
	var paramNames = spc.paramNames();
	print("    " + paramNames.length +  " parameters.");
	for( var i = 0; i &lt; paramNames.length; i++ )
	{
		print(paramNames[i] + ": " + spc.getParam(paramNames[i]));
	}
}
			
			

See also: getParam, setParam

peaks () : Peaks

Returns the list of peaks of the spectrum

process ([NMRProcessing aProc]) : Boolean

Processes the spectrum using the aProc. With no parameter re-processes the spectrum. In case of stacked spectrum item applies the aProc to all spectra in the stack.


List of parameters:

See also: proc, processCurSpec

processCurSpec ([NMRProcessing aProc]) : Boolean

In case of stacked spectrum item processes the current spectrum using the aProc. With no parameter re-processes the spectrum. In case of a single-spectrum item does the same as process but requires to update the item explicitly.


List of parameters:

See also: curSpecIndex, proc, process

proposePhase1D () : Object

Proposes corrected phases for 1D spectrum using autophase routine. Returns object with properties: "ok" - equal to "true" if proposed phases are valid; "ph0", "ph1" - proposed phases in radians.

real (Number | String | Object aIndex) : Number | Array

If a single number is provided as an argument, returns the real value of the aIndex point in the spectrum data. Argument "all" returns an array with real values of all points in the spectrum. A specific range of points can be specified as an object of the type {from:aIndexFrom, to:aIndexTo}.


List of parameters:
  • Number | String | Object aIndex

				
real(400); - returns real value of the point with index 400
real({from:0, to:512}); - returns real values for points with indexes from 0 to 512.
real("all") - returns real values of all points in the spectrum.
				
			

See also: imag, setReal

real (Number | String | Object aRow, Number | String | Object aCol) : Number | Array

Returns the real value of a 2D spectrum at the position (aRow, aCol). An array of values or entire spectrum can be extracted by using objects of the kind {from:aIndexFrom, to:aIndexTo} or string "all" as arguments. If multipoint ranges are specified in both dimensions, the output is a double array.


List of parameters:
  • Number | String | Object aRow
  • Number | String | Object aCol

				
real(0,"all") - extracts row #0 from 2D spectrum
real({from:0, to:10}, {from:0,to:10}) - extracts square matrix 10x10 from 2D spectrum, starting at point (0,0)
				
			

See also: imag, real, setReal

recalculateIntegrals (Object aParameters, [String aIntgUuid])

Recalculates one or all the integral using the specified integral calculation settings.


List of parameters:
  • Object aParameters

    - An object enumerating the inegral calculation parameters.

    See also: Integral.calculationParams

  • String aIntgUuid [optional]

    - An optional inegral id to apply only the calculation to a specific integral region.

    See also: Integral.id

recalculateMultipletIntegrals (Object aParameters, [String aMultUuid])

Recalculates one or all the multiplet integrals using the specified integral calculation settings.


List of parameters:
  • Object aParameters

    - An object enumerating the inegral calculation parameters.

    See also: Multiplet.calculationParams

  • String aMultUuid [optional]

    - An optional multiplet id to apply only the calculation to a specific multiplet.

    See also: Mutiplet.uuid

reference (Number aDim, Number aOldShift, Number aNewShift, Boolean aAutoTune, Number aAutoTuneTolerance, String aAnnotation, Boolean aAutoTuneAbsolute)

Reference dimension


List of parameters:
  • Number aDim

    - Dimension

  • Number aOldShift

    - Old Shift

  • Number aNewShift

    - New Shift

  • Boolean aAutoTune

    - Try to find nearest maximum

  • Number aAutoTuneTolerance

    - Tolerance to find maximum

  • String aAnnotation
  • Boolean aAutoTuneAbsolute

    - Use absolute values when using auto-tune

removeSpectrum (Number aSpecIndex) : Boolean

Tries to remove the spectrum for the given index. Returns true if the item was removed and false otherwise (An arrayed item must have at least two spectra).


List of parameters:
  • Number aSpecIndex

    - A index from zero to specCount-1.

restoreFIDParameters ()

scaleToPage () : Object

Transform spectrum coordinates to page coordinates


				
function annotatePeak()
{
	var spc = nmr.activeSpectrum();
	var peakList = spc.peaks();
	print(peakList.count);
	var peak = peakList.at(0);
	print(peak);

	var peakCoordinates = new Object();
	peakCoordinates.x = peak.delta();
	peakCoordinates.y = peak.intensity;
	var transCoords = spc.scaleToPage(peakCoordinates);
	if (!transCoords)
		return;

	var arrowEndCoords = {};
	arrowEndCoords.x =  transCoords.x-10;
	arrowEndCoords.y =  transCoords.y-10;

	var arrowItem = draw.arrow( transCoords.x, transCoords.y,
	arrowEndCoords.x, arrowEndCoords.y, true, false);

	var txt = "&lt;p&gt;&lt;b&gt;Peak&lt;/b&gt; (delta: %1, intensity: %2)&lt;/p&gt;");
	var textItem = draw.text(txt.replace("%1", peak.delta()).replace("%2", peak.intensity), true);
	textItem.left = arrowEndCoords.x - textItem.width / 2.0;
	textItem.top = arrowEndCoords.y - textItem.height;

	spc.update();
	mainWindow.activeDocument.update();
}
			
			

scaleWidth (Number aDim) : Number


List of parameters:
  • Number aDim

scaleWidth () : Number

selectSpectra (Array aSpecIndexes)

Selects the spectra corresponding to the given indexes.


List of parameters:
  • Array aSpecIndexes

    - An array of indexes or a single index from zero to specCount-1. If no parameter is passed all the spectra will be used.

setFitRegions (Array aArrayOfFitRegions)

Sets the array of fit regions


List of parameters:
  • Array aArrayOfFitRegions

    - An array of fit regions

setHiddenRanges (Array of SpectrumRegion aHorzRanges, Array of SpectrumRegion aVertRanges)

Hides spectral ranges. Pass empty array [] to cancel hidden ranges.


List of parameters:
  • Array of SpectrumRegion aHorzRanges

    - Horizontal ranges to hide.

  • Array of SpectrumRegion aVertRanges

    - Vertical ranges to hide. Valid for 2D spectra only.

setImag (Number | Array aIndex, Number | String | Object aValue) : Boolean

Sets the imag value of the aIndex point in the spectrum data. Ranges of points can be set as arguments. See description of setReal.


List of parameters:
  • Number | Array aIndex
  • Number | String | Object aValue

See also: imag, setReal

setImag (Number | String | Object aRow, Number | String | Object aCol, Number | Array aValue) : Boolean

Sets the imag aValue at the position (aRow, aCol) of a 2D spectrum. Ranges of points can be set as arguments. See description of setReal. Should be framed with nmr.beginModification/nmr.endModification.


List of parameters:
  • Number | String | Object aRow
  • Number | String | Object aCol
  • Number | Array aValue

See also: imag, setReal

setIntegrals (Integrals aIntegralsList)


List of parameters:
  • Integrals aIntegralsList

setMultiplets (Multiplets aMultipletList)


List of parameters:

setNusSchema (Array aSchema)

Sets the NUS sampling schema


List of parameters:
  • Array aSchema

setParam (String aParamName, Variant aValue)

Assigns specified value to the named parameter. This function only allows to alter user defined parameters.


List of parameters:
  • String aParamName

    - Parameter name as it appears in the table of parameters. If the parameter is N-dimensional then specify the dimension in [].

  • Variant aValue

See also: getParam, paramNames

setPeaks (Peaks aPeakList)


List of parameters:

setProperty (String aParam, Variant aValue)


List of parameters:

See also: getProperty

setReal (Number | String | Object aIndex, Number | Array aValue) : Boolean

Sets the real value of the aIndex point in the spectrum data. First argument could be set as an individual index of a point, as "all" or as an object with a range of points. See description of real for examples how to specify ranges of points. If multipoint range is specified, the second argument can be an array of numbers to fill the range. If a single number is specified along with a range of points, then the entire range will be filled with the number. Should be framed with nmr.beginModification/nmr.endModification.


List of parameters:
  • Number | String | Object aIndex
  • Number | Array aValue

				
setReal(5, 0.5)
setReal({from:0, to:3}, [0, 1, 2, 3])
				
			

See also: real, setImag

setReal (Number | String | Object aRow, Number | String | Object aCol, Number | Array aValue) : Boolean

Sets the real aValue at the position (aRow, aCol) of a 2D spectrum. Ranges of points can be set as arguments. See description of real for examples. Should be framed with nmr.beginModification/nmr.endModification.


List of parameters:
  • Number | String | Object aRow
  • Number | String | Object aCol
  • Number | Array aValue

				
setReal(0, 5, 0.5)
setReal(0, {from:0, to:2}, [0, 1, 2])
setReal({from:0, to:1}, {from:0, to:1}, [[0, 1], [2, 3]])
				
			

See also: real, setImag

setTrace (NMRSpectrum aSpc, Boolean aHorz, [Number aId])

Sets the horizontal or vertical trace of a 2D spectrum.


List of parameters:
  • NMRSpectrum aSpc

    - Spectrum to be add as trace.

  • Boolean aHorz

    - True to set the horizontal trace, false to set the vertical

  • Number aId [optional]

    - If the trace belong to a stacked spectra, it identifies the spectrum ID in the stack

showSpectra (Array aSpecIndexes)

Shows the spectra corresponding to the given indexes.


List of parameters:
  • Array aSpecIndexes

    - An array of indexes or a single index from zero to specCount-1. If no parameter is passed all the spectra will be used.

solventName (Boolean aExtended) : String

Experiment solvent name


List of parameters:
  • Boolean aExtended

    - True to return the extended name, false to return the name displayed on the parameters table

toString () : String

unitsToUnits (String aFromUnits, String aToUnits, Number aValue, Number aDim) : Number

Transforms the given value from aFromUnits to aToUnits


List of parameters:
  • String aFromUnits

    Valid values: {"Hz", "ppm", "pt", "sec"}

  • String aToUnits

    Valid values: {"Hz", "ppm", "pt", "sec"}

  • Number aValue
  • Number aDim

				
function unitsToUnitsTest()
{
	var spc = nmr.activeSpectrum(),
	hz = spc.unitsToUnits("ppm", "hz", 4.5, 1);
	print("%1 ppm is %2 Hz".replace("%1", 4.5).replace("%2", hz));
}
			
			

updateMultiplet ([String aMultipletUuid])

Updates all the multiplets or a given multiplet after being modified. It updates the area, the J analysis and the range.


List of parameters:
  • String aMultipletUuid [optional]

    - The multiplet UUID to specify which multiplet to update. If omitted all the multiplets will be updated.

updateTraces ()

Updates the traces of a 2D spectrum.

vertZoom (Number aFrom, Number aTo, [String vUnits])

Without parameters makes a full zoom


List of parameters:
  • Number aFrom
  • Number aTo
  • String vUnits [optional]

zero (Number aDim) : Number


List of parameters:
  • Number aDim

zero () : Number

zoom (Number aHFrom, Number aHTo, Number aVFrom, Number aVTo, [String hUnits], [String vUnits])

Without parameters makes a full zoom


List of parameters:
  • Number aHFrom
  • Number aHTo
  • Number aVFrom
  • Number aVTo
  • String hUnits [optional]
  • String vUnits [optional]

zoom (Object aZoomObject)

Without parameters makes a full zoom


List of parameters:
  • Object aZoomObject

    - A object with these attributes: fromX, toX, fromY, toY, horzUnits, vertUnits




NMRTDFormCheck

An object to do TD NMR quantitation in A+B mixtures

Table of contents

  1. Constructors
  2. Functions

Constructors

NMRTDFormCheck ()

Functions

Name Output Parameters
calculateMixtureRate Object NMRSpectrum aNMRItem, Object aCalibResultA, Object aCalibResultB
calibrateRelaxRate Object NMRSpectrum aNMRItem, [Number aNormFactor]

calculateMixtureRate (NMRSpectrum aNMRItem, Object aCalibResultA, Object aCalibResultB) : Object

Given a TD NMR mixture it estimates the quantity of compound A and compound B given the relaxation times for both compounds. It returns either an objec like {"a_rate": 0.25, "b_rate": 0.75 } or it throws an exception.


List of parameters:

calibrateRelaxRate (NMRSpectrum aNMRItem, [Number aNormFactor]) : Object

Given a TD NMR experiment it estimates the relaxation time or throws an error. The returned object has the form: { "isExpProb": 0.9933, "relaxTime": 580.3058, "relaxTimeErr": 2.7285, "relaxRate": 1.723E-3, "relaxRateErr": 8.1023E-6, "normFactor": 0.8345, "curveData: [1e-3, 1e-2,...1] } The relaxation times are in ms and the relaxation rates in ms-1


List of parameters:
  • NMRSpectrum aNMRItem
  • Number aNormFactor [optional]

    - The normalization factor: Nuclei_count/Molecular_weight. By default is 1.0




NMRVerifySettings

The NMR verification settings

Table of contents

  1. Properties

Properties

Name Type Comments
badWater Boolean
expectedSamplePurity String
integralsValueError Number
known1HImpurities Array
predErrorFactor13C Number
predErrorFactor1H Number

badWater : Boolean

Indicates if the sample contains an ugly water peak

expectedSamplePurity : String

A hint on how much pure is the sample

Valid values: {"High", "Low", "Normal"}

integralsValueError : Number

The maximum error ratio for the experimental integral values when compared with the predicted ones.

known1HImpurities : Array

An array telling which impurities are expected in the sample

Valid values: {Acetone, Acetone-d5, CDCl3, DMSO, DMSO-d6, EtOH, IPA, MeOH, MeOH-d4}

predErrorFactor13C : Number

The 13C prediction error factor.

predErrorFactor1H : Number

The 1H prediction error factor.




NNTestSolution

Table of contents

  1. Properties

Properties

Name Type Comments
likelyhood Number [read-only]
likelyhoodEx Number [read-only]
likelyhoods Array [read-only]
normFactor Number [read-only]
nuclidesCount Array [read-only]
offendingIdx Number [read-only]
totalNuclides Number [read-only]

likelyhood : Number [read-only]

The global probability for the total number of nuclides. [0 (no match),1 (perfect match)]

likelyhoodEx : Number [read-only]

The global probability for the total number of nuclides if the most offending integral were ignored (artifact)

likelyhoods : Array [read-only]

An array containing the individual probabilities of each integral value for the given number of nuclides

normFactor : Number [read-only]

The normalization factor to be applied to the integrals array

nuclidesCount : Array [read-only]

An array containing the number of nuclides for each integral value

offendingIdx : Number [read-only]

The index of the most offending integral (which has the worst match probability)

totalNuclides : Number [read-only]

The total number of nuclides




OLEContainer

Global object for managing OLE objects

Table of contents

  1. Functions

Functions

Name Output Parameters
createObjectFromFile PageItem String aPath
toString String

createObjectFromFile (String aPath) : PageItem

Adds an OLE object to the current document page.


List of parameters:
  • String aPath

    - Path to the file from which the OLE object should be created

toString () : String




Page

Page object

Properties

Name Type Comments
auditTrail AuditTrailItem
bottom Number [read-only]
height Number [read-only]
items Array [read-only]
left Number [read-only]
margins Object [read-only]
notes String
right Number [read-only]
title String
top Number [read-only]
uuid String [read-only]
width Number [read-only]

auditTrail : AuditTrailItem

bottom : Number [read-only]

Bottom margin of the page (mm)

height : Number [read-only]

Height of the page

items : Array [read-only]

All page items

left : Number [read-only]

Left margin of the page (mm)

margins : Object [read-only]

Margins of the page, the returned object has the bottom, top, left and right attributes


				
function pageMarginsTest()
{
	var page = mainWindow.activeDocument.curPage();
	var margs = page.margins;
	print(margs.top);
	print(margs.bottom);
	print(margs.left);
	print(margs.right);
}
			
			

notes : String

Page notes.

right : Number [read-only]

Right margin of the page (mm)

title : String

Page title.

top : Number [read-only]

Top margin of the page (mm)

uuid : String [read-only]

Returns page UUID

width : Number [read-only]

Width of the page

Constructors

Page (Page aPage)

Functions

Name Output Parameters
addItem PageItem aPageItem
cloneItems Array Array aPageItems
deleteItems PageItem | Array aPageItems
deleteItems PageItem | Array aPageItems
guiCoordToScriptCoord Object Number aGuiX, Number aGuiY, Number aGuiWidth, Number aGuiHeight
item Number aIndex, String aType
item Number aIndex
itemCount Number String aType
itemCount Number
itemsByName Array String aType1, ..., String aTypeN
scriptCoordToGuiCoord Object Number aScriptLeft, Number aScriptTop, Number aScriptWidth, Number aScriptHeight
toPixmap Pixmap Number aDpi
toString String
update

addItem (PageItem aPageItem)

Adds a item to the page


List of parameters:

cloneItems (Array aPageItems) : Array

Create a copy of the page items and adds them to this page. Returns an array with the new items


List of parameters:
  • Array aPageItems

    - A page item or an array of page items

deleteItems (PageItem | Array aPageItems)

Delete the items


List of parameters:
  • PageItem | Array aPageItems

    - A page item or an array of page items

Page.deleteItems (PageItem | Array aPageItems)

Delete the items


List of parameters:
  • PageItem | Array aPageItems

    - A page item or an array of page items

guiCoordToScriptCoord (Number aGuiX, Number aGuiY, Number aGuiWidth, Number aGuiHeight) : Object

Transform GUI coordinates to script coordinates. Returns an object with the attributes left, top, width and height


List of parameters:
  • Number aGuiX
  • Number aGuiY
  • Number aGuiWidth
  • Number aGuiHeight

				
function testCoordTransform()
{
	page = mainWindow.activeDocument.curPage();

	var spec = nmr.activeSpectrum();
	print("Spec script coord");
	print(spec.left);
	print(spec.top);
	print(spec.width);
	print(spec.height);

	print("Spec gui coord");
	var specGUI=page.scriptCoordToGuiCoord(spec.left, spec.top,
	spec.width, spec.height);
	print(specGUI.x);
	print(specGUI.y);
	print(specGUI.width);
	print(specGUI.height);

	print("Re Spec scriptcoord");
	var specScript = page.guiCoordToScriptCoord(specGUI.x, specGUI.y,
	specGUI.width, specGUI.height);
	print( specScript.left );
	print( specScript.top );
	print( specScript.width );
	print( specScript.height );
}
			
			

item (Number aIndex, String aType)

Returns the item number aIndex of the page


List of parameters:
  • Number aIndex

    - Number of elements

  • String aType

    - Element Type

item (Number aIndex)

Returns a item of the page


List of parameters:
  • Number aIndex

itemCount (String aType) : Number

Number of elements in the page


List of parameters:
  • String aType

    - Element Type

    Valid values: {"Arrow", "CurvedArrow", "Ellipse", "Graph", "Image", "Layout Template", "Mass Spectrum", "Molecule", "NMR Spectrum", "OLE Object", "Polygon", "Rectangle", "Text"}

itemCount () : Number

Number of elements in the page

itemsByName (String aType1, ..., String aTypeN) : Array

Returns an array of page items of the specified types.


List of parameters:
  • String aType1
  • ...
  • String aTypeN

				
var specItems = itemsByName('NMR Spectrum', 'Mass Spectrum');
				
			

scriptCoordToGuiCoord (Number aScriptLeft, Number aScriptTop, Number aScriptWidth, Number aScriptHeight) : Object

Transform script coordinates to GUI coordinates. Returns an object with the attributes x, y, width and height


List of parameters:
  • Number aScriptLeft
  • Number aScriptTop
  • Number aScriptWidth
  • Number aScriptHeight

toPixmap (Number aDpi) : Pixmap


List of parameters:
  • Number aDpi

toString () : String

update ()

Refresh the page




PageItem

Item of a page

Inherited by: Arrow, BaseSpectrum, CurvedArrow, Ellipse, LayoutTemplate, Molecule, Polygon, Rectangle, Text

Properties

Name Type Comments
angle Number
bottom Number
children Array [read-only]
color String
dataId String [read-only]
height Number
left Number
lineColor String
lineStyle Number
linkId String [read-only]
name String [read-only]
opacity Number
originalFileName String [read-only]
page Page [read-only]
parentUuid String [read-only]
right Number
subtype String
top Number
type String
uuid String [read-only]
width Number

angle : Number

Angle of the item in degrees

bottom : Number

Returns the bottom margin of the item

children : Array [read-only]

Returns an array of objects containing the child PageItem.uuid and the type of child like {"id":"{C96693BE-6A74-48FA-8EF0-EDE46927774F}", "type":"Auto"}.

color : String

Color of the item.

Valid values: {"#RRGGBB", "Color Keywords"}

See also: getBrush, setBrush

dataId : String [read-only]

The data identifier held by some PageItems like Molecule

height : Number

Height of the item

left : Number

Returns the left margin of the item

lineColor : String

Color of the line.

Valid values: {"#RRGGBB", "Color Keywords"}

See also: getPen, setPen

lineStyle : Number

Style of the line.

Valid values: {0 - No line, 1 - Solid line, 2 - Dash line, 3 - Dot line, 4 - Dash dot line, 5 - Dash dot dot line}

See also: getPen, setPen

linkId : String [read-only]

A persistent identifier for this item

name : String [read-only]

Identifies the page item type

Valid values: {"Arrow", "CurvedArrow", "Ellipse", "Graph", "Image", "Layout Template", "Mass Spectrum", "Molecule", "NMR Spectrum", "OLE Object", "Polygon", "Rectangle", "Text"}

opacity : Number

The percentage of colour opacity.

See also: getBrush, setBrush

originalFileName : String [read-only]

If the PageItem was imported from a file then this property returns the file name

page : Page [read-only]

Returns the Page containing the item. It can be null if the item is not shown in any page.

parentUuid : String [read-only]

Returns the parent's item uuid or an empty string if there is no parent.

right : Number

Returns the right margin of the item

subtype : String

top : Number

Returns the top margin of the item

type : String

uuid : String [read-only]

Non-persistent unique identifier for this item

width : Number

Width of the item

Constructors

PageItem (PageItem aPageItem)

Functions

Name Output Parameters
addChild PageItem | Array aPageItems
addChildItems PageItem | Array aPageItems
clearMetaData Boolean aHidded = false
getBrush Object
getLinkedItems Array String aRole
getMetaData Object String aName, Boolean aHidded = false
getPen Object
hasMetaData Boolean String aName, Boolean aHidded = false
linkItems String aRole, PageItem | Array aPageItems
remove
removeChild PageItem | Array aPageItems
removeMetaData String aName, Boolean aHidded = false
setBrush Object aBrush
setChildType PageItem aPageItem, String aType
setMetaData String aName, Object aValue, Boolean aHidded = false
setPen Object aPen
toPixmap Pixmap Number aDpi
toString String
translate Number aXShift, Number aYShift
unlinkAllItems String aRole
unlinkItems String aRole, PageItem | Array aPageItems
update

addChild (PageItem | Array aPageItems)

Links the aPageItems's coordinates to the scale or canvas units


List of parameters:
  • PageItem | Array aPageItems

    - A page item or an array of page items.

addChildItems (PageItem | Array aPageItems) [deprecated]

Links the aPageItems's coordinates to the spectral coordinates. Calling the function for the non spectral items has no effect.


List of parameters:
  • PageItem | Array aPageItems

    - A page item or an array of page items. The expected items are the annotation items: arrows, curved arrows, curves, lines, texts, rectangles, ellipses, polygons

clearMetaData (Boolean aHidded = false)

Clears the whole metadata container of PageItem


List of parameters:
  • Boolean aHidded

See also: getMetaData, hasMetaData, removeMetaData, setMetaData

getBrush () : Object

Returns an object with the following properties: color, style, opacity

See also: setBrush

getLinkedItems (String aRole) : Array

Returns the array of pageItems linked to this current item, with the type of link aRole.


List of parameters:
  • String aRole

    - Type of link

    Valid values: {"assignments", "predictions"}

See also: unlinkAllItems, unlinkItems, unlinkItems

getMetaData (String aName, Boolean aHidded = false) : Object

Returns the named metadata of PageItem


List of parameters:
  • String aName
  • Boolean aHidded

See also: clearMetaData, hasMetaData, removeMetaData, setMetaData

getPen () : Object

Returns an object with the following properties: color, style

See also: setPen

hasMetaData (String aName, Boolean aHidded = false) : Boolean

Checks if PageItem has the named metadata


List of parameters:
  • String aName
  • Boolean aHidded

See also: clearMetaData, getMetaData, removeMetaData, setMetaData

linkItems (String aRole, PageItem | Array aPageItems)

Sets a link of type aRole between the item and the aPageItems


List of parameters:
  • String aRole

    - Type of link

    Valid values: {"Assignments", "DataAnalysis", "Predictions11B", "Predictions13C", "Predictions15N", "Predictions17O", "Predictions19F", "Predictions1H", "Predictions29Si", "Predictions31P", "PredictionsCompare", "PredictionsHighlight", "SpinSimulation", "Verification"}

  • PageItem | Array aPageItems

    - A page item or an array of page items

See also: getLinkedItems, unlinkAllItems, unlinkItems

remove ()

Deletes the item from a page

removeChild (PageItem | Array aPageItems)

Unlinks the aPageItems's coordinates to the scale or canvas units


List of parameters:
  • PageItem | Array aPageItems

    - A page item or an array of page items child of this PageItem.

removeMetaData (String aName, Boolean aHidded = false)

Removes the named metadata from PageItem


List of parameters:
  • String aName
  • Boolean aHidded

See also: clearMetaData, getMetaData, hasMetaData, setMetaData

setBrush (Object aBrush)

Sets the brush (fill) properties: color, style, opacity


List of parameters:
  • Object aBrush

    - Any object which contains any of the following properties: color, style, opacity

    Valid values for 'color': {#RRGGBB, Color Keywords}

    Valid values for 'style': {00 - No brush, 01 - Uniform color, 02 - Extremely dense, 03 - Very dense, 04 - Somewhat dense, 05 - Half dense, 06 - Somewhat sparse, 07 - Very sparse, 08 - Extremely sparse, 09 - Horizontal lines, 10 - Vertical lines, 11 - Crossing horizontal and vertical lines, 12 - Backward diagonal lines, 13 - Forward diagonal lines, 14 - Crossing diagonal lines}

See also: getBrush

setChildType (PageItem aPageItem, String aType)

Sets the aPageItems's coordinates link to the scale or canvas units


List of parameters:
  • PageItem aPageItem

    - A page item child of this PageItem

  • String aType

    - Type of link

    Valid values: {"Auto", "Canvas"}

setMetaData (String aName, Object aValue, Boolean aHidded = false)

Sets the named metadata of PageItem


List of parameters:
  • String aName
  • Object aValue
  • Boolean aHidded

See also: clearMetaData, getMetaData, hasMetaData, removeMetaData

setPen (Object aPen)

Sets the pen (line) properties: color, style


List of parameters:
  • Object aPen

    - Any object which contains any the following properties: color, style

    Valid values for 'color': {#RRGGBB, Color Keywords}

    Valid values for 'style': {0 - No line, 1 - Solid line, 2 - Dash line, 3 - Dot line, 4 - Dash dot line, 5 - Dash dot dot line}

See also: getPen

toPixmap (Number aDpi) : Pixmap


List of parameters:
  • Number aDpi

toString () : String

translate (Number aXShift, Number aYShift)

Moves the item


List of parameters:
  • Number aXShift
  • Number aYShift

unlinkAllItems (String aRole)

Removes a link of type aRole between the aPageItems and all other items


List of parameters:
  • String aRole

    - Type of link

    Valid values: {"assignments", "predictions", "predictions11B", "predictions13C", "predictions15N", "predictions17O", "predictions19F", "predictions1H", "predictions29Si", "predictions31P"}

See also: getLinkedItems, linkItems, unlinkItems

unlinkItems (String aRole, PageItem | Array aPageItems)

Removes a link of type aRole between the item and the aPageItems


List of parameters:
  • String aRole

    - Type of link

    Valid values: {"assignments", "predictions", "predictions11B", "predictions13C", "predictions15N", "predictions17O", "predictions19F", "predictions1H", "predictions29Si", "predictions31P"}

  • PageItem | Array aPageItems

    - A page item or an array of page items

See also: getLinkedItems, linkItems, unlinkAllItems

update ()

Recalculates the item. To redraw call update() function of the Document




Peak

Enumerations

Name Type Values
Flags Number C13Satellite, Hidden, Labile, None, Rotational, Solvent2ary, Weak
FlagsExc Number C13Satellite, Hidden, Labile, Rotational, Weak
FlagsInc Number Artifact, Compound, Impurity, Q_Reference, S_Reference, Solvent
Kinds Number Maximum, Minimum
Modes Number AllModes, Auto, Fit, Manual, Reference
Types Number Artifact, Compound, CS_Ref, Impurity, Quantification_Ref, Solvent

Properties

Name Type Comments
annotation String
compoundId String
flags Peak.Flags
id String [read-only]
integral Number [read-only]
intensity Number [read-only]
kind Peak.Kinds
kurtosis Number [read-only]
mode Peak.Modes
modeOptions Object
type Peak.Types

annotation : String

compoundId : String

flags : Peak.Flags

id : String [read-only]

integral : Number [read-only]

The peak integral using ppm's as units for the peak parameters NOTE: This value is not the same as the value shown in the NMR peaks table.

See also: Peak.integralInPts

intensity : Number [read-only]

kind : Peak.Kinds

kurtosis : Number [read-only]

mode : Peak.Modes

modeOptions : Object

Object describing the peak picking algorithm used for the peak generation. Possible members are "method" and "options".

type : Peak.Types

Constructors

Peak (Object aPeakDescriptor)

  • Object aPeakDescriptor

    - A script object describing the Peak properties


				
var pkDesc = {};
pkDesc.center = 8.5211; // ppm
pkDesc.width = 0.002;   // ppm
pkDesc.height = 300.0;
pkDesc.phase = 0.0;
pkDesc.shapeType = "Generalized Lorentzian"
pkDesc.shapeParam = 0.5;
var peak = new Peak(pkDesc);
			
			

Peak (Peak aPeak)

Copy

Peak (Number aPos, Number aIntensity)

  • Number aPos
  • Number aIntensity

Peak (Number aPos, NMRSpectrum aSpectrum)

Peak (Number aPos1, Number aPos2, Number aIntensity)

  • Number aPos1
  • Number aPos2
  • Number aIntensity

Peak (Number aPos1, Number aPos2, NMRSpectrum aSpectrum)

Functions

Name Output Parameters
compoundLabel String String aSpecSolvent
delta Number aDim
delta Number
integralInPts Number NMRSpectrum aSpec
setFlag Peak.Flags aFlag, Boolean aEnable
toString String
width Number aDim
width Number

compoundLabel (String aSpecSolvent) : String

The value returned corresponds to the Impurity/Compound column in the table of peaks.


List of parameters:

delta (Number aDim)


List of parameters:
  • Number aDim

    - Peak position (shift) in ppm.

delta () : Number

integralInPts (NMRSpectrum aSpec) : Number

The peak integral using points as units for the peak parameters


List of parameters:
  • NMRSpectrum aSpec

    - The NMR spectrum object used to perform the units conversions

setFlag (Peak.Flags aFlag, Boolean aEnable)

Sets/Resets a flag from Flags enumeration


List of parameters:
  • Peak.Flags aFlag

    - The flag to set/reset

  • Boolean aEnable

    - If true, the flag is set, else the flag is reset.

toString () : String

width (Number aDim)


List of parameters:
  • Number aDim

    - Peak width in ppm.

width () : Number




Peaks

Properties

Name Type Comments
count Number

count : Number

Constructors

Peaks ()

Empty peak list

Peaks (Peaks aPeakList)

  • Peaks aPeakList

    - Copy aPeakList

Peaks (NMRSpectrum aSpectrum, SpectrumRegion aRegion)

Functions

Name Output Parameters
append Peak aPeak
at Peak Number aDim
byId Peak String aPeakId
clear Number aIndex
indexOf Number String aPeakId
removeAt Number aIndex
sort Boolean bAscending
sort Boolean bHAscending, Boolean bVAscending
toString String

append (Peak aPeak)


List of parameters:
  • Peak aPeak

at (Number aDim) : Peak


List of parameters:
  • Number aDim

byId (String aPeakId) : Peak

Gets a peak given the peak id


List of parameters:

clear (Number aIndex)


List of parameters:
  • Number aIndex

indexOf (String aPeakId) : Number

Gets the peak index given the peak id. It will return -1 if the peak was not found.


List of parameters:

removeAt (Number aIndex)


List of parameters:
  • Number aIndex

sort (Boolean bAscending)


List of parameters:
  • Boolean bAscending

sort (Boolean bHAscending, Boolean bVAscending)


List of parameters:
  • Boolean bHAscending
  • Boolean bVAscending

toString () : String




PeakTable

Table of contents

  1. Constructors
  2. Functions

Constructors

PeakTable (PeakTable aPeakTable)

Functions

Name Output Parameters
spectrum NMRSpectrum
toString String

spectrum () : NMRSpectrum

toString () : String




PhysChemPlugin

The Mnova PhysChem plug-in object. Object name: "physchem".

Properties

Name Type Comments
propertyNames Array

propertyNames : Array

Array of all the property names.

Constructors

PhysChemPlugin (PhysChemPlugin aPhysChemPlugin)

Functions

Name Output Parameters
calculate Array Array aMolItems

calculate (Array aMolItems) : Array

Calculate the PhysChem properties of the aMolItems and set the values in each molecule. Return an array of objects, with two properties: moldId and properties. Properties is also an array of objects, with two properties: name and value. See the example below.


List of parameters:

				
{molId: {d2daefee-d40f-4285-93aa-5b56dd68ca2f},
 properties: {	{ name: logP, value: -2.38621},
	{ name: MolarVolume, value: 737.368},
	{ name: SurfaceArea_+PSA-Donor, value: 16.1227},
	{ name: SurfaceArea_-PSA-Acceptor, value: 24.16},
	{ name: SurfaceArea_Neutral, value: 99.2692},
	{ name: SurfaceArea_Total, value: 141.481} }
}
				
			



Pixmap

Enumerations

Name Type Values
AspectRatioMode Number IgnoreAspectRatio, KeepAspectRatio, KeepAspectRatioByExpanding
TransformationMode Number FastTransformation, SmoothTransformation

Properties

Name Type Comments
height Number
isNull Boolean
width Number

height : Number

isNull : Boolean

width : Number

Constructors

Pixmap (String aPath, String aFormat, Number aImageConversionFlags)

  • String aPath
  • String aFormat

    - If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.

  • Number aImageConversionFlags

    - If the image needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.

Pixmap ( aCopyPixmap)

  • aCopyPixmap

Functions

Name Output Parameters
fill String aColor
load Boolean String aPath, String aFormat, Number aImageConversionFlags
loadFromData Boolean String aData, String aFormat, Number aImageConversionFlags
rotated Pixmap Number aAngleDegrees, TransformationMode aTransform
save Boolean String aPath, String aFormat, Number aQuality
scaled Pixmap Number aWidth, Number aHeight, AspectRatioMode aAspectRatio, TransformationMode aTransform
scaledToHeight Pixmap Number aHeight, TransformationMode aTransform
scaledToWidth Pixmap Number aWidth, TransformationMode aTransform
toByteArray ByteArray String aFormat, Number aQuality

fill (String aColor)


List of parameters:
  • String aColor

load (String aPath, String aFormat, Number aImageConversionFlags) : Boolean


List of parameters:
  • String aPath
  • String aFormat
  • Number aImageConversionFlags

loadFromData (String aData, String aFormat, Number aImageConversionFlags) : Boolean


List of parameters:
  • String aData
  • String aFormat
  • Number aImageConversionFlags

rotated (Number aAngleDegrees, TransformationMode aTransform) : Pixmap


List of parameters:
  • Number aAngleDegrees
  • TransformationMode aTransform

save (String aPath, String aFormat, Number aQuality) : Boolean


List of parameters:
  • String aPath
  • String aFormat
  • Number aQuality

    - The quality factor must be in the range [0,100] or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed files, and -1 to use the default settings.

scaled (Number aWidth, Number aHeight, AspectRatioMode aAspectRatio, TransformationMode aTransform) : Pixmap


List of parameters:
  • Number aWidth
  • Number aHeight
  • AspectRatioMode aAspectRatio
  • TransformationMode aTransform

scaledToHeight (Number aHeight, TransformationMode aTransform) : Pixmap


List of parameters:
  • Number aHeight
  • TransformationMode aTransform

scaledToWidth (Number aWidth, TransformationMode aTransform) : Pixmap


List of parameters:
  • Number aWidth
  • TransformationMode aTransform

toByteArray (String aFormat, Number aQuality) : ByteArray


List of parameters:
  • String aFormat
  • Number aQuality



Plot1DAxesProps

An object to set and get the 1D plot axes properties

Inherited by: ChromPlotAxesProps, MassPlotAxesProps

Table of contents

  1. Properties

Properties

Name Type Comments
color String
font Font
horizontal PlotAxisProps
lineWidth Number
margin Number
vertical PlotAxisProps

color : String

The axes color

Valid values: {"#RRGGBB", "Color Keywords"}

font : Font

The axes font

horizontal : PlotAxisProps

The horizontal axis properties

lineWidth : Number

The axes pen width

margin : Number

The margin between the axis and the plot data curves rectangle in mm

vertical : PlotAxisProps

The vertical axis properties




Plot1DLineProps

An object to set and get the 1D plot line properties

Table of contents

  1. Properties

Properties

Name Type Comments
color String
style String
width Number

color : String

The line color

Valid values: {"#RRGGBB", "Color Keywords"}

style : String

The line style

Valid values: {"circles", "crosses", "line"}

width : Number

The line width from 0.1 to 10.0




PlotAxisLabelProps

An object to set and get a plot axis label properties

Table of contents

  1. Properties

Properties

Name Type Comments
text String
visible Boolean

text : String

The axis label text

visible : Boolean

The axis label visibility (show: true; hide: false)




PlotAxisProps

An object to set and get a plot axis properties

Inherited by: MassPlotAxisProps

Table of contents

  1. Properties

Properties

Name Type Comments
decimals Number
label PlotAxisLabelProps
manualTics Boolean
minWidth Number
primaryTics Number
secondaryTics Number
visible Boolean

decimals : Number

The maximum number of decimals to show in the axis tick labels

The label axis properties

manualTics : Boolean

If true the primary tics will use the primaryTics as a hint to generate the tics. Otherwise the tics will be calculated automatically.

minWidth : Number

The vertical axis minimum width in mm. This property is only available for the vertical axis.

primaryTics : Number

An aproximate number of desired primary tics. Valid values are [1,100]

secondaryTics : Number

The number of desired secondary tics. Valid values are [0,10]

visible : Boolean

The axis visibility (show: true; hide: false)




PlotBackgroundProps

An object to set and get the plot background properties

Table of contents

  1. Properties

Properties

Name Type Comments
color String
opacity Number

color : String

The background color

Valid values: {"#RRGGBB", "Color Keywords"}

opacity : Number

The background opacity from 0 (transparent) to 100 (opaque)




PlotChromPeak2ndLineProps

An object to set and get the second text line properties at the plot peaks labels

Table of contents

  1. Properties

Properties

Name Type Comments
decimals Number
value String
visible Boolean

decimals : Number

The number of decimals shown in the text line

value : String

What to show in the second text line of the peak label: The peak intensity, the peak height, the peak area, the peak relative abundance or the scan

Valid values: {"abundance", "area", "height", "intensity", "precursor", "scan"}

visible : Boolean

The text line visibility (show: true; hide: false)




PlotChromPeaksProps

An object to set and get the plot peaks properties. NOTE: Some object properties only take effect either on chromatogram plots or mass spectrum plots.

Inherited by: PlotMassPeaksProps

Table of contents

  1. Properties

Properties

Name Type Comments
baseline Boolean
color String
customLabel Boolean
decimals Number
exclusionRegions Boolean
fill Boolean
font Font
secondline PlotChromPeak2ndLineProps
threshold Number
vertBounds Boolean
visible Boolean
wedges Boolean

baseline : Boolean

Shows (true)/Hides (false) the baseline correction in the chromatogram peaks

color : String

The peaks color

Valid values: {"#RRGGBB", "Color Keywords"}

customLabel : Boolean

Shows (true)/Hides (false) the custom label of a chromatographic peaks

decimals : Number

The number of decimals shown in the text representing numbers in the peaks labels

exclusionRegions : Boolean

Shows (true)/Hides (false) the excluded regions to detect chromatographic peaks

fill : Boolean

Shows (true)/Hides (false) the fill color of a chromatographic peak

font : Font

The peaks labels font

The properties of the secon line of text of the peaks labels

threshold : Number

A threshold value (from 0.0 to 1.0). Peaks with intensity below the threshold value multiplied by the max peak intensity will be hidden.

vertBounds : Boolean

Shows (true)/Hides (false) the vertical line from the baseline to the curve in the chromatogram peaks

visible : Boolean

The peaks visibility (show: true; hide: false)

wedges : Boolean

Shows (true)/Hides (false) the wedges in the chromatogram peaks




PlotGridProps

An object to set and get the plot grid properties

Table of contents

  1. Properties

Properties

Name Type Comments
color String
lineWidth Number
showBaseline Boolean
showFrame Boolean
showHorizontal Boolean
showOver Boolean
showVertical Boolean

color : String

The grid color

Valid values: {"#RRGGBB", "Color Keywords"}

lineWidth : Number

The grid pen width

showBaseline : Boolean

Shows(true)/hides(false) the line at vertical value zero (Only for spectrum type plots)

showFrame : Boolean

Shows(true)/hides(false) the plot data curves rectangle border

showHorizontal : Boolean

The horizontal grid lines visibility (show: true; hide: false)

showOver : Boolean

Show the grid lines either above (true) or below (false) the plot data curves

showVertical : Boolean

The vertical grid lines visibility (show: true; hide: false)




PlotMassPeaksProps

An object to set and get the plot peaks properties. NOTE: Some object properties only take effect either on chromatogram plots or mass spectrum plots.

Inherits PlotChromPeaksProps

Table of contents

  1. Properties

Properties

Name Type Comments
relativeMasses Boolean
relativeMassPivot Number

relativeMasses : Boolean

Shows (true)/Hides (false) the relative mass instead of absolute mass in the mass spectrum peak labels.

relativeMassPivot : Number

The reference pivot used to display the relative masses. If it's zero or less, then the highest peak will be used as the pivot.




PlotStackedAxisProps

An object to set and get a plot axis properties

Table of contents

  1. Properties

Properties

Name Type Comments
categoryLabels String
label PlotAxisLabelProps
minWidth Number
visible Boolean

categoryLabels : String

The type of labels shown as categories

Valid values: {"Categories", "Numbers"}

The label axis properties

minWidth : Number

The vertical axis minimum width in mm.

visible : Boolean

The axis visibility (show: true; hide: false)




PlotTitleProps

An object to set and get the plot title properties

Table of contents

  1. Properties

Properties

Name Type Comments
color String
decimals Number
font Font
format String
visible Boolean

color : String

The title color

Valid values: {"#RRGGBB", "Color Keywords"}

decimals : Number

The number of decimals shown in the text representing numbers in the title

font : Font

The title font

format : String

A string indicating how the title is built (TODO: more details on this)

visible : Boolean

The title visibility (show: true; hide: false)




Polygon

Polygon page item

Inherits PageItem

Table of contents

  1. Constructors
  2. Functions

Constructors

Polygon (Polygon aPolygonItem)

  • Polygon aPolygonItem

Functions

Name Output Parameters
toString String

toString () : String




Printer

Enumerations

Name Type Values
Orientation Landscape, Portrait
PaperSize A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, B0, B1, B10, B2, B3, B4, B5, B5, B6, B7, B8, B9, C5E, Comm10E, Custom, Executive, Folio, Ledger, Legal, Letter, Tabloid
PrinterMode HighResolution, PrinterResolution, ScreenResolution
Unit Cicero, DevicePixel, Didot, Inch, Millimeter, Pica, Point

Properties

Name Type Comments
orientation Orientation
paperSize PaperSize

orientation : Orientation

paperSize : PaperSize

Constructors

Printer (PrinterMode aMode = ScreenResolution)

  • PrinterMode aMode

Functions

Name Output Parameters
begin String aFileName = ' '
end
newPage
print Page aPage
print Document aDocument
print TextDocument aTextDocument

begin (String aFileName = ' ')

To be called before start printing


List of parameters:
  • String aFileName

    - Filename of the pdf file to be created. If empty the system default printer will be used

end ()

It has to be called to finish printing

newPage ()

print (Page aPage)


List of parameters:
  • Page aPage

print (Document aDocument)


List of parameters:
  • Document aDocument

print (TextDocument aTextDocument)


List of parameters:
  • TextDocument aTextDocument



Process

The Process object is used to start external programs

Properties

Name Type Comments
allErrorOutput String
allStdOutput String
canReadLine Boolean
errorCode Number
exitCode Number
exitStatus Number
processId Number [read-only]
readLine String
state Number
workingDirectory String

allErrorOutput : String

Returns all the data written to the standard error output by the process.

allStdOutput : String

Returns all the data written to the standard output by the process.

canReadLine : Boolean

Returns true if a complete line of data can be read from the current read channel of the process; otherwise returns false.

See also: QProcess::canReadLine, readLine

errorCode : Number

Returns the type of error that occurred last.

Valid values: {Process.Crashed, Process.FailedToStart, Process.ReadError, Process.Timedout, Process.UnknownError, Process.WriteError}

exitCode : Number

Returns the exit code of the last process that finished.

exitStatus : Number

Returns the exit status of the last process that finished. 0 for normal exit, 1 for crash exit.

Valid values: {Process.CrashExit, Process.NormalExit}

processId : Number [read-only]

The native process identifier for the running process, if available. If no process is currently running, 0 is returned.

readLine : String

Returns a line from the current read channel of the process.

See also: canReadLine, QIODevice::readLine

state : Number

Returns the current state of the process.

Valid values: {Process.NotRunning, Process.Running, Process.Starting}

workingDirectory : String

If Process has been assigned a working directory, this function returns the working directory that the Process will enter before the program has started. Otherwise, (i.e., no directory has been assigned,) an empty string is returned, and Process will use the application's current working directory instead.

Constructors

Process ()

Functions

Name Output Parameters
execute Number String aProgram, Array aArguments
start String aProgram, Array aArguments
startDetached Boolean String aProgram, Array aArguments
systemEnvironment Array
systemEnvironmentObject Object
waitForFinished Boolean Number aMSec
waitForStarted Boolean Number aMSec

Process.execute (String aProgram, Array aArguments) : Number

Starts the program aProgram with the arguments aArguments in a new process, waits for it to finish, and then returns the exit code of the process


List of parameters:
  • String aProgram
  • Array aArguments

start (String aProgram, Array aArguments)

Starts aProgram as a new process with the arguments aProgramArg1, aProgramArg2...


List of parameters:
  • String aProgram
  • Array aArguments

Process.startDetached (String aProgram, Array aArguments) : Boolean

Starts the program aProgram with the arguments aArguments in a new process, and detaches from it. Returns true on success


List of parameters:
  • String aProgram
  • Array aArguments

Process.systemEnvironment () : Array

Returns the environment of the calling process as an array of strings of 'key=value' pairs.

Process.systemEnvironmentObject () : Object

Returns the environment of the application in the form of a javascript object.

waitForFinished (Number aMSec) : Boolean

Blocks until the process has finished or until aMSec milliseconds have passed. By default aMSec is 30000.


List of parameters:
  • Number aMSec

waitForStarted (Number aMSec) : Boolean

Blocks until the process has started or until aMSec milliseconds have passed. By default aMSec is 30000.


List of parameters:
  • Number aMSec



ProgressDialog

Provides a progress dialog

Table of contents

  1. Properties

Properties

Name Type Comments
labelText String
maximum Number
minimum Number
minimumDuration Number
showCancelButton Boolean
value Number
wasCanceled Boolean

labelText : String

Text shown in the dialog

maximum : Number

Maximum value of the progress

minimum : Number

Minimum value of the progress

minimumDuration : Number

Minimum time in ms that must pass before the dialog appears.

showCancelButton : Boolean

Shows a cancel button in the dialog. By default is true

value : Number

Current value

wasCanceled : Boolean

True if the user press the cancel button




PushButton

Provides a command button

Properties

Name Type Comments
checkable Boolean
checked Boolean
text String

checkable : Boolean

True if the button is checkable

checked : Boolean

True if the button is checked

text : String

Text in the button

Signals

Functions

Name Output Parameters
setIcon String aFilePath
setIcon String aFilePath, Number aWidth, Number aHeight
setIconColoredSquare String aColor
setIconPixmap Pixmap aPixmap
toggle

setIcon (String aFilePath)

Changes the PushButton icon


List of parameters:
  • String aFilePath

				
dialog.widgets.theButton.setIcon("ricares:lightbringer.png");
			
			

setIcon (String aFilePath, Number aWidth, Number aHeight)

Changes the PushButton icon and its dimensions


List of parameters:
  • String aFilePath
  • Number aWidth
  • Number aHeight

				
dialog.widgets.theButton.setIcon("ricares:lightbringer.png", 64, 64);
			
			

setIconColoredSquare (String aColor)

Sets the PushButton icon as a colored square


List of parameters:
  • String aColor

    - String representing a color with format "#RRGGBB"

setIconPixmap (Pixmap aPixmap)

Changes the PushButton icon from a Pixmap


List of parameters:
  • Pixmap aPixmap

toggle ()

Changes the checked state




Rectangle

Rectangle page item

Inherits PageItem

Table of contents

  1. Constructors
  2. Functions

Constructors

Rectangle (Rectangle aRectItem)

  • Rectangle aRectItem

Functions

Name Output Parameters
toString String

toString () : String




RMPlugin

The Reaction Monitoring plugin object

Table of contents




ScatterSeries

Wrapper to Qt Charts QScatterSeries

Enumerations

Name Type Values
MarkerShape Number MarkerShapeCircle, MarkerShapeRectangle

Properties

Name Type Comments
borderColor String
borderWidth Number
color String
markerShape MarkerShape
markerSize Number
name String

borderColor : String

borderWidth : Number

color : String

markerShape : MarkerShape

markerSize : Number

name : String

Constructors

ScatterSeries ()

Functions

Name Output Parameters
append aValueX, aValueY
attachAxis aAxis

append ( aValueX, aValueY)


List of parameters:
  • aValueX
  • aValueY

See also: QXYSeries::append

attachAxis ( aAxis)


List of parameters:

See also: QAbstractSeries::attachAxis




serialization

Object to open/save, import/export files

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
fileHistory Boolean

fileHistory : Boolean

Controls file/document history filling in the GUI

Functions

Name Output Parameters
importFile Boolean String|Array aPath, String aFileFilter, Document aDocument = undefined
metaData Object String aFileName, String aFormat = undefined, Array aExtraData
open Boolean String aFileName, String aFilter = undefined
open Array aFileNameList
openFilters String
save String aFileName, String aFilter
saveFilters String

importFile (String|Array aPath, String aFileFilter, Document aDocument = undefined) : Boolean

Imports aPath with the selected aFileFilter into aDocument if specified, to the active one if not. It returns error when trying to open a mnova file


List of parameters:
  • String|Array aPath
  • String aFileFilter
  • Document aDocument

metaData (String aFileName, String aFormat = undefined, Array aExtraData) : Object

Returns the metadata associated to the file


List of parameters:
  • String aFileName

    - File Name

  • String aFormat

    - If set then the function tries to open the file with the converter specified. Otherwise it autodetects the converter.

  • Array aExtraData

    - List of extra tags to be returned. The tags use the nomenclature in the Parameters Table.

open (String aFileName, String aFilter = undefined) : Boolean

Opens a file


List of parameters:
  • String aFileName

    - File Name

  • String aFilter

    - If set then the function tries to open the file with the converter specified. Otherwise it autodetects the converter.

open (Array aFileNameList)

Opens an array of files


List of parameters:
  • Array aFileNameList

openFilters () : String

Returns a string with all possible serialization open filters, separated by ";;". Depends on the active document, if any.

save (String aFileName, String aFilter)

Saves a document


List of parameters:
  • String aFileName
  • String aFilter

    - For a list of valid values, use saveFilters()

saveFilters () : String

Returns a string with all possible serialization save filters, separated by ";;". Depends on the active document, if any.




Settings

Save/Read settings

Table of contents

  1. Constructors
  2. Functions

Constructors

Settings (String aPrefix = "Scripts/Settings/")

  • String aPrefix

Settings (String aOrganization, String aApplicationName)

  • String aOrganization
  • String aApplicationName

Functions

Name Output Parameters
allKeys Array
beginGroup aGroupName
childGroups Array
childKeys Array
endGroup aGroupName
getObject Object String aKey, Object aDefaultValue
group String
remove String aKey
save String aFilename, String aGroup =
setObject String aKey, Object aObject, Object aDefaultObject
setValue String aKey, Variant aValue
toString String
value Variant String aKey, Variant aDefaultValue

allKeys () : Array

Returns all the keys in the group

beginGroup ( aGroupName)


List of parameters:
  • aGroupName

childGroups () : Array

Returns current group child groups

childKeys () : Array

Returns current group keys

endGroup ( aGroupName)


List of parameters:
  • aGroupName

getObject (String aKey, Object aDefaultValue) : Object

Returns the hierarchy of values under the settings key aKey as an object


List of parameters:
  • String aKey

    - Name of the key

  • Object aDefaultValue

    - Default value if the key doesn't exist or can't be read


				
function readObject() {
	var testObj = settings.getObject("DummyKey", {});

	print(JSON.stringify(testObj));
}
			
			

group () : String

Returns current group

remove (String aKey)

Remove a settings key


List of parameters:
  • String aKey

    - Name of the key

save (String aFilename, String aGroup = )


List of parameters:
  • String aFilename
  • String aGroup

setObject (String aKey, Object aObject, Object aDefaultObject)

Set the hierarchy of values defined in aObject under the settings key aKey


List of parameters:
  • String aKey

    - Name of the key

  • Object aObject

    - Object to be saved

  • Object aDefaultObject

    - If specified only the keys in this object that contains different values in aObject will be saved to the registry


				
function writeObject() {
	var testObj = {
		"Key1": "Value1",
		"Key2": "Value2"
	};

	settings.setObject("DummyKey", testObj);
}

function writeObjectDefault() {
	var testObj = {
		"Key1": "Value11",
		"Key2": "Value12",
		"NoNeededKey": "DummyValue"
	}, defaultObj = {
		"Key1": "Old1",
		"Key2": "Old2"
	};

	settings.setObject("DummyKey", testObj, defaultObj);
}
			
			

setValue (String aKey, Variant aValue)


List of parameters:
  • String aKey

    - A Settings key

  • Variant aValue

    - Value to be saved

toString () : String

value (String aKey, Variant aDefaultValue) : Variant

Read the value of a settings key


List of parameters:
  • String aKey

    - Name of the key

  • Variant aDefaultValue

    - Default value if the key doesn't exist or can't be read




SpectrumRegion

Defines a region in the spectrum

Table of contents

  1. Constructors
  2. Functions

Constructors

SpectrumRegion (SpectrumRegion aSpectrumRegion)

SpectrumRegion (Number aFrom, Number aTo)

  • Number aFrom
  • Number aTo

SpectrumRegion (Number aFrom1, Number aTo1, Number aFrom2, Number aTo2)

  • Number aFrom1
  • Number aTo1
  • Number aFrom2
  • Number aTo2

Functions

Name Output Parameters
dim Number
from Number Number aDim
to Number Number aDim
toString String

dim () : Number

Dimension of the region

from (Number aDim) : Number

Returns the from of the region in the aDim dimension


List of parameters:
  • Number aDim

to (Number aDim) : Number

Returns the to of the region in the aDim dimension


List of parameters:
  • Number aDim

toString () : String




SpinBox

Provides spinbox widget to select integer values

Properties

Name Type Comments
enabled Boolean
maximum Number
minimum Number
prefix String
singleStep Number
suffix String
value Number

enabled : Boolean

True if the widget is enabled

maximum : Number

Maximum allowed value

minimum : Number

Minimum allowed value

prefix : String

Prefix added to the number

singleStep : Number

Step value

suffix : String

Suffix added to the number

value : Number

Current value in the spin box

Signals

Constructors

SpinBox ()




SqlDatabase

Wrapper to QSqlDatabase

Properties

Name Type Comments
connectionName String [read-only]
databaseName String
driverName String [read-only]
hostName String
password String
port String
userName String

connectionName : String [read-only]

databaseName : String

driverName : String [read-only]

hostName : String

password : String

port : String

userName : String

Constructors

SqlDatabase (String aConnectionName, String aDriverName)

  • String aConnectionName

    - The connection name of the new database object. Should be unique.

  • String aDriverName

    - See SQL Database Drivers for a description of the valid values. Use SqlDatabase.drivers( ) for the actual list of installed drivers.

    Valid values: {"QDB2", "QIBASE", "QMYSQL", "QOCI", "QODBC", "QPSQL", "QSQLITE", "QSQLITE2"}

Functions

Name Output Parameters
close
connectionNames Array
contains Bool String aConnectionName
drivers Array
exec SqlQuery String aQuery
isDriverAvailable Bool String aDriver
isOpen Bool
isValid Bool
lastError SqlError
open Bool
removeDatabase String aConnectionName
tables Array

close ()

Closes the database connection, freeing any resources acquired, and invalidating any existing SqlQuery objects that are used with the database.

SqlDatabase.connectionNames () : Array

Returns an Array of String with a list containing the names of all connections.

SqlDatabase.contains (String aConnectionName) : Bool

Returns true if the list of database connections contains aConnectionName; otherwise returns false.


List of parameters:
  • String aConnectionName

SqlDatabase.drivers () : Array

Returns an Array of String with an updated list of valid drivers.

exec (String aQuery) : SqlQuery

Executes a SQL statement on the database and returns a SqlQuery object.


List of parameters:
  • String aQuery

SqlDatabase.isDriverAvailable (String aDriver) : Bool

Returns true if a driver called aDriver is available; otherwise returns false.


List of parameters:
  • String aDriver

isOpen () : Bool

Returns true if the database connection is currently open; otherwise returns false.

isValid () : Bool

Returns true if the SqlDatabase has a valid driver.

lastError () : SqlError

Returns an object with error information about the last error (if any) that occurred on the database.

open () : Bool

Opens the database connection using the current connection values. Returns true on success; otherwise returns false.


				
var sqliteDatabase = new SqlDatabase("myDatabaseId", "QSQLITE");
sqliteDatabase.databaseName = "C:/dev/test-database.db";

if (!sqliteDatabase.isValid()) {
	MessageBox.critical("Driver is not valid");
	return;
}

print(sqliteDatabase.open());
			
			

SqlDatabase.removeDatabase (String aConnectionName)

Removes the database connection aConnectionName from the list of database connections.


List of parameters:
  • String aConnectionName

tables () : Array

Returns an Array of String with a list of the database's tables.




SqlError

Wrapper to QSqlError

Table of contents

  1. Constructors
  2. Functions

Constructors

SqlError ()

Functions

Name Output Parameters
databaseText String
driverText String
isValid Bool
nativeErrorCode String
text String
type Number

databaseText () : String

Returns the text of the error as reported by the database. This may contain database-specific descriptions; it may be empty.

driverText () : String

Returns the text of the error as reported by the driver. This may contain database-specific descriptions; it may be empty.

isValid () : Bool

Returns true if an error is set, otherwise false.

nativeErrorCode () : String

Returns the database-specific error code, or an empty string if it cannot be determined.

text () : String

Returns databaseText() and driverText() concatenated into a single string.

type () : Number

Returns the error type, or -1 if the type cannot be determined. Different error type codes are documented here: QSqlError::ErrorType




SqlQuery

Wrapper to QSqlQuery

Table of contents

  1. Constructors
  2. Functions

Constructors

SqlQuery (String aConnectionName)

  • String aConnectionName

    - The connection name of the database we want to query. The corresponding SqlDatabase object should have been previously created and opened.

Functions

Name Output Parameters
bindValue String aPlaceholder, Variant aVariant
boundValue Variant String aPlaceholder
clear
exec Bool String aSqlQuery
exec Bool
first Bool
isActive Bool
isSelect Bool
last Bool
lastError SqlError
next Bool
prepare Bool String aQuery
seek Bool Number aIndex, Bool aRelative
setForwardOnly Bool aForward
size Number
value String Number aIndex

bindValue (String aPlaceholder, Variant aVariant)

Set the placeholder aPlaceholder to be bound to value aVariant in the prepared statement.


List of parameters:
  • String aPlaceholder
  • Variant aVariant

boundValue (String aPlaceholder) : Variant

Returns the value for the placeholder aPlaceholder.


List of parameters:
  • String aPlaceholder

clear ()

Clears the result set and releases any resources held by the query. You should rarely if ever need to call this function.

exec (String aSqlQuery) : Bool

Executes the SQL query aSqlQuery. Returns true if the query executed successfully; otherwise returns false.


List of parameters:
  • String aSqlQuery

exec () : Bool

Executes a previously prepared SQL query. Returns true if the query executed successfully; otherwise returns false.

first () : Bool

Retrieves the first record in the result, if available, and positions the query on the retrieved record.

isActive () : Bool

Returns true if the query is active. An active QSqlQuery is one that has been exec()'d successfully but not yet finished with.

isSelect () : Bool

Returns true if the current query is a SELECT statement; otherwise returns false.

last () : Bool

Retrieves the last record in the result, if available, and positions the query on the retrieved record.

lastError () : SqlError

Returns an object with error information about the last error (if any) that occurred with this query.

next () : Bool

Retrieves the next record in the result, if available, and positions the query on the retrieved record.

prepare (String aQuery) : Bool

Prepares the SQL query aQuery for execution. Returns true if the query is prepared successfully; otherwise returns false.


List of parameters:
  • String aQuery

seek (Number aIndex, Bool aRelative) : Bool

Retrieves the record at position aIndex, if available, and positions the query on the retrieved record. The behavior of aRelative and the output can be found in QSqlQuery::seek.


List of parameters:
  • Number aIndex
  • Bool aRelative

setForwardOnly (Bool aForward)

If aForward is true, only next() and seek() with positive values are allowed for navigating the results.


List of parameters:
  • Bool aForward

size () : Number

Returns the size of the result (number of rows returned), or -1 if the size cannot be determined or if the database does not support reporting information about query sizes.

value (Number aIndex) : String

Returns the value of field aIndex in the current record.


List of parameters:
  • Number aIndex

				
var sqliteQuerySelect = new SqlQuery(databaseID);

sqliteQuerySelect.prepare("SELECT Species FROM Animalia");
sqliteQuerySelect.exec();

while (sqliteQuerySelect.next()) {
	print(sqliteQuerySelect.value(0));
}
			
			



StackedClass

An Object to represent the class's properties of a stacked item.

Properties

Name Type Comments
color String
mode String
name String

color : String

Base color used to create the colors in the stacked spectra.

mode : String

Mode to create the colors in the stacked spectra.

Valid values: {"Gradient", "Hue", "Single"}

name : String

Class name.

Constructors

StackedClass ()

The constructor accepts as input the class properties, i.e. name, mode, and color. If there is no input, the class is created with its default values: "name" is an empty String, "mode" is set to "Hue", and "color" is set to Red.


				
var stackedClass = new StackedClass(); // class with default values
var stackedClass = new StackedClass("myclass", "Gradient", "#00ffff");
			
			



StackedClasses

An Object map with the classes of a stacked spectra. The key is the class name, and the value, the class properties, of type StackedClass.

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
classes Object [read-only]

classes : Object [read-only]

Functions

Name Output Parameters
getClass Object String aName
getClass Object Integer aIndex
setClass String aName, Object aProperties
setClass Integer aIndex, Object aProperties

getClass (String aName) : Object

Returns the class properties of the class aName (if exists).


List of parameters:
  • String aName

getClass (Integer aIndex) : Object

Returns the class properties of the stacked item at aIndex.


List of parameters:
  • Integer aIndex

setClass (String aName, Object aProperties)

Update the class aName with the new aProperties.


List of parameters:
  • String aName

    - Class name

  • Object aProperties

    - Class properties of type StackedClass.


				
var spec = new NMRSpectrum(nmr.activeSpectrum());
var stackedClasses = spec.getProperty("stacked.classes");
var newClass = new StackedClass("C", "Gradient", "#00ffff");

stackedClasses.setClass("A", newClass);
			
			

setClass (Integer aIndex, Object aProperties)

Update the class of the stacked item at aIndex with the new aProperties.


List of parameters:
  • Integer aIndex

    - Stacked item index

  • Object aProperties

    - Class properties of type StackedClass.


				
var spec = new NMRSpectrum(nmr.activeSpectrum());
var stackedClasses = spec.getProperty("stacked.classes");
var newClass = new StackedClass("C", "Gradient", "#00ffff");

stackedClasses.setClass(0, newClass);
			
			



StandardItemModel

Wrapper to Qt QStandardItemModel

Table of contents

  1. Properties

Properties

Name Type Comments
header String
items Object

header : String

items : Object




SvgRenderer

Wrapper to QSvgRenderer

Table of contents

  1. Constructors
  2. Functions

Constructors

SvgRenderer (ByteArray aByteArray)

  • ByteArray aByteArray

    - A ByteArray that includes the SVG XML.

Functions

Name Output Parameters
renderToPixmap Pixmap Number aWidth, Number aHeight

renderToPixmap (Number aWidth, Number aHeight) : Pixmap

Returns a Pixmap object with the desired size and the SVG rendered.


List of parameters:
  • Number aWidth
  • Number aHeight



SysInfo

System information ojbect

Enumerations

Name Type Values
MacVer Number Leopard, Lion, MountainLion, SnowLeopard, Tiger
WinVer Number W2000, W2003, W7, W8, WVISTA, WXP

Properties

Name Type Comments
hostID String
isLinux Boolean
isMac Boolean
isWin Boolean
machineHostName String
macVersion Number [read-only]
userName String
windowsVersion Number [read-only]

hostID : String

Returns the machine host ID.

isLinux : Boolean

Returns true if it's a Linux system

isMac : Boolean

Returns true if it's a Mac OS system

isWin : Boolean

Returns true if it's a Windows system

machineHostName : String

Returns the machine host name.

macVersion : Number [read-only]

Returns one of the Mac version enumeration values

NOTE: The Mac version enumeration and this property are only defined in Mac machines.

userName : String

Returns the username of the machine and current session.

windowsVersion : Number [read-only]

Returns one of the Windows version enumeration values

NOTE: The Windows version enumeration and this property are only defined in Windows machines.




TableWidget

Wrapper to Qt QTableWidget

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
currentColumn Number
currentItem Object
currentRow Number
horzHeader Object
horzHeaderItems Object
items Object
vertHeader Object
vertHeaderItems Object

currentColumn : Number

currentItem : Object

currentRow : Number

horzHeader : Object

horzHeaderItems : Object

items : Object

vertHeader : Object

vertHeaderItems : Object

Functions

Name Output Parameters
item Object Number aRow, Number aColumn
select Array items
selectedItems Array
setCurrentCell Number aRow, Number aColumn
setCurrentItem Object aItem
setItem Number aRow, Number aColumn, Object aItem
sortByColumnWithOrder Number aColumn, Number aOrder

item (Number aRow, Number aColumn) : Object


List of parameters:
  • Number aRow
  • Number aColumn

select (Array items)


List of parameters:
  • Array items

selectedItems () : Array

setCurrentCell (Number aRow, Number aColumn)


List of parameters:
  • Number aRow
  • Number aColumn

setCurrentItem (Object aItem)


List of parameters:
  • Object aItem

setItem (Number aRow, Number aColumn, Object aItem)


List of parameters:
  • Number aRow
  • Number aColumn
  • Object aItem

sortByColumnWithOrder (Number aColumn, Number aOrder)


List of parameters:
  • Number aColumn
  • Number aOrder



TabWidget

Shows Items in a stack of tabbed widgets.

Table of contents

  1. Properties
  2. Functions

Properties

Name Type Comments
currentIndex Number

currentIndex : Number

Returns the index of the current tab.

Functions

Name Output Parameters
addTab Widget aWidget, String aTitle
removeTab Number aIndex
setTabText Number aIndex, String aTitle
tabText String Number aIndex

addTab (Widget aWidget, String aTitle)

Adds a tab with the given aWidget and aTitle to the tab widget.


List of parameters:
  • Widget aWidget
  • String aTitle

removeTab (Number aIndex)

Removes the tab at position aIndex from the stack of widgets.


List of parameters:
  • Number aIndex

setTabText (Number aIndex, String aTitle)

Defines a new aTitle for the page at position aIndex's tab.


List of parameters:
  • Number aIndex
  • String aTitle

tabText (Number aIndex) : String

Returns the text of the tab in the position aIndex.


List of parameters:
  • Number aIndex



Text

Text page item

Inherits PageItem

Properties

Name Type Comments
autoSized Boolean
htmlText String
plainText String

autoSized : Boolean

If it's true the item size is adjusted to the text contents

htmlText : String

plainText : String

Constructors

Text (Text aTextItem)

Functions

Name Output Parameters
toString String

toString () : String




TextDocument

Table of contents

  1. Constructors
  2. Functions

Constructors

TextDocument ()

TextDocument (Widget aTextEditWidget)

  • Widget aTextEditWidget

Functions

Name Output Parameters
addResourcePixmap String aUrl, String | Pixmap aPixmap
addResourceStyleSheet String aUrl, String aCSS
setHtml String aHtml
setPlainText String aText
toHtml String
toPlainText String
write String aFilePath

addResourcePixmap (String aUrl, String | Pixmap aPixmap)


List of parameters:
  • String aUrl
  • String | Pixmap aPixmap

addResourceStyleSheet (String aUrl, String aCSS)


List of parameters:
  • String aUrl
  • String aCSS

setHtml (String aHtml)


List of parameters:
  • String aHtml

setPlainText (String aText)


List of parameters:
  • String aText

toHtml () : String

toPlainText () : String

write (String aFilePath)


List of parameters:
  • String aFilePath



TextOdfDocument

An ODF document consists in a zip package containing:

See also: OASIS Open Document Format Standard

Constructors

TextOdfDocument ()

Functions

Name Output Parameters
addHeading String aTitle, int aLevel, String aStyle
addHorizontalLine String aLeftPos, String aRightPos, String aStyle
addHtml String aHtml
addPageBreak
addPlainText String aPlainText
addResource String aResourceName
addStyles String aStyles
addStylesFromFile String aFileName
insertTableOfContents String aTitle, int aMaxLevel, String aStylePrefix, Bool aUseCurrentPos = false
setStyle String aStyleName
startDocument String aFileName
write

addHeading (String aTitle, int aLevel, String aStyle)

Adds a heading to the document with title aTitle, and an outline level aLevel. The style (i.e. text properties) used by the heading should be defined in "styles.xml" beforehand with the name aStyle.


List of parameters:
  • String aTitle
  • int aLevel
  • String aStyle

addHorizontalLine (String aLeftPos, String aRightPos, String aStyle)

Adds a horizontal straight line to the document from the position aLeftPos to the position aRightPos, indicating the units which can be inches (in) or centimetre (cm). The line style (graphics properties, i.e. stroke type, width and color) argument is optional: if missing, the line will be created using the default graphic properties, if not, the aStyle property should be defined in "styles.xml" beforehand.


List of parameters:
  • String aLeftPos
  • String aRightPos
  • String aStyle

addHtml (String aHtml)

Adds aHtml content to the document. Allowed HTML elements are: paragraphs, lists, tables, and figures.


List of parameters:
  • String aHtml

See also: Supported HTML subset

addPageBreak ()

Adds a page break to the document.

addPlainText (String aPlainText)

Adds aPlainText content to the document.


List of parameters:
  • String aPlainText

addResource (String aResourceName)

Adds a new resource aResourceName (i.e. image) to be available for using inside the document. External resources are stored in the "media" folder inside the zip package.


List of parameters:
  • String aResourceName

addStyles (String aStyles)

Creates the "styles.xml" file with the styles defined in aStyles (described as HTML).


List of parameters:
  • String aStyles

addStylesFromFile (String aFileName)

Creates the "styles.xml" file with the styles defined in the file "aFileName" (described as HTML).


List of parameters:
  • String aFileName

insertTableOfContents (String aTitle, int aMaxLevel, String aStylePrefix, Bool aUseCurrentPos = false)

Adds the table of contents (ToC) to the document, at the beginning if aUseCurrentPos = false, or at the current position if aUseCurrentPos = true. The allowed items of the ToC are the headings of the document up to aMaxLevel, the maximum outline level. The styles used by the ToC should be defined in the "styles.xml" beforehand, using the aStylePrefix.


List of parameters:
  • String aTitle
  • int aMaxLevel
  • String aStylePrefix
  • Bool aUseCurrentPos

setStyle (String aStyleName)

Sets the page style to aStyleName to be used from this point in the document. The style aStyleName has to be defined in "styles.xml" beforehand. It may describe several page properties: width, orientation, header, footer, etc.


List of parameters:
  • String aStyleName

startDocument (String aFileName)

Starts a new ODF document with name aFileName. It is mandatory to start the document before being able to edit it. Valid name extensions are: "odf", "odt", and "opendocumentformat".


List of parameters:
  • String aFileName

write ()

Writes the ODF document. This is the "final" operation - once the document is written, it is not possible to add more content to it.

Example:




TextStream

The TextStream object provides an interface for reading and writing text to a file

Properties

Name Type Comments
codec String
notation Number
pos Number
precision Number

codec : String

Gets/sets codec assigned to the stream.

Valid values: {"Apple Roman", "Big5", "Big5-HKSCS", "CP949", "EUC-JP", "EUC-KR", "GB18030-0", "IBM 850", "IBM 866", "IBM 874", "Iscii-Bng", "Iscii-Dev", "Iscii-Gjr", "Iscii-Knd", "Iscii-Mlm", "Iscii-Ori", "Iscii-Pnj", "Iscii-Tlg", "Iscii-Tml", "ISO 2022-JP", "ISO 8859-1", "ISO 8859-10", "ISO 8859-13", "ISO 8859-14", "ISO 8859-15", "ISO 8859-16", "ISO 8859-2", "ISO 8859-3", "ISO 8859-4", "ISO 8859-5", "ISO 8859-6", "ISO 8859-7", "ISO 8859-8", "ISO 8859-9", "JIS X 0201", "JIS X 0208", "KOI8-R", "KOI8-U", "MuleLao-1", "ROMAN8", "Shift-JIS", "TIS-620", "TSCII", "UTF-16", "UTF-16BE", "UTF-16LE", "UTF-32", "UTF-32BE", "UTF-32LE", "UTF-8", "Windows-1250", "Windows-1251", "Windows-1252", "Windows-1253", "Windows-1254", "Windows-1255", "Windows-1256", "Windows-1257", "Windows-1258", "WINSAMI2"}

See also: IANA character set name or alias

notation : Number

Gets/sets the real number notation

Valid values: {TextStream.nFixed, TextStream.nScientific, TextStream.nSmart}

pos : Number

Gets/sets the file position corresponding to the current position of the stream. Returns -1 if an error occurs. ATTENTION! This operation can be expensive, so you may want to avoid calling this function in a tight loop.

precision : Number

Gets/sets the current real number precision, or the number of fraction digits TextStream will write when generating real numbers

Constructors

TextStream (File aIODevice)

Constructs a TextStream that operates on a File, a NetworkReply or a ByteArray

TextStream (TextStream aStream)

Constructs a TextStream that is a copy of aStream

Functions

Name Output Parameters
atEnd Boolean
flush
read String Number aMaxLen
readAll String
readLine String
readNumber Number
readString String
skip Number aSize
skipWhiteSpace
toString String
write Boolean Variant aParam1, ..., Variant aParamN
writeln Boolean Variant aParam1, ..., Variant aParamN

atEnd () : Boolean

Returns true if there is no more data to be read from the TextStream

flush ()

Flushes any buffered data waiting to be written to the disk.

read (Number aMaxLen) : String

Reads at most aMaxLen characters from the stream, and returns the data read as a String


List of parameters:
  • Number aMaxLen

readAll () : String

Reads the entire content of the stream, and returns it as a String

readLine () : String

Reads one line of text from the stream and returns it

readNumber () : Number

Reads a number from the stream and returns it

readString () : String

Reads a word from the stream and returns it. Words are separated by whitespace

skip (Number aSize)

Skips the aSize bytes in the stream


List of parameters:
  • Number aSize

skipWhiteSpace ()

Reads and discards whitespace from the stream until either a non-space character is detected, or until atEnd() returns true

toString () : String

write (Variant aParam1, ..., Variant aParamN) : Boolean

Writes the arguments to the stream


List of parameters:
  • Variant aParam1
  • ...
  • Variant aParamN

writeln (Variant aParam1, ..., Variant aParamN) : Boolean

Writes the arguments to the stream, appends a line break, and calls flush() on the stream.


List of parameters:
  • Variant aParam1
  • ...
  • Variant aParamN



Timer

Object that provides repetitive and single-shot timers.

Properties

Name Type Comments
singleShot Boolean

singleShot : Boolean

This property holds whether the timer is a single-shot timer.

Signals

Constructors

Timer ()

Functions

Name Output Parameters
start Number aTimeMS

start (Number aTimeMS)

Starts or restarts the timer with a timeout interval of aTimeMS milliseconds.


List of parameters:
  • Number aTimeMS



ToolBar

Wrapper to QToolBar.

Properties

Name Type Comments
toggleViewAction Action [read-only]

toggleViewAction : Action [read-only]

The action to toggle the toolbar's visibility

Constructors

ToolBar ([Widget aParent])

  • Widget aParent [optional]

    - The parent widget or any if not defined

Functions

Name Output Parameters
addAction Action String aActionName, String aIconPath
addAction Action aAction
addSeparator
addWidget Action Widget aWidget
insertAction Action aBeforeAction, Action aAction
insertWidget Action Action aBeforeAction, Widget aWidget
removeAction Action aAction

addAction (String aActionName, String aIconPath) : Action

Adds an action to the toolbar, and returns the Action object needed for connecting the signals.


List of parameters:
  • String aActionName

    - Text that will appear in the action.

  • String aIconPath

    - Path to the icon that will appear in the action.

addAction (Action aAction)

Adds an action object to the toolbar.


List of parameters:
  • Action aAction

    - An action object

addSeparator ()

Adds a separator between the previous and next actions.

addWidget (Widget aWidget) : Action

Adds a widget to the toolbar and returns an object action associated to that widget.


List of parameters:
  • Widget aWidget

    - A widget object to be inserted, like a ToolButton

insertAction (Action aBeforeAction, Action aAction)

Inserts an action in the toolbar just before the action specified


List of parameters:
  • Action aBeforeAction

    - The action object before it will be inserted the new action

  • Action aAction

    - The action object to be inserted

insertWidget (Action aBeforeAction, Widget aWidget) : Action

Inserts a widget to the toolbar before an actio and return the object action associated with that widget.


List of parameters:
  • Action aBeforeAction

    - The action object before it will be inserted the new action

  • Widget aWidget

    - A widget object to be inserted, like a ToolButton

removeAction (Action aAction)

Removes an action from the toolbar


List of parameters:
  • Action aAction

    - The action object to be removed




ToolButton

Provides a command button. As opposed to a PushButton, a ToolButton usually doesn't show a text label, but shows an icon instead.

Enumerations

Name Type Values
PopupMode Number DelayedPopup, InstantPopup, MenuButtonPopup

Properties

Name Type Comments
autoRaise Boolean
checkable Boolean
checked Boolean
popupMode PopupMode
text String
toolButtonStyle Number

autoRaise : Boolean

This property holds whether auto-raising is enabled or not.

checkable : Boolean

True if the button is checkable

checked : Boolean

True if the button is checked

popupMode : PopupMode

The number corresponding to the popup mode. See enum QToolButton::ToolButtonPopupMode for more information.


				
dialog.widgets.tbMenu.popupMode = ToolButton.InstantPopup;
			
			

text : String

Text in the button

toolButtonStyle : Number

This property holds whether the tool button displays an icon only, text only, or text beside/below the icon. See Qt::ToolButtonStyle for the available values.

Signals

Functions

Name Output Parameters
setDefaultAction Action aAction
setIcon String aFilePath
setIcon String aFilePath, Number aWidth, Number aHeight
setIconColoredSquare String aColor
setIconPixmap Pixmap aPixmap
setMenu Menu aMenu
toggle

setDefaultAction (Action aAction)

Sets the action of the ToolButton, including the text and/or icon if any.


List of parameters:
  • Action aAction

				
var mnovaAction = mainWindow.getAction("nmrPeakPickingOptions");
dialog.widgets.tbMnovaAction.setDefaultAction(mnovaAction);
			
			

setIcon (String aFilePath)

Changes the ToolButton icon


List of parameters:
  • String aFilePath

				
dialog.widgets.theButton.setIcon("ricares:lightbringer.png");
			
			

setIcon (String aFilePath, Number aWidth, Number aHeight)

Changes the ToolButton icon and its dimensions


List of parameters:
  • String aFilePath
  • Number aWidth
  • Number aHeight

				
dialog.widgets.theButton.setIcon("ricares:lightbringer.png", 64, 64);
			
			

setIconColoredSquare (String aColor)

Sets the ToolButton icon as a colored square


List of parameters:
  • String aColor

    - String representing a color with format "#RRGGBB"

setIconPixmap (Pixmap aPixmap)

Changes the ToolButton icon from a Pixmap


List of parameters:
  • Pixmap aPixmap

setMenu (Menu aMenu)

Adds a Menu to the ToolButton


List of parameters:
  • Menu aMenu

				
var menu = new Menu();
menu.addAction("Left arrow icon", "ricares:arrow-left.png");
dialog.widgets.tbMenu.setMenu(menu);
			
			

toggle ()

Changes the checked state




TreeView

Wrapper to Qt QTreeView

Table of contents

  1. Functions
  2. Example

Functions

Name Output Parameters
setModel StandardItemModel aModel

setModel (StandardItemModel aModel)


List of parameters:
  • StandardItemModel aModel

Example:




UnZip

Enumerations

Name Type Values
UnZipFlags Number Default, SkipPaths

Constructors

UnZip (String aPath)

  • String aPath

Functions

Name Output Parameters
close
contents Array Boolean aOnlyFiles
extract Number String aOutPath, UnZipFlags aUnZipFlags = Default
getFirstFile String
open Number

close ()

contents (Boolean aOnlyFiles) : Array


List of parameters:
  • Boolean aOnlyFiles

extract (String aOutPath, UnZipFlags aUnZipFlags = Default) : Number


List of parameters:
  • String aOutPath
  • UnZipFlags aUnZipFlags

getFirstFile () : String

open () : Number




ValueAxis

Wrapper to QValueAxis

Properties

Name Type Comments
labelFormat String
max Number
min Number
minorTickCount Number
tickCount Number
titleText String

labelFormat : String

The label format of the axis. The format string supports the following conversion specifiers, length modifiers, and flags provided by printf() in the standard C++ library: d, i, o, x, X, f, F, e, E, g, G, c.

max : Number

The maximum value on the axis.

min : Number

The minimum value on the axis.

minorTickCount : Number

The number of minor tick marks on the axis. This indicates how many grid lines are drawn between major ticks on the chart. Labels are not drawn for minor ticks. The default value is 0.

tickCount : Number

The number of tick marks on the axis. This indicates how many grid lines are drawn on the chart. The default value is 5, and the number cannot be less than 2.

titleText : String

The title of the axis. Empty by default.

Constructors

ValueAxis ()

Functions

Name Output Parameters
applyNiceNumbers

applyNiceNumbers ()

Modifies the current range and number of tick marks on the axis to look nice. The algorithm considers numbers that can be expressed as a form of 1*10^n, 2* 10^n, or 5*10^n to be nice numbers. These numbers are used for setting spacing for the tick marks.

Example:




VerificationResult

The verification result for a molecule

Enumerations

Name Type Values
Tests Number C13ASSIGN, C13GC, C13NN, C13PBM, C13SQ, COSYASSIGN, COSYGC, COSYSQ, H1APS, H1ASSIGN, H1GC, H1MC, H1NN, H1PBM, H1PBM_L, H1SQ, HMBCASSIGN, HMBCGC, HMBCSQ, HSQC_XCOR, HSQCASSIGN, HSQCGC, HSQCSQ, ML, MS_MolMatch, MS_MolMatch_Purity, MS_MolMatch_Screening, MS_MolMatch_Similarity, NOESYASSIGN, NOESYGC, NOESYSQ, TOCSYASSIGN, TOCSYGC, TOCSYSQ

Properties

Name Type Comments
beginDate Date [read-only]
id Number [read-only]
messages Array [read-only]
priorConfidence Number [read-only]
quality Number [read-only]
result Number [read-only] [deprecated]
score Number [read-only]
significance Number [read-only]
testsResults Array [read-only]

beginDate : Date [read-only]

The date and time where the verification was done.

id : Number [read-only]

An integer value identifying the kind of verification task performed

messages : Array [read-only]

An array of objects containing the messages and warnings for this result.

See also: ASVWarning

priorConfidence : Number [read-only]

A real value [0,1] that specifies the prior confidence used in order to calculate the result. 0.5 means no prior knowledge and 1 means total certainty that the verification is good.

quality : Number [read-only]

It's the score value combined with the significance.

result : Number [read-only] [deprecated]

Use either score or quality instead.

score : Number [read-only]

A real value in the range [-1, 1] where -1 means that the molecule doesn't match, 0 means unknown and 1 means the molecule matches.

significance : Number [read-only]

A real value greater than 0. The higher the best significance for the score value.

testsResults : Array [read-only]

An array containing the individual verification tests results

See also: VerificationTestResult

Functions

Name Output Parameters
testResult VerificationTestResult Number aTestType

testResult (Number aTestType) : VerificationTestResult

Gets a test result given a test type


List of parameters:
  • Number aTestType

    - An integer value from Tests enumeration

See also: VerificationTestResult




VerificationTestResult

The result for a single verification test for a molecule

Table of contents

  1. Properties

Properties

Name Type Comments
extData Object [read-only]
id Number [read-only]
name String [read-only]
quality Number [read-only]
result Number [read-only] [deprecated]
score Number [read-only]
significance Number [read-only]

extData : Object [read-only]

An object containing extended information for the test or undefined if no extended information is provided.

id : Number [read-only]

An integer value identifying the test

name : String [read-only]

The test name

quality : Number [read-only]

It's the score value combined with the significance

result : Number [read-only] [deprecated]

Use either score or quality instead.

score : Number [read-only]

A real value in the range [-1, 1]

significance : Number [read-only]

A real value greater than 0. The higher the best significance for the result value.




Wizard

Provides a Wizard widget

Table of contents

  1. Constructors
  2. Functions

Constructors

Wizard ()

Functions

Name Output Parameters
setButtonText Number aButton, String aText

setButtonText (Number aButton, String aText)

Set the text for one of the custom buttons


List of parameters:
  • Number aButton

    - Button identifier

    Valid values: {CustomButton1, CustomButton2, CustomButton3}

  • String aText

    - Button text




XmlQuery

Table of contents

  1. Constructors
  2. Functions

Constructors

XmlQuery (Number aQueryLanguage)

Constructs a XmlQuery object that will be used to run Xqueries or XSL-T stylesheets, depending on the value of aQueryLanguage.

  • Number aQueryLanguage

    - This enum is used to describe the language to be used. aQueryLanguage = XmlQuery.XQuery10 by default.

    Valid values: {QXmlQuery.XSLT20, XmlQuery.XQuery10}

Functions

Name Output Parameters
bindVariable String aName, Variant aValue
evaluate String
setFocus String aDocContents
setQuery String aQuery

bindVariable (String aName, Variant aValue)

Binds the variable aName to the value aValue.


List of parameters:
  • String aName
  • Variant aValue

evaluate () : String

Executes the query defined in setQuery() and returns the matches as a string.

setFocus (String aDocContents)

Set the document where the query will search.


List of parameters:
  • String aDocContents

setQuery (String aQuery)

Set the query.


List of parameters:
  • String aQuery



XmlToJson

Class containing functions to convert from a XML file to a JSON object.

Table of contents

  1. Functions
  2. Example

Functions

Name Output Parameters
parseXmlFile Object String aFilePath

XmlToJson.parseXmlFile (String aFilePath) : Object

Parses a XML file and returns a JSON object with all its information. Returns an empty object if the XML file is corrupt.


List of parameters:
  • String aFilePath

    - The absolute path to the XML file.

Example:




Zip

Enumerations

Name Type Values
ZipFlags Number Default, SkipPaths

Constructors

Zip (String aPath, String aBasepath = '')

  • String aPath
  • String aBasepath

Functions

Name Output Parameters
addFile Number String aFilePath, String aZipPath = '', ZipFlags aZipFlags = Default
close
contents Array Boolean aOnlyFiles
open Number Boolean aAppend

addFile (String aFilePath, String aZipPath = '', ZipFlags aZipFlags = Default) : Number


List of parameters:
  • String aFilePath
  • String aZipPath
  • ZipFlags aZipFlags

close ()

contents (Boolean aOnlyFiles) : Array


List of parameters:
  • Boolean aOnlyFiles

open (Boolean aAppend) : Number


List of parameters:
  • Boolean aAppend