The codebook maps the experimentally designed barcodes/sequences to RNA targets. An instance of the Codebook class needs to be created for decoding spots in images. The Codebook class has many methods for creating a Codebook (e.g. from_numpy, from_code_array, and open_json). Unless your seqFISH experiment uses the exact same barcode-to-target mappings you’ll need to create your own codebook. To use the
parse_codebook() function from the seqFISH example, you’ll need to write a csv that matches your experiment and looks like:
gene, I, II, III, IV, V, VI, VII, VIII
ACTB, 1, 2, 3, 4, 1, 2, 3, 4
MALAT1, 4, 3, 2, 1, 4, 3, 2, 1
Each column is an imaging round and the matrix value indicates the channel (1, 2, 3, or 4).
Once you’ve parsed your csv into a Codebook, I recommend you check it by eye and with validate, which will catch obvious formatting errors. Then you can save it
to_json() and use
open_json() for future use. For some examples of how to interpret the codebook json format, check out the codebook help & reference.