{
  "$schema": "./vocab.schema.json",
  "_doc": {
    "purpose": "Sample-name classification vocabulary for the auto-group pipeline. Edit this file to teach the classifier new sample types or matrices without changing TypeScript. All matching is case-insensitive unless a pattern's regex flags say otherwise.",
    "patterns": "Regex source strings (no surrounding slashes). Compiled with the `i` flag at load time.",
    "standardAllow": "Tokens that should be classified as Standard even when they don't match `patterns.standard`. Case-sensitive — use the exact spelling that appears in your filenames.",
    "matrixVocab": "Lowercase token → canonical display name. Tokens are normalised to lowercase before lookup, so adding 'tissues' handles 'Tissues' / 'TISSUES' / 'tissues' uniformly. Multiple aliases map to one canonical (e.g. cell + cells → Cells).",
    "ionizationModes": "Lowercase polarity tokens (pos / positive / neg / negative). Suffixed to the subKind so POS and NEG acquisitions get independent schemas.",
    "tissueParentTokens": "Tokens that flag the immediately-following token as the organ subKind (so `tissues / kidney` becomes Biological/Tissues, tagging both positions).",
    "replicateToken": "Regex source for a token that names a replicate: rep1, Rep2, replicate3, R1, T1 (technical replicate). A column whose values all match is a replicate column: it stays a visible field and is left out of the default group key. B<n> is not in the pattern: on the lab share B13 / S13 are label tokens."
  },

  "patterns": {
    "blank":    "^(blank|blk|solv?blank|matrix.?blank)$",
    "iqc":      "^(iqc|qc|pqc|pooled.?qc)$",
    "eqc":      "^eqc$",
    "standard": "^(standards?|stds?\\d*|istd|cal(?:ibrator)?\\d*|.+standard)$",
    "spikeIn":  "spike.?in",
    "stock":    "^stock$"
  },

  "standardAllow": [
    "ExtractionS",
    "IS",
    "internal.standard"
  ],

  "matrixVocab": {
    "plasma":  "Plasma",
    "serum":   "Serum",
    "tissue":  "Tissue",
    "tissues": "Tissues",
    "kidney":  "Kidney",
    "liver":   "Liver",
    "tumor":   "Tumor",
    "urine":   "Urine",
    "brain":   "Brain",
    "muscle":  "Muscle",
    "adipose": "Adipose",
    "csf":     "CSF",
    "feces":   "Feces",
    "faeces":  "Faeces",
    "cells":   "Cells",
    "cell":    "Cells",
    "media":   "Media",
    "medium":  "Medium",
    "extract": "Extract"
  },

  "ionizationModes": {
    "pos":      "POS",
    "positive": "POS",
    "neg":      "NEG",
    "negative": "NEG"
  },

  "tissueParentTokens": ["tissue", "tissues"],

  "replicateToken": "^(?:rep(?:licate)?|r|t)\\d+$"
}
