Writes a CSV with one row per image, ready to fill in (in Excel, Numbers
or R), which analyze_plates() then merges into every output table.
Folder with plate images.
Output CSV path (default plate_metadata.csv in dir).
Default treatment for all plates (e.g. "bacteria"), or
NA to leave empty.
Optional named character vector of regular expressions: names are treatment labels, values are matched against file names.
Named list of additional constant columns, e.g.
list(bacterium = "isolate_7", zymo_strain = "IPO323", day = 7).
Overwrite an existing file.
The metadata data frame (invisibly), also written to file.
Columns:
Image file name (do not edit).
Identifier used in all outputs (file name by default).
"control" (Zymoseptoria alone, no bacterium) or the
name of the confrontation, e.g. "bacteria". This column decides the
layout: "control" plates are analysed without a central bacterium.
Free design variables; add or remove any columns you like.
treatment can be pre-filled from the file names with patterns, e.g.
patterns = c(control = "ctrl|control", bacteria = "bact|conf").
d <- tempfile(); dir.create(d)
for (f in c("ctrl_01.png", "ctrl_02.png", "bact_01.png")) {
png::writePNG(array(0.5, c(10, 10, 3)), file.path(d, f))
}
meta <- make_metadata(d, patterns = c(control = "ctrl", bacteria = "bact"),
extra = list(bacterium = "isolate_7", day = 7))
#> ✔ Wrote 3 plates to /var/folders/f1/f8pqw4_n4y90tlykbbhy3ztm0000gn/T//RtmpzynSAP/file17fe7dd82e08/plate_metadata.csv.
meta
#> file plate_id treatment bacterium zymo_strain medium day replicate
#> 1 bact_01.png bact_01 bacteria isolate_7 <NA> <NA> 7 NA
#> 2 ctrl_01.png ctrl_01 control isolate_7 <NA> <NA> 7 NA
#> 3 ctrl_02.png ctrl_02 control isolate_7 <NA> <NA> 7 NA
#> photo_date notes
#> 1 <NA> <NA>
#> 2 <NA> <NA>
#> 3 <NA> <NA>