spectra-data

3.2.0

Construct the object from the given sd object(output of the jcampconverter or brukerconverter filter)

new SD(sd: SD)
Parameters
sd (SD)
Static Members
fromJcamp(jcamp, options)
fromXY(x, y, options)
Instance Members
arrayPointToUnits(doublePoint)
containsParam(name)
createPeaks(options)
fill(from, to, value)
getActiveElement()
getArea(from, to)
getDataType()
getDeltaX()
getFirstX(i)
getFirstY(i)
getFirstY(i)
getLastX(i)
getLastY(i)
getMaxPeak()
getMaxPeak()
getMaxY(i)
getMinMaxY(i)
getMinY(i)
getNbPoints(i)
getNbSubSpectra()
getNoiseLevel(options)
getPage(index)
getParam(name, defvalue)
getParamDouble(name, defvalue)
getParamInt(name, defvalue)
getParamString(name, defvalue)
getPeaks(options)
getPointsInWindow(from, to, options)
getSpectraDataX()
getSpectraDataY()
getSpectraVariable(index)
getSpectrum(i)
getSpectrumData(i)
getTitle(i)
getVector(from, to, nPoints)
getX(i)
getXData(i)
getXUnits()
getXYData(i)
getY(i)
getYData(i)
getYUnits()
is2D()
isDataClassPeak()
isDataClassXY()
putParam(name, value)
reduceData(from, to, options)
resetMinMax()
setActiveElement(nactiveSpectrum)
setDataClass(dataClass)
setDataType(dataType)
setFirstX(x, i)
setFirstY(y, i)
setLastX(x, i)
setLastY(y, i)
setMax(max)
setMin(min)
setMinMax(min, max)
setMolfile(molfile)
setTitle(newTitle, i)
setTotalIntegral(value)
setXUnits(units)
shift(globalShift)
suppressZone(from, to)
suppressZones(zones)
toJcamp(options)
totalIntegral
unitsToArrayPoint(inValue)
updateFirstLastX(x)
updateFirstLastY(y)
updateIntegrals(ranges, options)
yShift(value)
new NMR()

Extends SD

Static Members
fromBruker(brukerFile, options)
fromSignals(prediction, options)
fromXY(x, y, options)
Instance Members
brukerFilter()
brukerFilter(waveletScale, whittakerLambda, ranges)
brukerFilter(waveletScale, whittakerLambda)
createRanges(options)
digitalFilter(options)
echoAntiechoFilter()
fillImpurity(solvent, options)
fourierTransform(SNR)
fourierTransform(spec2, factor1, factor2, autoscale)
fourierTransform()
fourierTransform()
getImpurities(solvent)
getImpurity(solvent, impurity)
getMagnitude()
getRanges(options)
getRanges(options)
getResidual(solvent)
phaseCorrection(phi0, phi1)
phaseCorrection(phi0, phi1, func)
phaseCorrection(phi0, phi1, base)
postFourierTransform(ph1corr)
powerFilter(power)
SNVFilter()
zeroFilling(nPointsX, nPointsY)

This filter applies a circular shift(phase 1 correction in the time domain) to an NMR FID spectrum that have been obtained on spectrometers using the Bruker digital filters. The amount of shift depends on the parameters DECIM and DSPFVS. This spectraData have to be of type NMR_FID

brukerFilter(): NMR2D
Returns
NMR2D: this object

This filter applies a circular shift(phase 1 correction in the time domain) to an NMR FID spectrum that have been obtained on spectrometers using the Bruker digital filters. The amount of shift depends on the parameters DECIM and DSPFVS. This spectraData have to be of type NMR_FID

digitalFilter(options: object): NMR2D
Parameters
options (object) some options are availables:
Returns
NMR2D: this object

Fourier transforms the given spectraData (Note. no 2D handling yet) this spectraData have to be of type NMR_FID or 2DNMR_FID

fourierTransform(): NMR2D
Returns
NMR2D: this object

Return the separation between 2 consecutive points in the indirect domain

getDeltaY(): number
Returns
number:

Return the min value in the indirect dimension.

getFirstY(): sd.minMax.minY
Returns
sd.minMax.minY:

Return the min value in the indirect dimension.

getLastY(): sd.minMax.maxY
Returns
sd.minMax.maxY:

Return the maximum value of the independent variable

getMaxZ(): number
Returns
number:

Return the minimum value of the independent variable

getMinZ(): number
Returns
number:

Return the noise factor depending on the nucleus.

getNMRPeakThreshold(nucleus: string): number
Parameters
nucleus (string)
Returns
number:

Return the observed nucleus in the specified dimension

getNucleus(dim: number): string
Parameters
dim (number)
Returns
string:

Return the solvent name.

getSolventName(): (string | XML)
Returns
(string | XML):

This function Return the units of the direct dimension. It overrides the SD getXUnits function

getXUnits(): (ntuples.units | any | b.units)
Returns
(ntuples.units | any | b.units):

This function Return the units of the indirect dimension. It overrides the SD getYUnits function

getYUnits(): (ntuples.units | any | b.units)
Returns
(ntuples.units | any | b.units):

This function process the given spectraData and tries to determine the NMR signals. Return an NMRSignal2D array containing all the detected 2D-NMR Signals

getZones(options: object): any
Parameters
options (object) Object containing the options.
Returns
any: set of NMRSignal2D.

Return the units of the dependent variable

getZUnits(): (ntuples.units | any | b.units)
Returns
(ntuples.units | any | b.units):

Return true if the it is an homo-nuclear experiment

isHomoNuclear(): boolean
Returns
boolean:

Return the observe frequency in the direct dimension

observeFrequencyX(): number
Returns
number:

Return the observe frequency in the indirect dimension

observeFrequencyY(): number
Returns
number:

This filter makes an phase 1 correction that corrects the problem of the spectra that has been obtained on spectrometers using the Bruker digital filters. This method is used in cases when the BrukerSpectra filter could not find the correct number of points to perform a circular shift. The actual problem is that not all of the spectra has the necessary parameters for use only one method for correcting the problem of the Bruker digital filters.

postFourierTransform(ph1corr: number): NMR2D
Parameters
ph1corr (number) Phase 1 correction value in radians.
Returns
NMR2D: this object

This function increase the size of the spectrum, filling the new positions with zero values. Doing it one could increase artificially the spectral resolution.

zeroFilling(nPointsX: number, nPointsY: number): NMR2D
Parameters
nPointsX (number) Number of new zero points in the direct dimension
nPointsY (number) Number of new zero points in the indirect dimension
Returns
NMR2D: this object

This function return a NMR instance from Array of folders or zip file with folders

fromBruker(brukerFile: Array, options: object): any
Parameters
brukerFile (Array) spectra data in two possible input
options (object) the options dependent on brukerFile input, but some parameter are permanents like:
Returns
any:

This function creates a 2D spectrum from a matrix containing the independent values of the spectrum and a set of options...

fromMatrix(data: Array, options: object): any
Parameters
data (Array)
options (object)
Returns
any:

This function creates a SD instance from the given 2D prediction

fromPrediction(prediction: Array, options: object): SD
Parameters
prediction (Array)
options (object)
Returns
SD:

This class converts a SpectraData object into a String that can be stored as a jcamp file. The string reflects the current state of the object and not the raw data from where this spectrum was initially loaded.

new JcampCreator()
Author: acastillo
Instance Members
convert(spectraData, options)

This function clustering peaks and calculate the integral value for each range from the peak list returned from extractPeaks function.

createRanges(spectrum: SD, peakList: Object, options: Object): Array
Parameters
spectrum (SD) SD instance
peakList (Object) nmr signals
options (Object) options object with some parameter for GSD, detectSignal functions.
Name Description
options.nH number (default 100) Number of hydrogens or some number to normalize the integral data. If it's zero return the absolute integral value
options.integralType string (default 'sum') option to chose between approx area with peaks or the sum of the points of given range ('sum', 'peaks')
options.frequencyCluster number (default 16) distance limit to clustering peaks.
options.clean number? If exits it remove all the signals with integral < clean value
options.compile boolean (default true) If true, the Janalyzer function is run over signals to compile the patterns.
options.keepPeaks boolean (default false) If true each signal will contain an array of peaks.
Returns
Array:

Implementation of the peak picking method described by Cobas in: A new approach to improving automated analysis of proton NMR spectra through Global Spectral Deconvolution (GSD) http://www.spectroscopyeurope.com/images/stories/ColumnPDFs/TD_23_1.pdf

defaultOptions
Parameters
spectrum (SD) SD instance.
peakList (Object) nmr signals.
options (Object) options object with some parameter for GSD.
Name Description
options.compile boolean (default true) If true, the Janalyzer function is run over signals to compile the patterns.
options.minMaxRatio number (default 0.01) Threshold to determine if a given peak should be considered as a noise, bases on its relative height compared to the highest peak.
options.broadRatio number (default 0.00025) If broadRatio is higher than 0, then all the peaks which second derivative smaller than broadRatio * maxAbsSecondDerivative will be marked with the soft mask equal to true.
options.smoothY boolean (default true) Select the peak intensities from a smoothed version of the independent variables?
options.nL number (default 4) factor to determine the width at the moment to group the peaks in signals in 'GSD.optimizePeaks' function.
options.optimize boolean (default true) if it's true adjust an train of gaussian or lorentzian shapes to spectrum.
options.functionType string (default 'gaussian') This option allows us choose between 'gaussian' or 'lorentzian' function when options.optimize is true.
options.broadWidth number (default 0.25) Threshold to determine if some peak is candidate to clustering into range.
Returns
Array:

This function encodes the given vector. The encoding format is specified by the encoding option

encode(data: Array, firstX: number, intervalX: number, encoding: string): string
Parameters
data (Array)
firstX (number)
intervalX (number)
encoding (string) : ('FIX','SQZ','DIF','DIFDUP','CVS','PAC') Default 'DIFDUP'
Returns
string:

This function make a fourier transformation to each FID withing a SD instance

fourierTransform(spectraData: SD): SD
Parameters
spectraData (SD) SD instance
Returns
SD: return SD with spectrum and FID

class encodes a integer vector as a String in order to store it in a text file. The algorithms used to encode the data are describe in: http://www.iupac.org/publications/pac/pdf/2001/pdf/7311x1765.pdf Created by acastillo on 3/2/16.

newLine

Type: string

Phase correction filter

phaseCorrection(spectraData: SD, phi0: number, phi1: number): SD
Parameters
spectraData (SD) SD instance
phi0 (number = 0) value
phi1 (number = 0) value
Returns
SD: returns the modified spectraData

This function performs a circular shift of the input object without realocating memory. Positive values of shifts will shift to the right and negative values will do to the left

rotate(array: Array, shift: number)
Parameters
array (Array) the array that will be rotated
shift (number)
Example
rotate([1,2,3,4],1) -> [4,1,2,3]
rotate([1,2,3,4],-1) -> [2,3,4,1]

This function make a zero filling to each Active element in a SD instance.

zeroFilling(spectraData: SD, zeroFillingX: number): SD
Parameters
spectraData (SD) instance.
zeroFillingX (number) number of points that FID will have, if is it lower than initial number of points, the FID will be spliced
Returns
SD: