SpectrumEx
A spectrum of extended data points with per-peak attributes from a Thermo centroid stream.
Remarks
A spectrum of extended data points carrying the per-peak attributes a Thermo centroid stream provides. It is TSpectrum<SpecDataPointEx>.
Implements
ISpectrum<SpecDataPointEx>, IDisposable
Constructors
| Syntax | Description |
|---|---|
| SpectrumEx(int count = 0) | Creates a spectrum sized for the given number of data points. |
Properties
Inherited from TSpectrum<T>
| Identifier | Type | Description |
|---|---|---|
| Count | int | The number of data points. Stored rather than computed from DataPoints.Length, for speed. |
| DataPoints | SpecDataPointEx[] | The data points. Assigning a new array here directly does not update Count; use Resize. |
Inherited from SpectrumFoundation
| Identifier | Type | Description |
|---|---|---|
| Analyzer | string | Mass analyzer used. |
| BasePeakIntensity | double | The abundance of the most intense peak in the scan. |
| BasePeakMz | double | The m/z of the most intense peak in the scan. |
| Centroid | bool | Identifies the peak data type as centroid (true) or profile (false). |
| CollisionEnergy | double | The activation energy for a fragmentation event. |
| Description | string | The “Scan Description” field from the scan header. |
| DetectorType | string | Detector or mass analyzer used for the scan, such as ITMS or FTMS. |
| ElapsedScanTime | double | Total time, including injection time, to acquire the scan, in milliseconds. |
| EndMz | double | m/z that the scan ends at. |
| FaimsCV | double | FAIMS compensation voltage, if used, in volts. |
| FaimsState | bool | FAIMS state, true when on. FaimsState can be on while FaimsCV is 0. |
| HighestMz | double | Highest m/z observed in the scan. |
| IonInjectionTime | double | Injection time used to acquire the scan ions, in milliseconds, maximum 5000. |
| LowestMz | double | Lowest m/z observed in the scan. |
| MasterIndex | int | Thermo variable for master scan number. |
| MetaData | Dictionary<string, string> | Key/value dictionary for information without a dedicated field. |
| MsLevel | int | The MS level: 0 unknown, 1 MS1, 2 MS2, 3 MS3, and so on. |
| Polarity | bool | Polarity, true when positive. |
| PrecursorActivationMethod | string | If a dependent scan, the activation method used to generate the scan fragments. |
| PrecursorMasterScanNumber | int | If a dependent scan, the parent scan number. |
| Precursors | List<PrecursorIon> | Zero or more precursor ions associated with this spectrum. |
| RetentionTime | double | Scan retention time, in minutes. |
| ScanDescription | string | The scan description. |
| ScanEvent | int | Scan event order. |
| ScanFilter | string | Scan filter line from the raw file. |
| ScanNumber | int | Scan number. |
| ScanType | string | String description of the scan type. |
| StartMz | double | m/z that the scan starts at. |
| TotalIonCurrent | double | Total ion current for the scan. |
Methods
Inherited from TSpectrum<T>
| Method | Returns | Description |
|---|---|---|
| Deserialize(byte[] data) | void | Reads a byte array into spectrum object data members. |
| Dispose() | void | A no-op beyond marking the instance disposed; a spectrum holds no unmanaged resources. |
| GetMz(double mz, double ppm = 0) | int | Finds the data point at an m/z, or the nearest one within a tolerance. |
| Resize(int sz) | void | Replaces the data points with a new, empty array of the given size. Existing points are discarded. |
| Serialize() | byte[] | Writes spectrum object data members into a byte array. Not every member is carried. |
Example
1
2
3
4
5
6
7
8
9
10
11
12
using Nova.Data;
using Nova.Io.Read;
FileReader reader = new FileReader("DDA.raw", MSFilter.MS1);
SpectrumEx spectrum = reader.ReadSpectrumEx("", 1);
int charged = 0;
for (int i = 0; i < spectrum.Count; i++)
{
if (spectrum.DataPoints[i].Charge > 0) charged++;
}
Console.WriteLine(charged + " of " + spectrum.Count + " peaks have an assigned charge.");
This post is licensed under CC BY 4.0 by the author.