Skip to content

Gene sets and scores on a seqFISH embryo

Beginner 15 minutes Data: seqFISH section of a mouse embryo, 19,416 cells, 351 genes (Lohoff et al. 2022)

A single marker gene is noisy; four markers of the same cell type agree with each other where the cell type really is. This tutorial builds two small marker sets, colors a real tissue section by their scores, shows both programs at once, and marks the cells where one of them is high.

The data is a seqFISH section of an 8 to 12 somite-stage mouse embryo, 351 genes measured in place, with the authors' cell-type labels in celltype_mapped_refined. It is the copy that squidpy distributes (Palla et al. 2022).

1. Get the data and load it

Download the file (32 MB) into a folder of your choice:

curl -L -o seqfish.h5ad https://exampledata.scverse.org/squidpy/seqfish.h5ad

In Skopia, open File → Load…, set Load into: to New dataset, browse to seqfish.h5ad and click Load. Click Color next to celltype_mapped_refined to see the embryo's anatomy.

The dots are small on a section this dense: Display → Point Size around 1.5 works well.

2. Normalize

Gene-set scores compare genes with each other, so put them on a common footing first. Open Analyze → Preprocess, run Normalize Total, then Log1p. The View box's Source line now reads log-normalized.

3. Make two marker sets

In the Genes panel, the Sets tab lists gene-set categories. Click + on the MANUAL header (its tooltip reads New gene set: type or paste its genes).

  1. Name: Endothelium.
  2. Genes: Pecam1 Cdh5 Kdr Tal1. Spaces, commas or new lines all work; Skopia checks each symbol against the dataset as you type and fixes the case to the dataset's spelling.
  3. Click Create set.

The form stays open for the next one: name Neural, genes Sox2 Pax6 Otx2 Six3, Create set. Both sets now appear under MANUAL with four genes each.

The New set form

4. Color by a set's score

Click 🎨 on the Endothelium row. The header of the Genes panel reads Coloring by: 4 genes (mean).

The section colored by the Endothelium score

Endothelium score (Pecam1, Cdh5, Kdr, Tal1), default scoring: each gene z-scored by median and MAD, then averaged per cell.

The score is high along thin lines that follow the vasculature and low almost everywhere else. With the default settings each gene is first z-scored against its median and MAD and the four are averaged, so no single bright gene decides the score. Display → Gene Set Aggregation offers other normalizations and UCell rank scoring (Andreatta and Carmona 2021); Color cells explains each.

5. Two programs at once

Switch the Genes panel to its Color tab. Under Bivariate coloring, set Axis 1 to Gene set Endothelium (4 genes) and Axis 2 to Gene set Neural (4 genes), and click Apply Bivariate Coloring.

Bivariate coloring: Endothelium in red, Neural in blue

Endothelium on the red axis, Neural on the blue axis. The legend's corners: white is low for both, red high for Endothelium only, blue high for Neural only, yellow high for both.

The Neural score marks its own regions in blue, the Endothelium score marks the vessels in red, and almost no cell is yellow: the two programs do not share cells, as expected of two unrelated lineages. Where two sets you thought were exclusive do overlap, those cells deserve a closer look.

6. Mark the high-scoring cells

Click Clear to drop the bivariate coloring, color by celltype_mapped_refined again, and go back to the Sets tab. Click 🖍️ on Endothelium.

A highlight layer appears under the row: a histogram of the score with a cutoff (it starts at the median of the nonzero scores), an opacity and a dot size. Cells at or above the cutoff are tinted over whatever coloring is active.

An Endothelium highlight layer over the cell-type coloring

Endothelium highlight layer (≥ the starting cutoff, opacity 85%) drawn in green over the published cell-type labels.

This is the quickest check of a marker set against existing labels: drag the cutoff up until the tint covers only the cells you believe, and read off which labels they carry. Layers stack, so a second set can go on top in another color (Display settings and highlights).

Where next