Post

MzMLWriter.Write

Writes the accumulated mzML content to a file.


Remarks

Validation is off by default, since it requires a local copy of the schema file and validation is not needed to produce a usable file.


Syntax

SyntaxDescription
Write(string filename, bool validateSchema = false, string? schemaPath = null)Writes the accumulated mzML content to filename.

Parameters

NameTypeDescription
filenamestringOutput file path.
validateSchemaboolIf true, re-opens the written file and validates it against the mzML XSD at schemaPath.
schemaPathstring?Path to a local copy of the mzML 1.1.0 XSD. Required if validateSchema is true.

Exceptions

ExceptionCondition
ArgumentExceptionvalidateSchema is true but schemaPath is empty.

Example

1
2
3
4
5
6
7
8
9
using Nova.Io.Write;

MzMLWriter writer = new MzMLWriter();
// ... add software, instrument configuration, a run and spectra ...

writer.Write("converted.mzML");

// Or write and validate against a local copy of the schema.
writer.Write("converted.mzML", true, @"C:\schemas\mzML1.1.0.xsd");
This post is licensed under CC BY 4.0 by the author.

Trending Tags