← back to the tutorial

Chains and batch runs over many files

The words of this tutorial, step by step. The text lives in src/smappy/tutorial/topics/; the directions it follows are in src/smappy/tutorial/STYLE.md.

The same, on every file

1. card: Chains and batch runs over many files

An experiment is many cells, and each is analysed the same way.

A chain is plugins in order, with their settings, that runs as one plugin. A batch runs a chain over many files, and writes what each one gave.

spoken: Every cell should be analysed the same way. A chain puts plugins in order; a batch runs it over many files.

A chain

2. Plus chain, at the top of the Analysis tab, starts an empty chain.

3. Add puts a plugin in, from the same tree as the tabs; up and down change the order.

4. Here: drift correction, then Localization Statistics. The tick turns a step off without removing it.

5. Each step is a section with that plugin's own settings, set as in the plugin itself.

Run it once

6. Run it on the open file first, to see that it does what it should.

7. It ran as one plugin: one undo step, and one entry in the history with every step and its settings.

8. Save chain keeps it as a file. Saved, it is a plugin like any other, under Analysis, Chains.

A batch

9. Tools, Batch opens the batch window.

10. Add the files: one by one, or a whole folder, searched for localization files.

11. Choose the chain that was just saved. It can be changed here too, without changing the saved one.

12. Where to write, and what: the processed tables, and the figures as pictures.

13. First file only tries the chain on one file before the rest.

Run

14. Run saves the job as a file, and runs it in a process of its own: a crash costs the batch, never the window.

15. Each file is loaded, run and saved in turn. The status says which are done; the log below says what each step did.

16. card: What is written

A folder per file, with its processed table, its figures and every number each step gave; and one summary with a row per file.

spoken: A folder per file, with its table, figures and numbers, and one summary with a row per file.

Run again

17. Run again, and the files already done with the same settings are skipped. Change a setting, and those files are redone.

18. card: Without the window

The job is a small text file. smappy-batch run runs it on a server, with no window at all.

Chains and jobs are plain text on purpose: an AI assistant can write one from a description of the analysis.

spoken: The job is a text file: it runs without a window, and an AI assistant can write one for you.

Next

19. card: What to remember

- + chain in a tab: add steps, set them, run once, save.
- Tools, Batch: files, a chain, an output folder, Run.
- A folder per file, and summary.csv over all of them.
- Running again redoes only what changed.

spoken: That is chains and batch runs: build it once, run it on every file, and keep the record.