Hitchhiker’s Guide to mzTab-M 2.1
This guide shows how a whole dataset becomes an mzTab-M 2.1 file. The specification states the rules field by field; the guide takes one complete example file and explains what each part is for, how the parts refer to each other, and why each value is written the way it is.
Who this guide is for
- Users (researchers, data stewards)
-
You want to understand what an mzTab-M file says about a study: which samples were measured, which molecules were found, and how sure the identification is.
- Developers of exporters
-
You want to know which workflow your tool supports, which profile and which fields that implies, and how to write them correctly the first time.
- AI agents and the people who build them
-
You write or check mzTab-M files and need explicit rules and complete example lines rather than prose. See For AI agents and tool authors.
The guide and the specification
The mzTab-M 2.1 specification is normative: it defines what a valid file is. The schema reference lists every field with its type and whether it is required. This guide explains both and does not add rules of its own. Where it quotes a rule, it links to the section of the specification or the schema reference that states it. If the guide and the specification seem to disagree, the specification is right, and the guide has a bug: please open an issue.
Some questions are still being discussed by the working group. The guide describes the current rules and links to the open discussions:
How to read the examples
Every mzTab line shown in the guide is copied by a script from an example file in the examples/ folder of the repository.
The only lines typed by hand are counter-examples on the checklist page, which are marked as incorrect.
The diagrams are generated from the same files.
If an example changes, the snippets and diagrams are generated again, so they always match the file.
-
Code listings keep the tab characters of the file, so you can copy a line into an editor and get a valid line. In the browser, tabs show as wide gaps between the fields.
-
Table rows (
SML,SMFandSMElines) are wide. Each row is therefore also shown as a two-column table that lists every column with its value. Values in these tables are shown exactly as they appear in the file: a|inside a value is part of the value (it separates list items), not a table border. -
The walkthrough uses
manual_null_null_all-features_v2.1.mztab, a small hand-written file that uses almost every field of mzTab-M 2.1 (all butderivatization_agent[n]) and all four tables. It is valid mzTab-M 2.1. It sits inexamples/2.1/pending-validator/because the reference validator, jmzTab-m, does not yet support all of its features, so the validator may report errors for parts of it.
Pages in this guide
-
Anatomy of an mzTab-M 2.1 File walks through the all-features example from top to bottom: file basics, metadata, the experimental design, the three tables, ambiguous identifications, missing values and optional columns.
-
Which Profile Does My Workflow Produce? helps you choose the profile that matches what your tool produces, and shows which metadata fields each profile makes required.
-
Authoring Checklist collects numbered rules for writing a file, each with a stable ID and a link to the section of the specification or schema reference it comes from.
-
Workflows lists the planned chapters for common workflows and the example each will use.
For AI agents and tool authors
Use these sources, in this order of authority:
-
The specification, including its field reference. It is the normative text.
-
The JSON schema,
schema/mzTab_2_1-M.json, which defines every metadata object and field in machine-readable form (see the schema reference). -
The example files in
examples/. Files inexamples/2.1/validate with the current jmzTab-m snapshot; files inexamples/2.1/pending-validator/are valid 2.1 but use features the validator does not support yet. Tool exports inexamples/may deviate from the checklist: someexamples/2.1/xcms…_onlySMF.mztabfiles, for example, are 2.0.0-M exports with no profile. The hand-writtenmanual_*files are the reference. -
This guide, which explains the three sources above.
To decide which profile a file should declare and which metadata that requires, use the decision table on the profiles page. When you write or check a file, apply the rules of the authoring checklist. Each rule there has a stable ID and links to the specification section that backs it, so you can cite it in an issue or a review. Do not treat the open discussions listed above as rules.