# Describe a run's metadata with REMBI Attach experiment metadata to a batch run and get a [REMBI](https://doi.org/10.1038/s41592-021-01166-8)-structured manifest (`deliverables/rembi.yaml`) alongside your measurements — so a dataset ships with machine-readable provenance grouped by REMBI module (Study, Biosample, SpecimenPreparation, ImageAcquisition, ImageData, AnalyzedData). ## The two metadata inputs A run takes metadata from two optional inputs, and folds both into the manifest: | Input | Flag | Scope | Format | Varies per | |---|---|---|---|---| | **Sample metadata** | `--metadata` | per image / per colony | CSV | row (image or grid cell) | | **Study profile** | `--study` | one set per run | YAML | nothing — constant | Neither is required. With no metadata at all you still get a manifest — its `image_data` and `analyzed_data` sections are always populated from the run itself. The two flags just enrich the biological sections. ```bash uv run python -m phenotypic ./images -o ./out \ --metadata metadata.csv \ --study study.yaml ``` ```{note} `--mode process` (apply-only layer export) writes no `deliverables/` bundle, so it emits **no manifest**. The manifest is produced by full measure runs only. ``` ## 1. Sample metadata — the `--metadata` CSV This CSV carries the metadata that *changes* across your images or colonies: strain, media, timepoint, plate, replicate. Example: ```{literalinclude} ../../_static/rembi/metadata.csv :language: text :caption: metadata.csv — per-image sample metadata ``` **How it joins.** The CSV is **inner-joined onto the measurements on every column whose name it shares with them**. So a column only participates in the join if its header *exactly* matches a measurement column: - Join per **image**: give the CSV a `MetadataImage_ImageName` column (the image filename, matching the framework's image-name column). Each row then broadcasts to every colony of that image — the pattern shown above. - Join per **colony**: additionally include `Grid_RowNum` and `Grid_ColNum`. The row then applies to one grid cell. ```{warning} The join key must match the measurement column name **exactly**. After the REMBI namespace migration the image-name column is `MetadataImage_ImageName` (not the old `Metadata_ImageName`). A CSV that still uses the old header shares no column with the measurements and the join is skipped with a warning. Rows with no match are dropped (also warned); duplicate keys multiply rows. ``` **Column names decide the REMBI module.** Use the recommended `Metadata_