Post

FileReader.OpenSpectrumFile

Opens a file for reading, closing any file already open.


Remarks

Opening a file sets Format, FileName, ScanCount, ChromatCount, FirstScan, LastScan and MaxRetentionTime.


Syntax

SyntaxDescription
OpenSpectrumFile(string fileName)Opens a file for reading, closing any file already open. The reader is chosen by file extension.

Parameters

NameTypeDescription
fileNamestringThe file to open.

Returns

TypeDescription
booltrue if the file opened and is ready to read.

Exceptions

ExceptionCondition
FormatExceptionThe file extension is not a recognized format.

Example

1
2
3
4
5
6
7
using Nova.Io.Read;

FileReader reader = new FileReader();
if (reader.OpenSpectrumFile("DDA.mzML"))
{
  Console.WriteLine(reader.ScanCount + " spectra, scans " + reader.FirstScan + " to " + reader.LastScan);
}
This post is licensed under CC BY 4.0 by the author.

Trending Tags