Differential expression

Does a cell type express a gene more in one group than another? SituCraft answers with each sample (or subject) as one observation, never each cell: the cell type's transcripts summed in each, compared by a model of the design.

Pseudobulk: the unit

Thousands of cells of a type in a section are not thousands of replicates: they share the subject, the slide and the run. Tested cell by cell, tiny differences look certain. SituCraft sums each label's cells' transcripts of each gene in each of the design's rows (a replicate unit, such as a subject, with its samples combined): the label's pseudobulk, from the cohort table (see Sample summaries). It then compares the rows, as bulk RNA-seq compares samples (Crowell et al. 2020).

The model

Compare expression in the Cohort view's Differential expression fits each label in turn:

Each contrast's effect is a log2 fold change with its interval (95% by default). P-values are adjusted by Benjamini and Hochberg over every label, gene and contrast tested; the universe is stated with the results.

Reading the results

Choose a label (and a contrast, when there are several). A sentence says what was compared: the rows used, the genes tested and those too little expressed, how far the variances were moderated, and the tests' degrees of freedom. The volcano plots each gene's log2 fold change against its p-value, those below an adjusted p of 0.05 marked. The table lists the genes by p-value (or by the size of their change), and Find a gene narrows it. Choosing a gene, in the table or on the volcano, plots each row's log2 counts per million by group, read from the cohort table's pseudobulk. The results (CSV) writes every test.

The Cohort view's differential expression of the simulated cohort's epithelial-like cells: the volcano with SIM033 far above the rest, SIM033's subjects by condition, and the genes ranked by p-value with SIM033 first and marked higherThe Cohort view's differential expression of the simulated cohort's epithelial-like cells: the volcano with SIM033 far above the rest, SIM033's subjects by condition, and the genes ranked by p-value with SIM033 first and marked higher
The simulated cohort's subjects compared by condition: SIM033, the gene the simulator raised 2.5-fold in the treated subjects' epithelial-like cells, is the only gene found (+0.94 log2, 0.59 to 1.30).

With four subjects a group, an interval of a log2 fold change is often a whole unit wide. That is the samples' variation, which a test of cells would hide.

Pairing narrows it. When each subject is sampled in both groups, a paired design compares each subject with itself, and the subjects' own levels leave the comparison. In the cohort before and after (six subjects), SIM033 in the epithelial-like cells is +1.08 log2 either way, but its interval is 0.84 to 1.31 paired and 0.75 to 1.41 with the twelve sections as separate units: 0.47 log2 wide instead of 0.66.

Neighbors' transcripts

A label's pseudobulk sums the transcripts within its cells' outlines, and an outline also holds some of its neighbors' transcripts. When the groups differ in which cells lie next to a label's, its pseudobulk differs with them: a gene of the neighbors can be found higher in a label that does not express it. In the cohort before and after, where endothelial-like cells are more common after, their markers SIM025 to SIM030 are found higher after in the epithelial-like and immune-like cells, whose true expression of them did not change. Read a gene found in a label beside the comparison of abundance: when a neighboring type's share changes, its markers may follow it into its neighbors' pseudobulk.

By remote control

compare_expression compares the labels (by the design draft or a saved design) and answers each label's genes found, its lowest p-values, its rows and prior. show_gene shows a gene's values in a label by group, with its tests. See Remote control.

How it is checked