{
  "name": "harmonypy run_harmony parameters: defaults and meaning (version 2.1.0)",
  "description": "Compiled from the harmonypy README parameter table and the run_harmony function signature and docstring in harmony.py (version 2.1.0). Lists each tuning parameter, its default value and what it controls.",
  "page": "https://casrai.org/guides/harmonypy",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-30T10:20:00Z",
  "temporalCoverage": "2026",
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Parameter",
      "unit": "",
      "description": ""
    },
    {
      "name": "Default",
      "unit": "",
      "description": ""
    },
    {
      "name": "What it controls",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Parameter": "theta",
      "Default": "2",
      "What it controls": "Diversity penalty per batch variable; one number for all batches, one per variable, or one per batch level"
    },
    {
      "Parameter": "lamb",
      "Default": "None (estimated)",
      "What it controls": "Ridge regression penalty; None estimates it in each cluster from alpha"
    },
    {
      "Parameter": "sigma",
      "Default": "0.1",
      "What it controls": "Kernel bandwidth for soft clustering"
    },
    {
      "Parameter": "nclust",
      "Default": "min(N/30, 100)",
      "What it controls": "Number of clusters, N = number of cells"
    },
    {
      "Parameter": "tau",
      "Default": "0",
      "What it controls": "Protection against overcorrection"
    },
    {
      "Parameter": "block_size",
      "Default": "0.05",
      "What it controls": "Proportion of cells updated in each block"
    },
    {
      "Parameter": "max_iter_harmony",
      "Default": "10",
      "What it controls": "Maximum Harmony iterations"
    },
    {
      "Parameter": "max_iter_kmeans",
      "Default": "4",
      "What it controls": "Maximum k-means iterations per Harmony iteration"
    },
    {
      "Parameter": "epsilon_harmony",
      "Default": "0.01",
      "What it controls": "Harmony convergence threshold"
    },
    {
      "Parameter": "epsilon_cluster",
      "Default": "0.001",
      "What it controls": "K-means convergence threshold"
    },
    {
      "Parameter": "ncores",
      "Default": "0",
      "What it controls": "Threads; 0 uses one per physical core available to the process"
    },
    {
      "Parameter": "random_state",
      "Default": "0",
      "What it controls": "Random seed for reproducibility"
    }
  ],
  "sources": [
    {
      "title": "harmonypy README",
      "url": "https://github.com/slowkow/harmonypy",
      "accessed": "2026-11-18"
    },
    {
      "title": "harmonypy harmony.py (run_harmony)",
      "url": "https://github.com/slowkow/harmonypy/blob/master/harmonypy/harmony.py",
      "accessed": "2026-11-18"
    }
  ]
}