Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

VirTues: embeddings per cell and per tissue square

What it does

VirTues is a foundation model for multiplex protein images. It gives each cell a list of 512 numbers that summarise the cell and its surroundings, across all your markers. It does the same for each 128 µm square of tissue, and once more for the whole core or image. You can cluster these numbers, compare cells across patients, or give them to a classifier. They have no meaning one by one.

Parameters

The pipeline stops at startup if one of these is missing.

The marker sheet

The model needs to know which protein each channel shows. Add a uniprot_id column to the marker sheet and fill it for each marker to embed:

channel_numbercycle_numbermarker_namechannel_rolechannel_compartmentuniprot_id
11DNA_6dnanuclear
21ELANEmarkercytoplasmP08246
32DNA_7dnanuclear
42CD11BmarkermembraneP11215
As CSV, to copy
channel_number,cycle_number,marker_name,channel_role,channel_compartment,uniprot_id
1,1,DNA_6,dna,nuclear,
2,1,ELANE,marker,cytoplasm,P08246
3,2,DNA_7,dna,nuclear,
4,2,CD11B,marker,membrane,P11215

How it works

Intensities are first scaled per marker, with numbers taken over the tissue pixels of the whole slide: the 0.99 quantile caps each channel, then the log, then the mean and spread. On a tissue microarray every core of a slide shares them, so cells stay comparable across cores. The numbers are saved as {slide}_virtues_stats.json in learned_features/, unless you give virtues_stats.

The image is then resampled to 1 µm per pixel and cut into 128 µm crops. The model embeds each crop in patches of 8 µm, and a cell’s numbers are the average over the patches it covers. Large images are processed in tiles so memory does not grow with image area; the cell results add about 2 GB per million cells for each segmentation method. Each cell gets the same crops as a run on the whole image, and its numbers match the authors’ own code.

Each square is the average of its patches, and the whole core or image is the average of its squares. A square is kept if at least 30% of it is tissue.

The scaling differs from the model’s training, which used statistics over whole datasets. Use virtues_stats with one file for every slide to scale a cohort alike.

Inputs. The full image (only channels with a uniprot_id), the cells of each segmentation method, and the tissue outline.

Outputs.

A cell with no pixel at 1 µm per pixel gets an empty row (NaN). A core or image with no square that is 30% tissue has an empty virtues_tissue row. So does a core where tissue segmentation finds no tissue; its cells are still embedded. See The Zarr store.

If the run stops at the statistics

“standard deviation is zero” means that at least 99% of a marker’s tissue pixels are 0, so the marker carries no signal to scale. Usually background subtraction removed it: check that marker’s exposure and background in the marker sheet. Otherwise leave its uniprot_id empty.

Open points

Read more

Version used:

ModuleToolVersionContainerPaper
VIRTUESvirtuesdocker.io/josenimo/virtues:d2c25e1-2
References
  1. Wenckstern, J., Jain, E., von Querfurth, B., Cheng, Y., Vasilev, K., Pariset, M., Cheng, P. F., Liakopoulos, P., Michielin, O., Wicki, A., Gut, G., & Bunne, C. (2026). The Virtual Tissues foundation model resolves spatial proteomics across scales. Nature, 657(8132), 744–754. 10.1038/s41586-026-10884-y
  2. Lin, Z., Akin, H., Rao, R., Hie, B., Zhu, Z., Lu, W., Smetanin, N., Verkuil, R., Kabeli, O., Shmueli, Y., dos Santos Costa, A., Fazel-Zarandi, M., Sercu, T., Candido, S., & Rives, A. (2023). Evolutionary-scale prediction of atomic-level protein structure with a language model. Science, 379(6637), 1123–1130. 10.1126/science.ade2574