The filter sets the MS levels to read. By default it reads MS1, MS2 and MS3 spectra.
Syntax
| Syntax | Description |
|---|
| FileReader(MSFilter filter = MSFilter.MS1 | MSFilter.MS2 | MSFilter.MS3) | Creates a reader with no file open. |
| FileReader(string filename, MSFilter filter = MSFilter.MS1 | MSFilter.MS2 | MSFilter.MS3) | Creates a reader and opens the file. |
Parameters
| Name | Type | Description |
|---|
| filename | string | The file to open. |
| filter | MSFilter | The MS levels to read. |
Exceptions
| Exception | Condition |
|---|
| FormatException | The file extension is not a recognized format. |
| FileNotFoundException | The file could not be opened. |
Example
1
2
3
4
5
6
7
8
| using Nova.Io.Read;
// Open a file now, reading only MS2 spectra.
FileReader reader = new FileReader("DDA.mzML", MSFilter.MS2);
// Or create the reader first and name the file when reading.
FileReader later = new FileReader();
later.ReadSpectrum("DDA.mzML", 1000);
|