Generation of 'codebook.csv' for seqFISH example

Potential noob question: I was looking at the example on the seqFISH formatting page, and I am unclear how the codebook.csv was created. The page cites that it was “provided by SeqFISH developers”, so should it be standard for most seqFISH experiments?

And is this codebook describing the same things as the codebook class?

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.


Thank you, this makes sense. The description of a codebook and the data I had weren’t lining up, and I wasn’t sure which one was correct, but this clarifies that.