Post

ISpectrumFileReader.GetChromatogram

Reads a chromatogram from the currently open MS data file.


Remarks

ChromatCount gives the number of chromatograms in the open file. Formats that carry none report 0.


Syntax

SyntaxDescription
GetChromatogram(int chromatIndex = -1)Reads a chromatogram from the currently open MS data file.

Parameters

NameTypeDescription
chromatIndexintOptional chromatogram index (zero based) to read. If omitted (or negative), the next chromatogram in the file is read.

Returns

TypeDescription
ChromatogramChromatogram object.

Example

1
2
3
4
5
6
7
8
9
10
using Nova.Data;
using Nova.Io.Read;

ISpectrumFileReader reader = SpectrumFileReaderFactory.GetReader("DDA.mzML", MSFilter.MS1);
for (int i = 0; i < reader.ChromatCount; i++)
{
  Chromatogram chromat = reader.GetChromatogram(i);
  Console.WriteLine(chromat.ID + ": " + chromat.Count + " points");
}
reader.Close();
This post is licensed under CC BY 4.0 by the author.

Trending Tags