{
  "name": "AnnData object slots: content and shape rules",
  "description": "Compiled from the AnnData on-disk format specification: for each top-level element of an AnnData object, what it stores and the shape constraint it must satisfy relative to n_obs and n_var.",
  "page": "https://casrai.org/guides/anndata",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-16T21:57:53Z",
  "temporalCoverage": "2026",
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Slot",
      "unit": "",
      "description": ""
    },
    {
      "name": "Content",
      "unit": "",
      "description": ""
    },
    {
      "name": "Shape constraint",
      "unit": "",
      "description": ""
    },
    {
      "name": "Required",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Slot": "X",
      "Content": "Main data matrix, dense or sparse",
      "Shape constraint": "(n_obs, n_var)",
      "Required": "Optional"
    },
    {
      "Slot": "layers",
      "Content": "Additional matrices, e.g. raw counts",
      "Shape constraint": "Same shape as X",
      "Required": "Optional"
    },
    {
      "Slot": "obs",
      "Content": "Row (observation) annotations as a data frame",
      "Shape constraint": "One row per observation; may hold only an index",
      "Required": "Required"
    },
    {
      "Slot": "var",
      "Content": "Column (variable) annotations as a data frame",
      "Shape constraint": "One row per variable; may hold only an index",
      "Required": "Required"
    },
    {
      "Slot": "obsm",
      "Content": "Multi-dimensional observation annotations (sparse, dense or data frames)",
      "Shape constraint": "First dimension matches n_obs",
      "Required": "Optional"
    },
    {
      "Slot": "varm",
      "Content": "Multi-dimensional variable annotations",
      "Shape constraint": "First dimension matches n_var",
      "Required": "Optional"
    },
    {
      "Slot": "obsp",
      "Content": "Pairwise observation relations",
      "Shape constraint": "First two dimensions match n_obs",
      "Required": "Optional"
    },
    {
      "Slot": "varp",
      "Content": "Pairwise variable relations",
      "Shape constraint": "First two dimensions match n_var",
      "Required": "Optional"
    },
    {
      "Slot": "uns",
      "Content": "Unstructured mapping",
      "Shape constraint": "No shape constraint",
      "Required": "Optional"
    }
  ],
  "sources": [
    {
      "title": "AnnData on-disk format specification",
      "url": "https://anndata.readthedocs.io/en/stable/fileformat-prose.html",
      "accessed": "2026-11-13"
    }
  ]
}