Post

MzMLWriter.AddRun

Starts a run; spectra added afterward belong to it.


Remarks

Call AddRun before the first AddSpectrum. Without a run, AddSpectrum throws a NullReferenceException.


Syntax

SyntaxDescription
AddRun(string id, string instConf)Starts a run; spectra added afterward belong to it.

Parameters

NameTypeDescription
idstringThe run id.
instConfstringThe id of the instrument configuration the run used.

Example

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

MzMLWriter writer = new MzMLWriter();
writer.AddInstrumentConfiguration("IC1", null);
writer.AddRun("run1", "IC1");

FileReader reader = new FileReader("DDA.raw");
foreach (Spectrum spectrum in reader)
{
  writer.AddSpectrum(spectrum);
}
This post is licensed under CC BY 4.0 by the author.

Trending Tags