Post

FileReader.Constructor

Creates a FileReader, with or without a file open.


Remarks

The filter sets the MS levels to read. By default it reads MS1, MS2 and MS3 spectra.


Syntax

SyntaxDescription
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

NameTypeDescription
filenamestringThe file to open.
filterMSFilterThe MS levels to read.

Exceptions

ExceptionCondition
FormatExceptionThe file extension is not a recognized format.
FileNotFoundExceptionThe 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);
This post is licensed under CC BY 4.0 by the author.

Trending Tags