Post

TSpectrum<T>

A generic class for creating spectrum objects with any type of data point.


Remarks

The TSpectrum generic class is an implementation of the ISpectrum interface defining the characteristics for managing mass spectra data structures. <T> defines the type of data point stored in the class, preferrably an m/z - intensity pair (e.g., SpecDataPoint) or similar structure.

Implements

ISpectrum, IDisposable


Constructors

SyntaxDescription
TSpectrum (int count=0)Initializes the spectrum with a default data point array size of count.

Properties

IdentifierTypeDescription
DataPointsSpecDataPoint[]The array of m/z and intensity pairs that comprise a spectrum.
CountintThe number of data points in the DataPoints array

Methods

MethodReturnsDescription
Deserialize (byte[] data)voidConverts a byte array to the contents of a Spectrum.
Dispose ()voidDisposes of the Spectrum.
GetMz (double mz, double ppm = 0)intReturns the index of the DataPoints array whose m/z value falls within the ppm tolerance of the requested mz value.
Resize (int sz)intResizes, and reinitializes to zero, the DataPoints array of the Spectrum.
Serialize ()byte[]Packages the Spectrum into a byte array for storage or transmission.

Example

This post is licensed under CC BY 4.0 by the author.

Trending Tags