DataPoint

 The DataPoint class describes a data point. Its members are:
 - key: the X-axis coordinate
 - val: the Y-axis coordinate

  DataPoint()

    Constructor of a DataPoint object

    Ex:
    var dp = new DataPoint;
    dp.key; // --&gt; NaN
    dp.val; // --&gt; NaN
    dp.isValid(); // --&gt; false


  DataPoint(xyLine)

    Constructor of a DataPoint object initialized using the xy-formatted line.

    xyLine: &lt;String&gt; holding the key,val pair in the format key&lt;sep&gt;val, with
    &lt;sep&gt; being any character not a cipher nor a decimal point.

    Ex:
    var dp = new DataPoint("123.321,456.654");
    dp.key; // --&gt; 123.321
    dp.val; // --&gt; 456.654
    dp.isValid(); // --&gt; true


  DataPoint(dataPoint)

    Constructor of a DataPoint object initialized with another DataPoint object

    dataPoint: &lt;DataPoint&gt; object used to initialize this object.

    Ex:
    var dp1 = new DataPoint(dp);


  DataPoint(key, val)

    Constructor of a DataPoint object initialized with the numerical
    parameters.

    key: key (X-value)
    val: value (Y-value)

    Ex:
    var dp = DataPoint(123.321, 456.654);


  &lt;DataPoint&gt;.key

    Return the key &lt;Number&gt; property.

    Ex:
    var dp = new DataPoint(123.321, 456.654);
    var mz = dp.key;
    mz // --&gt; 123.321


  &lt;DataPoint&gt;.val

    Return the val &lt;Number&gt; property.

    Ex:
    var dp = new DataPoint(123.321, 456.654);
    var i = dp.val;
    i // --&gt; 456.654


  DataPoint.initialize(other)

    Initialize this DataPoint object with a &lt;DataPoint&gt; object

    other: &lt;DataPoint&gt; object

    Ex:
    var newDp = new DataPoint(123.321,456.654);
    var otherDp = new DataPoint();
    otherDp.initialize(newDp);
    otherDp.key; // --&gt; 123.321
    otherDp.val; // --&gt; 456.654
    otherDp.isValid(); // --&gt; true


  DataPoint.initialize(key, val)

    Initialize this DataPoint object with two &lt;Number&gt; entities

    key: &lt;Number&gt; holding the key of this DataPoint
    val: &lt;Number&gt; holding the value of this DataPoint

    Ex:
    var dp = new DataPoint();
    dp.initialize(123.321,456.654);
    dp.key; // --&gt; 123.321
    dp.val; // --&gt; 456.654
    dp.isValid(); // --&gt; true


  DataPoint.isValid()

    Return if this &lt;DataPoint&gt; object is valid.

    Ex:
    var dp = new DataPoint();
    dp.initialize(123.321,456.654);
    dp.key; // --&gt; 123.321
    dp.val; // --&gt; 456.654
    dp.isValid(); // --&gt; true


SavGolParams

 This class handles the parameters of a Savitzy-Golay filter.

 A SavGolParams object contains the following member data:
 - nl: &lt;Number&gt; of points on the left of the filtered point;
 - nR: &lt;Number of points on the right of the filtered point;
 - m: &lt;Number&gt; (order) of the polynomial to use in the regression analysis
   leading to the Savitzky-Golay coefficients (typically between 2 and 6);
 - lD: &lt;Number&gt; specifying the order of the derivative to extract from the
   Savitzky-Golay smoothing algorithm (for regular smoothing, use 0)
 - convolveWithNr &lt;Boolean&gt;  Set to false for best results
 

  SavGolParams()

    Constructor of a SavGolParams object

    Ex:

    var sgp1 = new SavGolParams();
    sgp1.nL; // --&gt; default 15
    sgp1.nR; // --&gt; default 15
    sgp1.m; // --&gt; default 4
    sgp1.lD; // --&gt; default 0
    sgp1.convolveWithNr; // --&gt; default false


  SavGolParams(savGolParams)

    Constructor of a SavGolParams object using a &lt;SavGolParams&gt; object as
    template

    Ex:

    var sgp1 = new SavGolParams();
    sgp1.nL = 10;
    sgp1.nR = 10;
    sgp1.m; // --&gt; 4
    sgp1.lD; // --&gt; 0
    sgp1.convolveWithNr; // --&gt; false

    var sgp2 = new SavGolParams(sgp1);

    sgp2.nL; // --&gt; 10
    sgp2.nR; // --&gt; 10
    sgp2.m; // --&gt; 4
    sgp2.lD; // --&gt; 0
    sgp2.convolveWithNr; // --&gt; false


  SavGolParams(savGolFilter)

    Constructor of a SavGolParams object using a &lt;SavGolFilter&gt; object as
    template

    Ex:

    var sgf1 = new SavGolFilter();
    sgf1.nL = 10;
    sgf1.nR = 10;
    sgf1.m; // --&gt; 4
    sgf1.lD; // --&gt; 0
    sgf1.convolveWithNr; // --&gt; false

    var sgp2 = new SavGolParams(sgf1);

    sgp2.nL; // --&gt; 10
    sgp2.nR; // --&gt; 10
    sgp2.m; // --&gt; 4
    sgp2.lD; // --&gt; 0
    sgp2.convolveWithNr; // --&gt; false


  SavGolParams(nL, nR, m, lD, convolveWithNr)

    Constructor of a SavGolParams object using the various configurations
    &lt;Number&gt; and &lt;Boolean&gt; parameters.

    Ex:

    var sgf1 = new SavGolParams(10, 10, 6, 0, true);
    sgf1.nL; // --&gt; 10
    sgf1.nR; // --&gt; 10;
    sgf1.m; // --&gt; 6
    sgf1.lD; // --&gt; 0
    sgf1.convolveWithNr; // --&gt; true


SavGolFilter

 This class handles the parameterization of the Savitzky-Golay
 filter. This filter is an efficient way to remove noise from noisy mass
 spectra and can be automatically applied after any mass spectrum
 combination processing.

 A SavGolFilter object contains the following member data as members of a
 &lt;SavGolParams&gt; object (see documentation for SavGolParams):
 - nl: &lt;Number&gt; of points on the left of the filtered point;
 - nR: &lt;Number of points on the right of the filtered point;
 - m:	 &lt;Number&gt; (order) of the polynomial to use in the regression analysis
   leading to the Savitzky-Golay coefficients (typically between 2 and 6);
 - lD: &lt;Number&gt; specifying the order of the derivative to extract from the
   Savitzky-Golay smoothing algorithm (for regular smoothing, use 0)
 - convolveWithNr &lt;Boolean&gt;  Set to false for best results
 

  SavGolFilter()

    Constructor of a SavGolFilter object

    Ex:
    var sgf1 = new SavGolFilter();
    sgf1.nL; // --&gt; 15
    sgf1.nR; // --&gt; 15
    sgf1.m; // --&gt; 4
    sgf1.lD; // --&gt; 0
    sgf1.convolveWithNr; // --&gt; false


  SavGolFilter(savGolParams)

    Constructor of a SavGolFilter object initialized using a &lt;SavGolParams&gt;
    object

    Ex:

    var sgp1 = new SavGolParams();

    sgp1.nL = 10; --&gt; 10
    sgp1.nR = 10; --&gt; 10
    sgp1.lD = 0; --&gt; 0
    sgp1.m = 5; --&gt; 5

    var sgf1 = new SavGolFilter(sgp1);
    sgf1.asText(); --&gt; output is:

    Savitzy-Golay filter parameters:
    nL: 10 ; nR: 10 ; m: 5 ; lD: 0 ; convolveWithNr : false
    savGolParams: &lt;SavGolParams&gt; object to be used to initialize this object's SavGolParams


  SavGolFilter(nL, nR, m, lD, convolveWithNr)

    Constructor of a SavGolFilter object initialized using parameters that
    initialize the SavGolParams member object

    nL: number of data points on the left of the point being filtered (default * 15)

    nR: number of data points on the right of the point being filtered (default * 15)

    m: order of the polynomial to use in the regression analysis
    leading to the Savitzky-Golay coefficients (typicall [2-6], default 4)

    lD: order of the derivative to extract from the Savitzky-Golay
    smoothing algorithm (for regular smoothing, use 0, the default);

    Ex:

    var sgf1 = new SavGolFilter(10, 10, 6, 0, true);

    sgf1.asText(); --&gt; output is:

    Savitzy-Golay filter parameters:
    nL: 10 ; nR: 10 ; m: 6 ; lD: 0 ; convolveWithNr : true

    convolveWithNr: set to false for best results (default false)


  SavGolFilter(savGolFilter)

    Constructor of a SavGolFilter object

    Ex:

    var sgf1 = new SavGolFilter();
    sgf1.asText(); --&gt; output is:

    Savitzy-Golay filter parameters:
    nL: 15 ; nR: 15 ; m: 4 ; lD: 0 ; convolveWithNr : false*

    sgf1.nL = 10;
    sgf1.nR = 10;
    sgf1.m= 6;

    var sgf2 = new SavGolFilter(sgf1);
    sgf2.asText(); --&gt; output is:

    Savitzy-Golay filter parameters:
    nL: 10 ; nR: 10 ; m: 6 ; lD: 0 ; convolveWithNr : false

    savGolFilter: &lt;SavGolFilter&gt; object to be used to initialize this object


  SavGolFilter.initialize(other)

    Initialize this SavGolFilter object with another
    &lt;SavGolFilter&gt; object

    other: &lt;SavGolFilter&gt; object used to initialize this object


  SavGolFilter.initialize(nL, nR, m, lD, convolveWithNr)

    Initialize this SavGolFilter object with parameters to configure the
    SavGolParams member object

    nL: number of data points on the left of the point being filtered
    nR: number of data points on the right of the point being filtered
    m: order of the polynomial to use in the regression analysis
    leading to the Savitzky-Golay coefficients (typicall [2-6])
    lD: order of the derivative to extract from the Savitzky-Golay
    smoothing algorithm (for regular smoothing, use 0);
    convolveWithNr: set to false for best results


  SavGolFilter.asText()

    Return a &lt;String&gt; object containing a textual representation of all the
    member data of this SavGolFilter object.


MzIntegrationParams

 The MzIntegrationParams class provides an interface to all the
 parameters that are required to configure all the integrations of mass
 spectral data that combine into a MassSpectrum object.

 When combining multiple mass spectra into a single one, the process might
 involve the creation of bins according to specific parameters measured on
 the whole set of the spectra to be combined into the combination spectrum.
 These parameters are configured using a MzIntegrationParams object. Its
 members are:

 -binningType: &lt;Number&gt; type of the binning. The type of binning specifies
  if binning is arbitrary or data-based (refer to msXpS::BinningType for
  details). It might also specify that no binning is required.

 -binSize: &lt;Number&gt; size of the bins. A typical bin size would be 0.005 for
  a high resolution mass spectrometer with unit m/z.

 -binSizeType: &lt;Number&gt; type of the bin size. The bin size type specifies if
  the binSize value is to be considered a m/z value or a atomic mass unit
  value or a resolution value or a part-per-million value (refer to
  msXpS::MassToleranceType for details)

 -binSizeTypeString: &lt;String&gt; type of the bin size. This member datum hold a
  textual representation of the binSizeType member datum, like "PPM" or
  "RES" or "AMU" or "MZ".

 -applyMzShift: &lt;Boolean&gt; value that tells if the m/z shift correction
  should be applied.

 -removeZeroValDataPoints: &lt;Boolean&gt; that tells if the 0-val m/z data points
  should be removed from the combination spectrum once all the source mass
  spectra have been effectively combined into the combination spectrum.

 - applySavGolFilter: &lt;Boolean&gt; that tells if a Savitzky-Golay filtering is
   to be applied to the combination spectrum after all the source mass
   spectra have been combined to the combination spectrum.

 - savGolParams: &lt;SavGolParams&gt; object holding the configuration of a
   Savitzky-Golay filtering process.

  MzIntegrationParams()

    Construct a MzIntegrationParams instance with default values.

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.binningType; // --&gt; 0
    mzip1.binningTypeString; // --&gt; NONE


  MzIntegrationParams(binningType, binSize, binSizeType,
    applyMzShift, removeZeroValDataPoints)

    Construct a MzIntegrationParams instance using specified values.

    binningType: &lt;Number&gt; type of the binning (refer to msXpS::BinningType for details)
    binSize: &lt;Number&gt; size of the bins
    binSizeType: &lt;Number&gt; type of the bin size (refer to msXpS::MassToleranceType for details)
    applyMzShift: &lt;Boolean&gt; tells if the m/z shift correction should be applied
    removeZeroValDataPoints: &lt;Boolean&gt; tells if the 0-val m/z data points should be removed

    Ex:

    var mzip1 = new MzIntegrationParams(1, 0.0055, 2, false, true);

    mzip1.binningTypeString; // --&gt; DATA_BASED
    mzip1.binSize; // --&gt; 0.0055
    mzip1.binSizeType; // --&gt; 2
    mzip1.binSizeTypeString; // --&gt; MZ
    mzip1.applyMzShift; // --&gt; false
    mzip1.removeZeroValDataPoints; // --&gt; true


  MzIntegrationParams(mzIntegrationParams)

    Construct a MzIntegrationParams object using a &lt;MzIntegrationParams&gt;
    template object.

    Ex:

    var mzip1 = new MzIntegrationParams(1, 0.0055, 2, false, true);

    mzip1.binningTypeString; // --&gt; DATA_BASED
    mzip1.binSize; // --&gt; 0.0055
    mzip1.binSizeType; // --&gt; 2
    mzip1.binSizeTypeString; // --&gt; MZ
    mzip1.applyMzShift; // --&gt; false
    mzip1.removeZeroValDataPoints; // --&gt; true

    var mzip2 = new MzIntegrationParams(mzip1);

    mzip2.binningTypeString; // --&gt; DATA_BASED
    mzip2.binSize; // --&gt; 0.0055
    mzip2.binSizeType; // --&gt; 2
    mzip2.binSizeTypeString; // --&gt; MZ
    mzip2.applyMzShift; // --&gt; false
    mzip2.removeZeroValDataPoints; // --&gt; true

    mzIntegrationParams: &lt;MzIntegrationParams&gt; to be used to initialize this object


  MzIntegrationParams(savGolParams)

    Construct a MzIntegrationParams object using a SavGolParams template
    object.

    Ex:

    var sgp1 = new SavGolParams(10, 10, 6, 0, true);
    var mzip1 = new MzIntegrationParams(sgp1);

    mzip1.savGolParams.nL; // --&gt; 10
    mzip1.savGolParams.nR; // --&gt; 10
    mzip1.savGolParams.m; // --&gt; 6
    mzip1.savGolParams.lD; // --&gt; 0

    savGolParams: &lt;SavGolParams&gt; object to be used to initialize this object's SavGolParams


  &lt;MzintegrationParams&gt;.binningType

    Return the binningType property of the object as a &lt;Number&gt;

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.binningType; // --&gt; 0

    Return the binning type property as a &lt;Number&gt;.


  &lt;MzintegrationParams&gt;.binningTypeString

    Return the binningType property of the object as a &lt;String&gt;

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.binningTypeString; // --&gt; NONE

    Return the binning type property as a &lt;String&gt;.


  &lt;MzIntegrationParams&gt;.binSize

    Return the bin size property of the object.

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.binSize; // --&gt; NaN (uninitialized value)

    Return the bin size &lt;Number&gt; property (size of the bins in the mass
    spectrum).


  &lt;MzintegrationParams&gt;.binSizeType

    Return the binSizeType property of the object as a &lt;Number&gt;

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.binSizeType; // --&gt; 0

    Return the bin size type property as a &lt;Number&gt;.


  &lt;MzintegrationParams&gt;.binSizeTypeString

    Return the binSizeType property of the object as a &lt;String&gt;

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.binSizeTypeString; // --&gt; NONE

    Return the bin size type property as a &lt;String&gt;.


  &lt;MzIntegrationParams&gt;.applyMzShift

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.applyMzShift; // --&gt; false
    mzip1.applyMzShift = true;
    mzip1.applyMzShift; // --&gt; true

    Return the &lt;Boolean&gt; value telling if the m/z shift should be
    applied.


  &lt;MzIntegrationParams&gt;.removeZeroValDataPoints

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.applyMzShift; // --&gt; false

    Return the &lt;Boolean&gt; value telling if the &lt;DataPoint&gt; objects having
    m/z keys of a 0-intensity value should be removed from the
    &lt;MassSpectrum&gt; object.


  &lt;MzIntegrationParams&gt;.applySavGolFilter

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.applySavGolFilter // --&gt; false

    Return the &lt;Boolean&gt; value telling if the Savitzky-Golay filter
    should be applied to the &lt;MassSpectrum&gt; object.


  &lt;MzIntegrationParams&gt;.savGolParams

    Ex:

    var mzip1 = new MzIntegrationParams();

    var sgp1 = mzip1.savGolParams;

    sgp1.nL; // --&gt; 15
    sgp1.nR; // --&gt; 15
    sgp1.m; // --&gt; 4
    sgp1.lD; // --&gt; 0
    sgp1.convolveWithNr;	 // --&gt; false

    Return the &lt;SavGolParams&gt; object from this &lt;MzIntegrationParams&gt;
    object.


  MzIntegrationParams.binSize = &lt;Number&gt;

    Set the bin size.

    Ex:

    var mzip1 = new MzIntegrationParams();
    mzip1.binSize; // --&gt; NaN (uninitialized)
    mzip1.binSize = 0.0055;
    mzip1.binSize; // --&gt; 0.0055


  MzIntegrationParams.binSizeType = &lt;Number&gt;

    Set the bin size type as a &lt;Number&gt;

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.binSizeType; // --&gt; 0
    mzip1.binSizeTypeString; // --&gt; NONE
    mzip1.binSizeType=1;
    mzip1.binSizeType; // --&gt; 1
    mzip1.binSizeTypeString; // --&gt; PPM


  MzIntegrationParams.binSizeTypeString = &lt;String&gt;

    Set the bin size type as a &lt;String&gt;

    Ex:

    var mzip1 = new MzIntegrationParams();
    mzip1.binSizeTypeString; // --&gt; NONE
    mzip1.binSizeTypeString = "RES";
    mzip1.binSizeTypeString; // --&gt; RES
    mzip1.binSizeType; // --&gt; 4


  MzIntegrationParams.applyMzShift = &lt;Boolean&gt;

    Tell if the m/z shift between spectra must be applied

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.applyMzShift; // --&gt; false
    mzip1.applyMzShift = true;
    mzip1.applyMzShift; // --&gt; true


  MzIntegrationParams.removeZeroValDataPoints = &lt;Boolean&gt;

    Tell if the DataPoint objects having a value of 0 need to be removed
    from the spectrum.

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.applyMzShift; // --&gt; false
    mzip1.applyMzShift = true;
    mzip1.applyMzShift; // --&gt; true


  MzIntegrationParams.removeZeroValDataPoints = &lt;Boolean&gt;

    Tell if the Savitzky-Golay filter needs to be applied to the
    combination spectrum.

    Ex:

    var mzip1 = new MzIntegrationParams();

    mzip1.applySavGolFilter; // --&gt; false
    mzip1.applySavGolFilter = true;
    mzip1.applySavGolFilter; // --&gt; true;


  MzIntegrationParams.savGolParams = &lt;SavGolParams&gt;

    Initialize the member &lt;SavGolParams&gt; object using the parameter as
    template.

    Ex:

    var sgp1 = new SavGolParams(10, 10, 6, 0, true);
    var mzip1 = new MzIntegrationParams();

    mzip1.savGolParams.nL; // --&gt; 15
    mzip1.savGolParams.nR; // --&gt; 15
    mzip1.savGolParams = sgp1;
    mzip1.savGolParams.nL; // --&gt; 10
    mzip1.savGolParams.nR; // --&gt; 10


  MzIntegrationParams.initialize(other)

    Initialize this MzIntegrationParams object with a &lt;SavGolParams&gt; object

    Ex:

    var sgp1 = new SavGolParams(10, 10, 6, 0, true);
    var mzip1 = new MzIntegrationParams();

    mzip1.savGolParams.nL; // --&gt; 15
    mzip1.savGolParams.nR; // --&gt; 15
    mzip1.savGolParams.m; // --&gt; 4
    mzip1.savGolParams.lD; // --&gt; 0

    mzip1.initialize(sgp1);

    mzip1.savGolParams.nL; // --&gt; 10
    mzip1.savGolParams.nR; // --&gt; 10
    mzip1.savGolParams.m; // --&gt; 6
    mzip1.savGolParams.lD; // --&gt; 0

    other: &lt;SavGolParams&gt; object


  MzIntegrationParams.initialize(other)

    Initialize this MzIntegrationParams object with a
    &lt;MzIntegrationParams&gt; object

    Ex:

    var sgp1 = new SavGolParams(10, 10, 6, 0, true);
    var mzip1 = new MzIntegrationParams(sgp1);
    var mzip2 = new MzIntegrationParams(mzip1);

    mzip2.savGolParams.nL; // --&gt; 10
    mzip2.savGolParams.nR; // --&gt; 10
    mzip2.savGolParams.m; // --&gt; 6
    mzip2.savGolParams.lD; // --&gt; 0

    other: &lt;MzIntegrationParams&gt; object


  MzIntegrationParams.initialize(nL, nR, m, lD, convolveWithNr)

    Initialize this MzIntegrationParams object with the individual &lt;SavGolParams&gt; parameters

    nL: number of data points on the left of the point being filtered

    nR: number of data points on the right of the point being filtered

    m: order of the polynomial to use in the regression analysis
    leading to the Savitzky-Golay coefficients (typicall [2-6])

    lD: order of the derivative to extract from the Savitzky-Golay
    smoothing algorithm (for regular smoothing, use 0);

    convolveWithNr: set to false for best results

    Ex:

    var mzip1 = new MzIntegrationParams();
    mzip1.initialize(10, 10, 6, 0, false);

    mzip1.savGolParams.nL; // --&gt; 10
    mzip1.savGolParams.nR; // --&gt; 10
    mzip1.savGolParams.m; // --&gt; 6
    mzip1.savGolParams.lD; // --&gt; 0


  MzIntegrationParams.asText()

    Return a &lt;String&gt; object containing a textual representation of all the
    member data of this MzIntegrationParams object.


  MzIntegrationParams.asText()

    Return a textual representation of this &lt;MzIntegrationParams&gt; object.

    Ex:

    var mzip1 = new MzIntegrationParams();
    mzip1.binningType = 2;
    mzip1.binningTypeString; // --&gt; ARBITRARY
    mzip1.binSize = 0.0055;
    mzip1.binSizeTypeString = "MZ";
    mzip1.applyMzShift = true;
    mzip1.applySavGolFilter= true;
    mzip1.asText(); // returns this:

    m/z integration parameters:
    Binning type: ARBITRARY
    Bin nominal size: 0.005500
    Bin size type: MZ
    Apply m/z shift: true
    Remove 0-val data points: false
    Savitzky-Golay parameters
    nL = 15 ; nR = 15 ; m = 4 ; lD = 0 ; convolveWithNr = false 


Trace

 The Trace class is fundamentally an &lt;Array&gt; of DataPoint
 objects.

  Trace()

    Constructor of a Trace object

    Ex:
    var t = new Trace;
    t.length; // --&gt; 0


  Trace(title)

    Constructor of a Trace object

    title: &lt;String&gt; containing the title of the Trace object

    Ex:
    var t = new Trace("Trace title");
    t.title; // --&gt; Trace title


  Trace(other)

    Constructor of a Trace object

    other: &lt;Trace&gt; object to be used to initialize this object

    Ex:
    var t2 = new Trace();
    t2.initialize("123.3321 456.654\n147.741 258.852\n");
    t2[0].key; // --&gt; 123.3321
    t2[0].val; // --&gt; 456.654
    t2[1].key; // --&gt; 147.741
    t2[1].val; // --&gt; 258.852
    var t3 = new Trace(t2);
    t3[0].key; // --&gt; 123.3321
    t3[0].val; // --&gt; 456.654
    t3[1].key; // --&gt; 147.741
    t3[1].val; // --&gt; 258.852


  Trace[index]

    Return the &lt;DataPoint&gt; object at index.

    Ex:
    var t1 = new Trace();
    t1.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    t1.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    var dp0 = t1[0];
    dp0.key; // --&gt; 123.321
    dp0.val; // --&gt; 147.741

    t1[0].key; // --&gt; 123.321
    t1[0].val; // --&gt; 147.741


  Trace.initialize(xyFormatString)

    Initialize this Trace object with a &lt;String&gt; object representing the
    mass data in the xy text format:

    "&lt;key&gt;&lt;sep&gt;&lt;val&gt;\n&lt;key&gt;&lt;sep&gt;&lt;val&gt;\n...".

    xyFormatString: &lt;String&gt; object representing the &lt;DataPoint&gt; data points of
    the &lt;Trace&gt; in the format &lt;key&gt; &lt;value&gt;, with one such key-value pair per
    line. The separator between &lt;key&gt; and &lt;value&gt; might be anything
    non-numerical and not a dot (decimal separator).

    Ex:
    var t2 = new Trace();
    t2.initialize("123.3321 456.654\n147.741 258.852\n");
    t2[0].key; // --&gt; 123.3321
    t2[0].val; // --&gt; 456.654
    t2[1].key; // --&gt; 147.741
    t2[1].val; // --&gt; 258.852


  Trace.initialize(other)

    Initialize this Trace object with a &lt;Trace&gt; object

    other: &lt;Trace&gt; object

    Ex:
    var t1 = new Trace();
    t1.initialize("123.3321 456.654\n147.741 258.852\n");
    var t2 = new Trace();
    t2.initialize(t1);
    t2[0].key; // --&gt; 123.3321
    t2[0].val; // --&gt; 456.654
    t2[1].key; // --&gt; 147.741
    t2[1].val; // --&gt; 258.852


  Trace.initialize(keyArray, valArray)

    Initialize this Trace object with two numerical &lt;Array&gt; entities

    keyArray: the &lt;Array&gt; object containing all the keys of the &lt;Trace&gt;
    valArray: the &lt;Array&gt; object containing all the values of the &lt;Trace&gt;

    Ex:
    var t1 = new Trace;
    t1.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    t1.length; // --&gt; 3
    var dp0 = t1[0];
    dp0.key; // --&gt; 123.321
    dp0.val; // --&gt; 147.741


  Trace.initialize(keyArray, valArray, keyStart, keyEnd)

    Initialize this Trace object with two numerical &lt;Array&gt; entities and two
    &lt;Number&gt; entities

    keyArray: the &lt;Array&gt; object containing all the keys of the &lt;Trace&gt;
    valArray: the &lt;Array&gt; object containing all the values of the &lt;Trace&gt;
    keyStart: the &lt;Number&gt; value defining the beginning of the acceptable key range
    keyEnd: the &lt;Number&gt; value defining the end of the acceptable key range

    Ex:
    var t1 = new Trace;
    t1.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963], 124, 450);
    t1.length; // --&gt; 0

    var t1 = new Trace;
    t1.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963], 124, 457);
    t1.length; // --&gt; 1
    var dp0 = t1[0];
    dp0.key; // --&gt; 456.654
    dp0.val; // --&gt; 258.852


  Trace.keyArray()

    Return an &lt;Array&gt; of &lt;Number&gt; entities corresponding to all the keys of
    this Trace object

    Ex:
    var t7 = new Trace;
    t7.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    t7.keyArray(); // --&gt; 123.321,456.654,789.987


  Trace.valArray()

    Return an &lt;Array&gt; of &lt;Number&gt; entities corresponding to all the values of
    this Trace object

    Ex:
    var t7 = new Trace;
    t7.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    t7.valArray(); // --&gt; 147.741,258.852,369.963


  Trace.asText()

    Return the &lt;DataPoint&gt; data points of this Trace object as a &lt;String&gt;
    formatted according to this schema: &lt;key&gt; &lt;value&gt;, with one such pair per
    line

    Ex:
    var t7 = new Trace;
    t7.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    t7.asText(); // --&gt; output is:
    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000


  Trace.exportToFile(fileName)

    Export the &lt;DataPoint&gt; contents of this Trace object to a file. The format
    is according to this schema: &lt;key&gt; &lt;value&gt;, with one such pair per line

    fileName: &lt;String&gt; containing the path to the file in which to store the
    data

    Ex:
    var t7 = new Trace;
    t7.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    t7.exportToFile("/tmp/trial.txt"); // --&gt; file contains:
    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000


  Trace.valSum()

    Return the &lt;Number&gt; value corresponding to the sum of all the values of
    all the &lt;DataPoint&gt; object in this Trace object

    Ex:
    var t7 = new Trace;
    t7.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    t7.valSum(); // --&gt; 776.556


  Trace.combine(dataPoint)

    Combine into this Trace object the &lt;DataPoint&gt; object

    dataPoint: &lt;DataPoint&gt; object to combine into this MassSpectrum

    Ex:

    var t7 = new Trace;
    t7.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);

    t7.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    t7.combine(new DataPoint(200.002,1000)); // --&gt; 1, the number of added DataPoint objects

    t7.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    200.0020000000 1000.0000000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    t7.combine(new DataPoint(200.002,1000)); // --&gt; 0, no added DataPoint, only increment the value

    t7.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    200.0020000000 2000.0000000000 // value increment by the same original amount.
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000


  Trace.combine(trace)

    Combine into this Trace object the &lt;Trace&gt; object

    trace: &lt;Trace&gt; object to combine into this Trace

    Ex:
    var t1 = new Trace;
    t1.initialize([123.321,456.654,789.987],[147.741, 258.852,369.963]);
    var t2 = new Trace(t1);
    t2.length; // --&gt; 3
    t2.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    t2.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    t2.combine(t1); // --&gt; 3: 3 DataPoint objects were combined
    t2.asText(); // --&gt; output is:

    123.3210000000 295.4820000000
    456.6540000000 517.7040000000
    789.9870000000 739.9260000000


  Trace.combine(key, val)

    Combine into this Trace object a data point in the form of
    two &lt;Number&gt; entities, key and val

    Ex:
    var t1 = new Trace;
    t1.initialize([123.321,456.654,789.987],[147.741, 258.852,369.963]);

    t1.length; // --&gt; 3

    t1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    t1.combine(456.654, 1000);

    t1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 1258.8520000000
    789.9870000000 369.9630000000

    t1.combine(800, 2000);

    t1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 1258.8520000000
    789.9870000000 369.9630000000
    800.0000000000 2000.0000000000


  Trace.subtract(dataPoint)

    Subtract from this Trace object the &lt;DataPoint&gt; object

    dataPoint: &lt;DataPoint&gt; object to subtract from this MassSpectrum


  Trace.subtract(trace)

    Subtract from this Trace object the &lt;Trace&gt; object

    trace: &lt;Trace&gt; object to subtract from this Trace


  Trace.subtract(mz, i)

    Subtract from this Trace object a data point in the form of
    two &lt;Number&gt; values, key and value


MassSpectrum

 This class is the main class for handling mass spectra.
 MassSpectrum objects can be "combination spectra", that is, they correspond
 to the summation of a number of spectra. When a combination of mass spectra
 is performed, the combination spectrum is created empty at first and is
 then "configured" to receive the result of the sequential combination of
 all the mass spectra that are to be summated. There are a number of member
 data that are devoted to that combination configuration.

 A spectrum is actually a &lt;Trace&gt; that has a set of particular members:
 - rt: the retention time at which the spectrum was acquired
 - dt: the mobility drift time (for ion mobility spectra)
 - binCount: the number of bins set up in a combination spectrum
 - binSize: the size of the bins in the combination spectrum
 - binSizeType: the type of the bin size (enum AMU, PPM, RES)
 - binSizeTypestring: &lt;String&gt; representation of binSizeType
 - minMz: the minimum m/z value of the combination specrum
 - maxMz: the maximum m/z value of the combination specrum
 - applyMzShift: tells if the m/z shift should be applied
 - mzShift: m/z shift applied (or not) to each combined mass spectrum
 - removeZeroValDataPoints: tells if the data points in the spectrum that
   have a m/z with 0 intensity should be removed

  MassSpectrum()

    Constructor of a MassSpectrum object

    Ex:

    var ms1 = new MassSpectrum();


  MassSpectrum(title)

    Constructor of a MassSpectrum object

    title: &lt;String&gt; containing the title of the MassSpectrum object

    Ex:

    var ms1 = new MassSpectrum("spectrum title");
    ms1.title; // --&gt; spectrum title


  MassSpectrum(other)

    Constructor of a MassSpectrum object

    other: &lt;Trace&gt; object to be used to initialize this object

    Ex:

    var t1 = new Trace;
    t1.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    t1.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    var ms1 = new MassSpectrum(t1);
    ms1.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000


  MassSpectrum(other)

    Constructor of a MassSpectrum object

    other: &lt;MassSpectrum&gt; object to be used to initialize this object

    Ex:

    var ms1 = new MassSpectrum();
    ms1.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    ms1.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    ms1.rt = 1.2;
    ms1.dt = 0.00325698;

    var ms2 = new MassSpectrum(ms1);
    ms2.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    ms2.rt; // --&gt; 1.2
    ms2.dt; // --&gt; 0.00325698


  MassSpectrum.title

    Return the title &lt;String&gt; property.

    Ex:

    var ms1 = new MassSpectrum("spectrum title");
    ms1.title; // --&gt; spectrum title


  MassSpectrum.length

    Return the length &lt;Number&gt; property (number of &lt;DataPoint&gt; objects).

    Ex:

    var ms1 = new MassSpectrum();
    ms1.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    ms1.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    ms1.length; // --&gt; 3


  MassSpectrum.rt

    Return the rt &lt;Number&gt; property (retention time at which this mass
    spectrum was acquired.

    Ex:

    var ms1 = new MassSpectrum();
    ms1.rt = 1.2;

    ms1.rt; // --&gt; 1.2


  MassSpectrum.dt

    Return the dt &lt;Number&gt; property (ion mobility drift time at which
    this mass spectrum was acquired.

    Ex:

    var ms1 = new MassSpectrum();
    ms1.dt = 0.00325698;

    ms1.dt; // --&gt; 0.00325698


  MassSpectrum.binCount

    Return the bin count &lt;Number&gt; property (number of bins in this mass
    spectrum).


  MassSpectrum.binSize

    Return the bin size &lt;Number&gt; property (size of the bins in this mass
    spectrum).


  MassSpectrum.binSizeType

    Return the bin size type property as a &lt;Number&gt;.

    Ex:

    var ms1 = new MassSpectrum();
    ms1.binSizeType = 2;
    ms1.binSizeType; // --&gt; 2
    ms1.binSizeTypeString = "RES";
    ms1.binSizeType; // --&gt; 4


  MassSpectrum.binSizeTypeString

    Return the bin size type property as a &lt;String&gt;.

    Ex:

    var ms1 = new MassSpectrum();
    ms1.binSizeType = 2;
    ms1.binSizeTypeString; // -&gt; MZ;


  MassSpectrum.minMz

    Return the &lt;Number&gt; minimum m/z value to be used to craft the bins.


  MassSpectrum.maxMz

    Return the &lt;Number&gt; maximum m/z value to be used to craft the bins.


  MassSpectrum.applyMzShift

    Return the &lt;Boolean&gt; value telling if the m/z shift should be
    applied.


  MassSpectrum.mzShift

    Return the &lt;Number&gt; m/z shift value to apply when combining spectra.


  MassSpectrum.removeZeroValDataPoints

    Return the &lt;Boolean&gt; value telling if the &lt;DataPoint&gt; objects having
    m/z keys of a 0-intensity value should be removed from the spectrum.


  MassSpectrum[index]

    Return the &lt;DataPoint&gt; object at index.

    Ex:

    var ms1 = new MassSpectrum();
    ms1.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    ms1.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    var dp0 = ms1[0];
    dp0.key; // --&gt; 123.321
    dp0.val; // --&gt; 147.741

    ms1[0].key; // --&gt; 123.321
    ms1[0].val; // --&gt; 147.741


  MassSpectrum.initialize(other)

    Initialize this MassSpectrum object with a &lt;Trace&gt; object

    other: &lt;Trace&gt; object

    Ex:

    var t1 = new Trace;
    t1.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    t1.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    var ms1 = new MassSpectrum();
    ms1.initialize(t1);
    ms1.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000


  MassSpectrum.initialize(other)

    Initialize this MassSpectrum object with a &lt;MassSpectrum&gt; object

    other: &lt;MassSpectrum&gt; object

    Ex:

    var ms1 = new MassSpectrum();
    ms1.initialize([123.321,456.654,789.987],[147.741, 258.852, 369.963]);
    ms1.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    var ms2 = new MassSpectrum();
    ms2.initialize(ms1);
    ms2.asText();

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000



  MassSpectrum.initialize(mzArray, iArray)

    Initialize this MassSpectrum object with two &lt;Array&gt; of numerical
    values

    mzArray: &lt;Array&gt; object containing the m/z values of the spectrum
    iArray: &lt;Array&gt; object containing the intensity values of the spectrum

    Ex:

    var ms1 = new MassSpectrum;

    var mzArray = [123.321,456.654,789.987];
    var iArray = [147.741, 258.852, 369.963];

    ms1.initialize(mzArray, iArray);

    ms1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000


  MassSpectrum.initialize(mzArray, iArray, mzStart, mzEnd)

    Initialize this MassSpectrum object with two &lt;Array&gt; of numerical
    values and two &lt;Number&gt; entities delimiting a range of acceptable m/z
    values.

    mzArray: &lt;Array&gt; object containing the m/z values of the spectrum
    iArray: &lt;Array&gt; object containing the intensity values of the spectrum
    mzStart: m/z value used to filter the data points to be used for the
    initialization (the start of the acceptable m/z range)
    mzEnd: m/z value used to filter the data points to be crafted for the
    initialization (the end of the acceptable m/z range)

    Ex:

    var ms1 = new MassSpectrum;

    var mzArray = [123.321,456.654,789.987];
    var iArray = [147.741, 258.852, 369.963];

    ms1.initialize(mzArray, iArray, 122.231, 789.986); // range: [122.231-789.986]

    ms1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000


  MassSpectrum.mzArray()

    Return a list of &lt;Number&gt; entities corresponding to all the m/z values of
    the spectrum

    Ex:

    var ms1 = new MassSpectrum;

    var mzArray = [123.321,456.654,789.987];
    var iArray = [147.741, 258.852, 369.963];

    ms1.initialize(mzArray, iArray, 122.231, 789.986); // range: [122.231-789.986]

    ms1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000

    ms1.mzArray(); --&gt; output is:
    123.321,456.654


  MassSpectrum.iArray()

    Return a list of &lt;Number&gt; entities corresponding to all the intensity values of
    the spectrum

    Ex:

    var ms1 = new MassSpectrum;

    var mzArray = [123.321,456.654,789.987];
    var iArray = [147.741, 258.852, 369.963];

    ms1.initialize(mzArray, iArray, 122.231, 789.986); // range: [122.231-789.986]

    ms1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000

    ms1.iArray(); --&gt; output is:
    147.741,258.852


  MassSpectrum.asText()

    Return the data points of the spectrum in &lt;String&gt; object. The format of the
    string is of the kind &lt;m/z&gt;,&lt;intensity&gt;, one data point per line.

    Ex:

    var ms1 = new MassSpectrum;

    var mzArray = [123.321,456.654,789.987];
    var iArray = [147.741, 258.852, 369.963];

    ms1.initialize(mzArray, iArray, 122.231, 789.986); // range: [122.231-789.986]

    ms1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000


  MassSpectrum.tic()

    Return the total ion current calculated for this MassSpectrum object

    Ex:

    var ms1 = new MassSpectrum;
    ms1.initialize([123.321, 456.654, 789.987], [147.741, 258.852, 369.963]);
    ms1.asText();
    ms1.tic(); // --&gt; 776.556


  MassSpectrum.combine(dataPoint)

    Combine into this MassSpectrum object the &lt;DataPoint&gt; object

    dataPoint: &lt;DataPoint&gt; object to combine into this MassSpectrum

    Ex:

    var ms1 = new MassSpectrum;
    ms1.initialize([123.321, 456.654, 789.987], [147.741, 258.852,369.963]);
    ms1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    ms1.tic(); // -&gt; 776.556

    var dp1 = new DataPoint(123.321, 456.654);
    ms1.combine(dp1);
    ms1.asText(); // --&gt; output is:

    123.3210000000 604.3950000000 // value incremented
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    dp1.key = 800;
    dp1.val = 1000;
    ms1.combine(dp1);
    ms1.asText(); // --&gt; output is:

    123.3210000000 604.3950000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000
    800.0000000000 1000.0000000000 // creation of new data point


  MassSpectrum.combine(trace)

    Combine into this MassSpectrum object the &lt;Trace&gt; object

    trace: &lt;Trace&gt; object to combine into this MassSpectrum

    Ex:

    var ms1 = new MassSpectrum;
    ms1.initialize([123.321, 456.654, 789.987], [147.741, 258.852, 369.963]);
    ms1.asText(); //  --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    ms1.tic(); // --&gt; 776.556
    var t1 = new Trace;
    t1.initialize([123.321,600.000,789.987],[147.741, 300.000, 369.963]);
    t1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    600.0000000000 300.0000000000
    789.9870000000 369.9630000000

    t1.valSum(); // --&gt; 817.704
    ms1.combine(t1);
    ms1.asText(); // --&gt; output is:

    123.3210000000 295.4820000000
    456.6540000000 258.8520000000
    600.0000000000 300.0000000000
    789.9870000000 739.9260000000

    ms1.tic(); // --&gt; 1594.26



  MassSpectrum.combine(massSpectrum)

    Combine into this MassSpectrum object the &lt;MassSpectrum&gt; object

    massSpectrum: &lt;MassSpectrum&gt; object to combine into this MassSpectrum

    Ex:

    var ms1 = new MassSpectrum;
    ms1.initialize([123.321, 456.654, 789.987], [147.741, 258.852, 369.963]);

    ms1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    ms1.tic(); // --&gt; 776.556

    var ms2 = new MassSpectrum(ms1);
    ms2.combine(1500, 1000);
    ms2.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000
    1500.0000000000 1000.0000000000

    ms2.combine(ms1);
    ms2.asText(); // --&gt; output is:

    123.3210000000 295.4820000000
    456.6540000000 517.7040000000
    789.9870000000 739.9260000000
    1500.0000000000 1000.0000000000

    ms2.tic(); // --&gt; 2553.112


  MassSpectrum.combine(mz, i)

    Combine into this MassSpectrum object a data point in the form of
    two &lt;Number&gt; values, m/z and intensity

    Ex:

    var ms1 = new MassSpectrum;
    ms1.initialize([123.321, 456.654, 789.987], [147.741, 258.852, 369.963]);
    ms1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    ms1.tic(); // --&gt; 776.556
    var mz1 = 123.321;
    var i1 = 300.000
    ms1.combine(mz1, i1);
    ms1.asText(); // --&gt; output is:

    123.3210000000 447.7410000000 // value incremented
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    ms1.combine(800, 1000);
    ms1.asText(); // --&gt; output is:

    123.3210000000 447.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000
    800.0000000000 1000.0000000000 // new data point created


  MassSpectrum.subtract(dataPoint)

    Subtract from this MassSpectrum object the &lt;DataPoint&gt; object

    dataPoint: &lt;DataPoint&gt; object to subtract from this MassSpectrum


  MassSpectrum.subtract(trace)

    Subtract from this MassSpectrum object the &lt;Trace&gt; object

    trace: &lt;Trace&gt; object to subtract from this MassSpectrum


  MassSpectrum.subtract(massSpectrum)

    Subtract from this MassSpectrum object the &lt;MassSpectrum&gt; object

    massSpectrum: &lt;MassSpectrum&gt; object to subtract from this MassSpectrum

    Ex:

    var ms1 = new MassSpectrum;
    ms1.initialize([123.321, 456.654, 789.987], [147.741, 258.852, 369.963]);
    ms1.asText(); // --&gt; output is:
    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    var ms2 = new MassSpectrum(ms1);
    ms2.subtract(ms1);
    ms2.asText(); // --&gt; output is:

    123.3210000000 0.0000000000
    456.6540000000 0.0000000000
    789.9870000000 0.0000000000


  MassSpectrum.subtract(mz, i)

    Subtract from this MassSpectrum object a data point in the form of
    two &lt;Number&gt; values, m/z and intensity

    Ex:

    var ms1 = new MassSpectrum;
    ms1.initialize([123.321, 456.654, 789.987], [147.741, 258.852, 369.963]);
    ms1.asText(); // --&gt; output is:

    123.3210000000 147.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000

    ms1.subtract(123.321,100);
    ms1.asText(); // --&gt; output is:

    123.3210000000 47.7410000000
    456.6540000000 258.8520000000
    789.9870000000 369.9630000000


AbstractPlotWidget

 This class is not exported to the JavaScript environment, but it
 serves as the base class for all the plot widget subclasses. Its methods
 are thus available to all the objects of the various subclasses, like
 MassSpecPlotWidget, DriftSpecPlotWidget, ColorMapPlotWidget and
 TicChromPlotWidget, collectively referred to as &lt;PlotWidget&gt; below.

 When using objects of the various classes above, the object name will thus
 be, for example, ticChromPlotWidget0 or driftSpecPlotWidget1. These objects
 are made available to the scripting environment in the tree view on the
 left part of the scripting window. See the user manual for
 details.

  &lt;PlotWidget&gt;.showHistory()

    Shows a tooltip with the History of this plot widget.


  &lt;PlotWidget&gt;.historyAsText()

    Return a textual representation of the history of this plot widget.


  &lt;PlotWidget&gt;.showHelpSummary()

    Show a tooltip with a help string summarizing the various keyboard key
    combinations.


  &lt;PlotWidget&gt;.shouldDestroyPlotWidget()

    Start the destruction of this plot widget.


  &lt;PlotWidget&gt;.toggleMultiGraph()

    If the multi-graph plot corresponding to this plot widget is visible, make
    it invisible. And vice versa.


  &lt;PlotWidget&gt;.showMultiGraph()

    Make the multi-graph plot corresponding to this plot widget visible.


  &lt;PlotWidget&gt;.hideMultiGraph()

    Make the multi-graph plot corresponding to this plot widget invisible.


  &lt;PlotWidget&gt;.exportData()

    Open the data export configuration window. Exporting data allows exporting
    only a subset of the whole data set. It can only be performed if the
    original data were read from a SQLite3 database-formatted mass data file.


  &lt;PlotWidget&gt;.asXyText()

    Return  a textual representation of \c this plot widget data.

    Only the data range currently displayed is processed.


  &lt;PlotWidget&gt;.exportPlot()

    Open a file selection dialog window to select a file in which to export
    this plot widget's data.

    Unlike the exportData() function, this function only exports the currently
    displayed graph data to a comma-separated value text file.


  &lt;PlotWidget&gt;.exportPlotToFile(fileName, rangeStart, rangeEnd)

    Export plot data to a text file as a simple plot. Limit the data range to
    export using the numerical parameters.

    fileName: &lt;String&gt; holding the file name
    rangeStart: &lt;Number&gt; holding the beginning of the range to be exported
    rangeEnd &lt;Number&gt; holding the end of the range to be exported


  &lt;PlotWidget&gt;.savePlotToGraphicsFile()

    Open the graphics export configuration dialog window.


  &lt;PlotWidget&gt;.saveToPdfFile(fileName, noCosmeticPen, width, height,
    pdfCreator, title)

    Save this plot widget as a PDF file graphics.

    fileName: &lt;String&gt; holding the file name
    noCosmeticPen: &lt;Boolean&gt; that tells if pen optimizations should be
    performed
    width: &lt;Number&gt; holding the size of the graphics file in pixels
    height: &lt;Number&gt; holding the size of the graphics file in pixels
    pdfCreator: &lt;String&gt; holding the name of the creator of the PDF file
    title: &lt;String&gt; holding the title of the graphics file


  &lt;PlotWidget&gt;.keys()

    Return an &lt;Array&gt; of &lt;Number&gt; values representing the keys of the data
    plotted.


  &lt;PlotWidget&gt;.values()

    Return an &lt;Array&gt; of &lt;Number&gt; values representing the values of the data
    plotted.


  &lt;PlotWidget&gt;.lastTicIntensity()

    Return the last TIC intensity value that was computed.


  &lt;PlotWidget&gt;.trace()

    Return a Trace object initialized with the data in this plot widget.


  &lt;PlotWidget&gt;.replotWithAxisRangeX(lower, upper)

    Replot this plot widget with new key (X-axis) data range.

    lower: &lt;Number&gt; holding the start value of the range
    upper: &lt;Number&gt; holding the end value of the range


  &lt;PlotWidget&gt;.replotWithAxisRangeY(lower, upper)

    Replot this plot widget with new value (Y-axis) data range.

    lower: &lt;Number&gt; holding the start value of the range
    upper: &lt;Number&gt; holding the end value of the range


  &lt;PlotWidget&gt;.getYatX(x)

    get the value at key x.

    x: &lt;Number&gt; holding the X-axis key for which the value is returned.


ColorMapPlotWidget

 This class cannot be instantiated with the new operator. Objects
 of this class are made available to the scripting environment under the
 form of object variable names colorMapPlotWidget[index], with [index]
 being 0 for the first object created and being incremented each time a new
 ColorMapPlotWidget is created.

  ColorMapPlotWidget.jsIntegrateToRt(dtRangeStart, dtRangeEnd, mzRangeStart, mzRangeEnd)

    Starts an integration of mass spectra data to a XIC chromatogram limiting
    the data ranges specified with the numerical arguments.

    dtRange(Start | End) drift time range values
    mzRange(Start | End) m/z range values

    This function creates a new plot widget to display the obtained results.


  ColorMapPlotWidget.jsIntegrateToMz(dtRangeStart, dtRangeEnd, mzRangeStart, mzRangeEnd)

    Starts an integration of mass spectra data to a mass spectrum limiting the
    data ranges specified with the numerical arguments.

    dtRange(Start | End) drift time range values
    mzRange(Start | End) m/z range values

    This function creates a new plot widget to display the obtained results.


  ColorMapPlotWidget.jsIntegrateToDt(dtRangeStart, dtRangeEnd, mzRangeStart, mzRangeEnd)

    Starts an integration of mass spectra data to a drift spectrum limiting the
    data ranges specified with the numerical arguments.

    dtRange(Start | End) drift time range values
    mzRange(Start | End) m/z range values

    This function creates a new plot widget to display the obtained results.


  ColorMapPlotWidget.jsIntegrateToTicIntensity(dtRangeStart, dtRangeEnd, mzRangeStart, mzRangeEnd)

    Starts an integration of mass spectra data to a TIC intensity single value
    limiting the data ranges specified with the numerical arguments.

    dtRange(Start | End) drift time range values
    mzRange(Start | End) m/z range values

    The TIC intensity value is returned


  ColorMapPlotWidget.transposeAxes()

    Transpose the axes of this color map plot widget


  ColorMapPlotWidget.jsSetMzIntegrationParams(mzIntegrationParams)

    Set the m/z integration parameters object passed as parameter to this plot
    widget so that they are taken into account for the next integrations to a
    mass spectrum.


  ColorMapPlotWidget.jsMzIntegrationParams()

    Return the MzIntegrationParams object currently set for this color map
    plot widget.

    These parameters are taken into account for the integrations to a mass
    spectrum.


TicChromPlotWidget

 This class cannot be instantiated with the new operator. Objects
 of this class are made available to the scripting environment under the
 form of object variable names ticChromPlotWidget[index], with [index]
 being 0 for the first object created and being incremented each time a new
 TicChromPlotWidget is created.

  TicChromPlotWidget.jsIntegrateToMz(lower, upper)

    Starts an integration of mass spectra data to a mass spectrum limiting the
    data range specified with the numerical arguments.

    lower, upper: retention time values limiting the integration. If no values
    are provided, there is no limitation to the integration.

    This function creates a new plot widget to display the obtained results.


  TicChromPlotWidget.jsIntegrateToDt(lower, upper)

    Starts an integration of mass spectra data to a drift spectrum limiting the
    data range specified with the numerical arguments.

    lower, upper: retention time values limiting the integration. If no values
    are provided, there is no limitation to the integration.

    This function creates a new plot widget to display the obtained results.


  TicChromPlotWidget.jsIntegrateToTicIntensity(lower, upper)

    Starts an integration of mass spectra data to a TIC intensity single value
    limiting the data range specified with the numerical arguments.

    lower, upper: retention time values limiting the integration. If no values
    are provided, there is no limitation to the integration.

    The TIC intensity value is returned


  TicChromPlotWidget.jsIntegrateToXic(lower, upper)

    Starts an integration of mass spectra data to a XIC chromatogram limiting
    the data range specified with the numerical arguments.

    This process is not equivalent to an integration to RT because we do not
    take into account the History of the current plot widget. Indeed, the
    integration is performed without any filtering from the initial mass
    spectrometry data.

    lower, upper: retention time values limiting the integration. If no values
    are provided, there is no limitation to the integration.

    This function creates a new plot widget to display the obtained results.


  TicChromPlotWidget.statistics()

    Compute the mass spectra statistics on the spectra currently in the range.


  TicChromPlotWidget.newPlot(trace)

    Create a new TicChromPlotWidget using &lt;Trace&gt; trace for the initialization
    of the data.

    This function creates a new plot widget to display the &lt;Trace&gt; data.


  TicChromPlotWidget.jsSetMzIntegrationParams(mzIntegrationParams)

    Set the m/z integration parameters object passed as parameter to this plot
    widget so that they are taken into account for the next integrations to a
    mass spectrum.


  TicChromPlotWidget.jsMzIntegrationParams()

    Return the MzIntegrationParams object currently set for this color map
    plot widget.

    These parameters are taken into account for the integrations to a mass
    spectrum.


MassSpecPlotWidget

 This class cannot be instantiated with the new operator. Objects
 of this class are made available to the scripting environment under the
 form of object variable names massSpecPlotWidget[index], with [index]
 being 0 for the first object created and being incremented each time a new
 MassSpecPlotWidget is created.

  MassSpecPlotWidget.jsIntegrateToDt(lower, upper)

    Starts an integration of mass spectra data to a drift spectrum limiting the
    data range specified with the numerical arguments.

    lower, upper: retention time values limiting the integration. If no values
    are provided, there is no limitation to the integration.

    This function creates a new plot widget to display the obtained results.


  MassSpecPlotWidget.jsIntegrateToRt(lower, upper)

    Starts an integration of mass spectra data to a XIC chromatogram limiting the
    data range specified with the numerical arguments.

    lower, upper: retention time values limiting the integration. If no values
    are provided, there is no limitation to the integration.

    This function creates a new plot widget to display the obtained results.


  MassSpecPlotWidget.jsIntegrateToTicIntensity(lower, upper)

    Starts an integration of mass spectra data to a TIC intensity single value
    limiting the data range specified with the numerical arguments.

    lower, upper: retention time values limiting the integration. If no values
    are provided, there is no limitation to the integration.

    The TIC intensity value is returned


  MassSpecPlotWidget.massSpectrum(lower, upper)

    Creates a new &lt;MassSpectrum&gt; object limiting the data to the lower and
    upper range limits. The data used to craft the new MassSpectrum are this
    plot widget data. That is, the &lt;MassSpectrum&gt; object is not created by
    looking into the internal mass spectral data set.

    lower, upper: m/z values limiting the integration. If no values
    are provided, there is no limitation to the integration and all the points
    in this plot widget are used.

    Return a new MassSpectrum object.


  MassSpecPlotWidget.newPlot(trace)

    Create a new MassSpecPlotWidget using &lt;Trace&gt; trace for the initialization
    of the data.

    This function creates a new plot widget to display the &lt;Trace&gt; data.


DriftSpecPlotWidget

 This class cannot be instantiated with the new operator. Objects
 of this class are made available to the scripting environment under the
 form of object variable names driftSpecPlotWidget[index], with [index]
 being 0 for the first object created and being incremented each time a new
 DriftSpecPlotWidget is created.

  DriftSpecPlotWidget.jsIntegrateToMz(lower, upper)

    Starts an integration of mass spectra data to a mass spectrum limiting the
    data range specified with the numerical arguments.

    lower, upper: retention time values limiting the integration. If no values
    are provided, there is no limitation to the integration.

    This function creates a new plot widget to display the obtained results.


  DriftSpecPlotWidget.jsIntegrateToRt(lower, upper)

    Starts an integration of mass spectra data to a XIC chromatogram limiting the
    data range specified with the numerical arguments.

    lower, upper: retention time values limiting the integration. If no values
    are provided, there is no limitation to the integration.

    This function creates a new plot widget to display the obtained results.


  DriftSpecPlotWidget.jsIntegrateToTicIntensity(lower, upper)

    Starts an integration of mass spectra data to a TIC intensity single value
    limiting the data range specified with the numerical arguments.

    lower, upper: retention time values limiting the integration. If no values
    are provided, there is no limitation to the integration.

    The TIC intensity value is returned


  DriftSpecPlotWidget.newPlot(trace)

    Create a new DriftSpecPlotWidget using &lt;Trace&gt; trace for the initialization
    of the data.

    This function creates a new plot widget to display the &lt;Trace&gt; data.


  TicChromPlotWidget.jsSetMzIntegrationParams(mzIntegrationParams)

    Set the m/z integration parameters object passed as parameter to this plot
    widget so that they are taken into account for the next integrations to a
    mass spectrum.


  TicChromPlotWidget.jsMzIntegrationParams()

    Return the MzIntegrationParams object currently set for this color map
    plot widget.

    These parameters are taken into account for the integrations to a mass
    spectrum.


MainWindow

 This is the main mineXpert program window. It is not instantiable
 through the JavaScript environment. Some funcitonalities are available to
 allow highlevel tasks to be automated. The MainWindow single instance of
 the minexpert software program is made available to the JavaScript
 environment under the object name mainWinwod, with an alias
 mainWnd.

  MainWindow.quit()

    Quit the application.


  MainWindow.clearPlots()

    Clear all plots and give back all memory associated to the mass data.


  MainWindow.jsCreateMassSpectrumFromClipboard()

    Create a new mass spectrum from data in the clipboard. The data in the
    clipboard need to be under the format of &lt;number&gt;&lt;separator&gt;&lt;number&gt;,
    &lt;separator&gt; being any non-numerical and non-'.' character. The first
    &lt;number&gt; is the m/z and the second &lt;number&gt; is the intensity.

    Upon completing the parsing of the textual data in the clipboard, a pseudo
    TIC chromatogram is created that needs to be integrated to a mass spectrum
    using:

    lastTicChromPlotWidget.integrateToMz();

    Ex:
    mainWindow.createMassSpectrumFromClipboard();
    lastTicChromPlotWidget.integrateToMz();


  MainWindow.jsOpenMassSpectrometryFile(fileName, streamed)

    Load mass spectrometry data from fileName.

    fileName: &lt;String&gt; holding the mass spectrometry data file name
    streamed: &lt;Boolean&gt; telling if the loading should be in streamed mode.

    Ex:
    mainWindow.jsOpenMassSpectrometryFile("/tmp/20161027-cgb-wt-mobility.db", true);

    reads the data in the file in streamed mode.

    mainWindow.jsOpenMassSpectrometryFile("/tmp/20161027-cgb-wt-mobility.db", false);

    reads the data in the file in full mode.


  MainWindow.jsOpenMassSpectrometryFiles(fileNameList, streamed)

    Load mass spectrometry data from all the files in the fileNameList.

    fileNameList: &lt;Array&gt; of &lt;String&gt; objects holding the mass spectrometry data file names
    streamed: &lt;Boolean&gt; telling if the loading should be in streamed mode.


  MainWindow.about()

    Open an About dialog window.

    Ex:
    mainWindow.about();


SqlMassDataSlicerWnd

 This class cannot be instantiated with the new operator. The only
 object of this class that is published to the scripting environment is
 named ``sqlMassDataSlicerWnd''.

 This class can only be used safely if it is first activated by using the
 exportData() function of the &lt;PlotWidget&gt; classes (see &lt;PlotWidget&gt;).
 Indeed, the &lt;PlotWidget&gt;.exportData() activates this sqlMassDataSlicerWnd
 object and initializes it with the current data range displayed in the
 widget.

 The following describes the various methods that can be used to automate
 fully the slicing of very large mass spectrometry data files in a set of
 smaller files. There are three ways to create new files of a reduced size
 with respect to the initial mass data file:

 - export data from the original file in a single file but with a smaller
   set of data. For example, export only part of a TIC chromatogram or
   export only the mass data corresponding to a given drift time range.
 - export data from the original file in multiple smaller files (either the
   whole initial data range or a smaller range). Two possibilities are
   offered:

    - define the number of slices (their size is dynamically computed);
    - define the size of the slices (their number is dynamically computed);

 This window is available for any &lt;PlotWidget&gt; displaying TIC/XIC
 chromatogram data or drift spectrum data. It is therefore essential to
 start a data export process from that specific plot widget of interest by
 calling &lt;PlotWidget&gt;.exportData(). This call will initialize all the
 widget-specific data into this data export configuration window.

 Ex:
 mainWnd.openMassSpectrometryFile("/path/to/file/20161027-cgb-wt-mobility.db",
 false);
 // The TIC chromatogram window displays the TIC chromatogram in
 ticChromPlotWidget0

 // Activate and initialize the SqlMassDataSlicerWnd (its object name is
 sqlMassDataSlicerWnd)
 ticChromPlotWidget0.exportData();


 // Set the number of slices to 2
 sqlMassDataSlicerWnd.setSliceCount(2);

 // Set the start of the range of interest (retention time)
 sqlMassDataSlicerWnd.rangeStart(0.2);

 // Set the end of the range of interest (retention time)
 sqlMassDataSlicerWnd.rangeEnd(12.7);

 // Set the format string to use to craft the file names
 sqlMassDataSlicerWnd.setFormatString("%f-export-slice-%n-of-%c-range_%s-%e.db");

 // Validate the configuration settings (crafts the file names according to
 the configuration of the data export and according to the format string)

 sqlMassDataSlicerWnd.validate(false);

 // Take a peek at the various file names that have been crafted.
 sqlMassDataSlicerWnd.reviewFileNames();

 // If the file names have no error, then start the data export process.
 sqlMassDataSlicerWnd.confirm();

 Note that the calls to validate() and reviewFilenames() and confirm() can
 be shortened to a single call to run() if it is expected that no error will
 occur upon validation of the data export parameters (typically when the
 script has been thoroughly tested). In that case, the script runs perfectly
 unattended.

  sqlMassDataSlicerWnd.setSrcFileName(fileName)

    Set the source SQLite3 db mass data file name. Only use this function if
    you know the range of the data you are willing to export. Usually this
    function is not used, because when starting the data export process using
    the &lt;PlotWidget&gt;.exportData() function, that source file name is set
    automatically. Thus we recommend you use this function only if you know
    what you are doing.

    fileName : &lt;String&gt; that holds the name of the source mass spectrometry
    data file in the SQLite3 database format.


  sqlMassDataSlicerWnd.setDestDirectory(dir)

    Set the directory (create it if it does not exist) where all the slice
    files are to be written to. If this function is not called before calling
    the validate() or run() functions, the destination directory will be the
    directory where the source file is residing.

    dir: &lt;String&gt; holding the name of the directory in which to write all the
    slice files.


  sqlMassDataSlicerWnd.setFormatString(format)

    Set the string that configures the naming of the slice files. The
    following format specification is available:

    %f: original filename without &lt;.extension&gt;
    %s: slice range start value
    %e: slice range end value
    %n: slice number
    %c: total count of slices

    For example, if the original (source) filename were "my-mass-data.db"
    and the format string were "%f-export-slice-%n-of-%c-range_%s-%e.db",
    the first file would be named
    "my-mass-data-export-slice-1-of-7-range_17-28.db"
    the second file
    "my-mass-data-export-slice-2-of-7-range_29-40.db"
    and so on for another 5 files since the total count of slices is 7.


  sqlMassDataSlicerWnd.setRangeStart(start)

    Set the start value of the data range to be exported. For example, if the
    data export process was started in a TIC chromatogram plot widget, and the
    whole acquisition run spanned [0-35] minutes, then the user might want to
    only export a fraction of that span: [17-28]. In that case, the range start
    value would be 17.

    start: &lt;Number&gt; setting the start value of the range to be exported.


  sqlMassDataSlicerWnd.rangeStart()

    Return the start value of the data range to be exported. For example, if the
    data export process was started in a TIC chromatogram plot widget, and the
    whole acquisition run spanned [0-35] minutes, then the user might want to
    only export a fraction of that span: [17-28]. In that case, the range start
    value would be 17.


  sqlMassDataSlicerWnd.setRangeEnd(end)

    Set the end value of the data range to be exported. For example, if the
    data export process was started in a TIC chromatogram plot widget, and the
    whole acquisition run spanned [0-35] minutes, then the user might want to
    only export a fraction of that span: [17-28]. In that case, the range end
    value would be 28.

    end: &lt;Number&gt; setting the end value of the range to be exported.


  sqlMassDataSlicerWnd.rangeEnd()

    Return the end value of the data range to be exported. For example, if the
    data export process was started in a TIC chromatogram plot widget, and the
    whole acquisition run spanned [0-35] minutes, then the user might want to
    only export a fraction of that span: [17-28]. In that case, the range end
    value would be 28.


  sqlMassDataSlicerWnd.setRange(start, end)

    Set the data range to be exported. For example, if the data export process
    was started in a TIC chromatogram plot widget, and the whole acquisition
    run spanned [0-35] minutes, then the user might want to only export a
    fraction of that span: [17-28]. In that case, the range start and end
    values would be 17 and 28 respectively.

    start: &lt;Number&gt; setting the start value of the range to be exported.
    end: &lt;Number&gt; setting the end value of the range to be exported.


  sqlMassDataSlicerWnd.setSliceCount(count)

    Set the number of slices to be created out of the initial data set.

    count: &lt;Number&gt; indicating the number of slices.


  sqlMassDataSlicerWnd.setSliceSize(size)

    Set the size of the slices to be created out of the initial data set.

    size: &lt;Number&gt; indicating the size of the slices.


  sqlMassDataSlicerWnd.setExportToOneFile()

    Tells that the initial mass data set must be exported into a single file.
    Any [rangeStart-rangeEnd] export range that might have been set is taken
    into account. Not limiting the range of the exported data makes the data
    export operation equivalent to copying the file into another file virtually
    identical to the initial one.


  sqlMassDataSlicerWnd.fileNames()

    Print the names of the files that will be written during the data export
    process. For the list of file names to be created and be available, first set
    the various data export options (format string, number or size of slices...)
    and call sqlMassDataSlicerWnd.validate().


  sqlMassDataSlicerWnd.reviewFileNames()

    Print the names of the files that will be written during the data export
    process. For the list of file names to be created and available, first set
    the various data export options (format string, number or size of slices...)
    and call sqlMassDataSlicerWnd.validate(). In this function, the graphical
    user interface is modified to allow the user to review the file names and
    makes available a push button to start the export process.


  sqlMassDataSlicerWnd.validate(noconfirm)

    Verify the configuration settings for the data export operation. Upon this
    validation, the file names of the files that will be written during the data
    export are crafted according to the file format string (see
    setFormatString()). This function needs to be called prior to calling
    reviewFileNames() or fileNames(). After reviewing the file names,
    a call to the function confirm() starts the data export process.

    noconfirm: &lt;Boolean&gt; value telling if the data export process can proceed
    automatically. If true, no call to confirm() needs to be done for the data
    export to start immediately if there is no error during the validation step.


  sqlMassDataSlicerWnd.confirm()

    Confirm that the data export process can start. This function must be
    called after the validation has been performed (see validate()) and the
    user has checked that the file names have been correcly crafted upon
    validation according to the format string.



  sqlMassDataSlicerWnd.run()

    After having set the range, the number (or size) of the slices, let the
    program compute the size (or number, respectively) of the slices and run
    the data export. This function calls validate() with noconfirm set to True
    (see validate()). This way, if no error is encountered during the
    validation, then the data export process is started right way, which is
    expected for a script to run unattended.


