Figures

A figure is drawn from the project, not copied from the screen: saved views of the tissue at the figure's size, placed in µm with a scale bar and a legend, beside plots of the results they led to. Every file written carries what it was drawn from.

A figure

The Reports view keeps the project's figures. A figure is a page of panels, at a journal's column width (one column, 85 mm; one and a half, 114 mm; two, 174 mm) or a 16:9 slide, its text 7 pt by default and never below 6 pt. Its panels are lettered A, B, C in reading order. New figure makes one of the first saved view; Add a panel adds a panel of the tissue, of a result (below) or of text beside the last one, and each panel's place and size on the page (in points, 1/72 inch) can be set. The tissue panels of a row keep their images as tall as each other, whatever their legends hold. The preview draws the figure as it will print. The project tree lists the figures, and a figure opens the Reports view at it.

The Reports view: a figure of the Lung example selected, its size, text and panels, and its preview: the Lung section's DAPI stain with the cells outlined and filled by lineage and three genes' transcripts, a scale bar of 50 µm and a legend of the stains, the transcripts and the lineagesThe Reports view: a figure of the Lung example selected, its size, text and panels, and its preview: the Lung section's DAPI stain with the cells outlined and filled by lineage and three genes' transcripts, a scale bar of 50 µm and a legend of the stains, the transcripts and the lineages
A figure of the Lung section: one tissue panel, its preview as it will print, and the buttons that write it.

A tissue panel

A tissue panel is a saved view of the Viewer (see Saved views) drawn at the panel's size. Its region is a center and a width in µm, at first the view's center and the width a Viewer a thousand pixels wide shows at its zoom; its height follows the panel's shape. The panel draws what the view shows:

Each panel is described in words (the dataset, the view, the width shown, the stains, how many cells and transcripts it draws, the scale bar), and the description is written with the figure.

Results

A result panel draws a plot of what the project holds, at the figure's text size and never below 6 pt, from the same numbers its view shows:

A plot that has more rows than its panel holds at 6 pt draws those that fit and says how many it left out.

The Reports view: a figure of the Lung example's results, four panels: the distribution of transcripts per cell, the cells' map colored by cluster with the clusters numbered on it, the classes' neighbor enrichment as a heat map with dots where a pair differs from chance, and the genes in a pattern by Moran's I as barsThe Reports view: a figure of the Lung example's results, four panels: the distribution of transcripts per cell, the cells' map colored by cluster with the clusters numbered on it, the classes' neighbor enrichment as a heat map with dots where a pair differs from chance, and the genes in a pattern by Moran's I as bars
A figure of results: the transcripts per cell, the cells' map, the classes' enrichment and the genes in a pattern.

Writing it

SVG and PDF are vector: the cells, points, legend and text are drawn as shapes and text (the PDF's text in Helvetica, which every reader has), and the stains as one image of 300 dots an inch. PNG is 300 dots an inch, its print size recorded in it. The same figure written at the same time is the same bytes in SVG and PDF.

Every file carries the figure's manifest: the figure, and for each panel what it shows, what it was drawn from (the dataset by its bundle's run and fingerprint, the saved view as it was, the label set, clustering, image and alignment drawn; a result's analysis, map or comparison), what it drew (a tissue panel's region in µm, µm a point, the scale bar, the cells, transcripts and regions, the stains' pixels and level and each image's; a plot's counts) and a digest of its drawing; SituCraft's version and commit; when it was written; and a fingerprint of all of it. It is in an SVG's metadata, a PDF's attached file and a PNG's text chunk, and Its manifest writes it alone as JSON.

Reading a figure back

Read a figure back… opens a figure SituCraft wrote and compares it with the project: whether its manifest is as it was written (its fingerprint), whether each panel's saved view, dataset and artifacts are still those it was drawn from, and whether each panel, drawn again now, is drawn the same.

What made a result

Below the figures, the Reports view shows what made any result (a figure among them): each step from the bundles to it, with its method, parameters, seed, software and references, written as Markdown, JSON or BibTeX. See The record.

By remote control

figure makes a figure of saved views side by side, or of any panels (the tissue, a QC distribution, the cells' map, a spatial answer, a cohort's comparison, text) laid out in rows, or changes one, and answers what each panel draws; write_figure writes it as SVG, PDF, PNG or its manifest, with a fixed time when asked; read_figure reads one back. See Remote control.

How it is checked

The validation suite makes a figure of a saved view of the Lung example (its DAPI stain, three genes, the cells filled by their lineage), writes it in every format, and reads each with its own readers:

For results, it draws the Lung's transcripts per cell, its cells' map, its classes' enrichment and its genes in a pattern, and the simulated cohort's shares, volcano, SIM033 by group and enrichments by condition:

With the simulated tissue's H&E, each of 60 pixels of the figure matches the suite's own placing of the image (through the alignment's deformation and transform, the image's pixels interpolated from its tiles). The Viewer's own pixels match the same placing within four levels of 255.