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.

HTO demultiplexing

Call each droplet’s donor in a pooled eight-donor experiment from hashtag oligonucleotide (HTO) counts, and check the calls against each droplet’s RNA content. In cell hashing, each sample is stained with its own HTO, attached through antibodies or lipids, so that several samples can share one droplet capture. A droplet with one positive tag is called a singlet, one with two or more a doublet, and one with none a negative.

The data come from the cell hashing experiment of Stoeckius et al. (2018), which stained the peripheral blood mononuclear cells (PBMCs) of eight human donors with one tag per donor, BatchA to BatchH, and pooled them with unstained HEK293T and mouse NIH3T3 cells as negative controls. Of 21,522 barcodes with at least 200 RNA UMIs, ds.qc.hto_demultiplexing calls 16,322 singlets (75.8%; 1,764 to 2,281 per donor), 3,203 doublets (14.9%) and 1,997 negatives (9.3%). The RNA counts, which the demultiplexing never reads, agree with the calls: doublets hold a median of 1,002 RNA UMIs against the singlets’ 561, and 81.9% of negatives hold more than 5,000 RNA UMIs, against 4.5% of singlets, so most negatives are the unstained cell lines.

Download the cell hashing example

The tag counts and the RNA counts come from GEO series GSE108313, as a 1.1 MB HTO file and a 33 MB RNA file. Only the eight tag counts go into a CyteArc store; from the RNA file the page keeps only each barcode’s total, to choose the barcodes that hold a cell and later to check the calls. The downloads and the store go to a temporary directory; to keep them, use a project directory instead.

Started: 2026-11-18T00:15:59.086083Z | Wall time: 1.466 s

hto 1.07 rna 32.73 Name: Downloaded MB, dtype: float64

Started: 2026-11-18T00:16:00.554935Z | Wall time: 1.428 s

Read the eight tag counts

The HTO table has tags in rows and barcodes in columns. Three of its rows, bad_struct, no_match and total_reads, summarize read processing rather than count a tag, so they are dropped before import. Each tag name is shortened to its BatchA to BatchH prefix; the suffix is the tag’s oligonucleotide sequence.

BatchABatchBBatchCBatchDBatchEBatchFBatchGBatchH
barcode
GGCGACTAGAGGACGG30162626988155532
CATCAAGGTCTTGTCC43902224472117
AAACCTGAGTGATCGG12151923212763
TGAGGGAGTACTTAGC262013246757632
CCTAAAGAGATGTGGC741224175519825

Started: 2026-11-18T00:16:01.985679Z | Wall time: 2.156 s

Two of the first five barcodes carry one tag in the thousands, BatchD with 2,698 counts and BatchE with 1,755, while every other count in the table stays below 100.

Choose barcodes using RNA counts

HTO counts alone do not show that a droplet contains a cell. Keep the barcodes that both files hold and that have at least 200 RNA UMIs, the RNA threshold that Stoeckius et al. (2018) used to choose the barcodes to classify. The unstained cell lines stay in, so their barcodes should be called negative. The RNA table holds 40,899 genes for 50,000 barcodes, too large to load whole, so the next cell sums it one gene at a time, which takes about a minute.

Genes in the RNA file 40899 Barcodes in the RNA file 50000 Barcodes in the HTO file 65000 Barcodes in both files 39842 Shared barcodes with at least 200 RNA UMIs 21522 Name: Count, dtype: int64

Started: 2026-11-18T00:16:04.144698Z | Wall time: 31.802 s

Import the HTO assay

Write the selected tag counts to a new store and declare the assay’s type as HTO, which ds.qc.hto_demultiplexing requires. The first writable open of a store removes from I, the column of active cells that analyses start from, every cell that detects 10 or fewer features of the default assay; a barcode here detects at most eight tags, so min_features_per_cell=-1 turns that floor off and I keeps every selected barcode. The RNA totals become a cell column, RNA_nCounts, without copying the RNA matrix.

DataStore has 21522 (21522) cells with 1 assays: HTO Cell metadata: 'I', 'ids', 'names', 'HTO_nCounts', 'HTO_nFeatures', 'RNA_nCounts', 'sourceRow' HTO assay has 8 features and following metadata: 'I', 'ids', 'names', 'dropOuts', 'nCells'

Started: 2026-11-18T00:16:35.948863Z | Wall time: 3.531 s

Assign singlets, doublets and negatives

ds.qc.hto_demultiplexing follows the method of Stoeckius et al. (2018), which Seurat implements as HTODemux. The method normalizes each tag’s counts across barcodes with the centered log-ratio (CLR) transform, clusters the barcodes with k-means into one more cluster than there are tags, and takes, for each tag, the cluster with the lowest mean count as the tag’s background. Each tag’s cutoff is the 0.99 quantile of a negative binomial distribution fitted to its background counts, and a count above the cutoff is positive; positive_quantile, Seurat’s positive.quantile, sets another quantile. The original method and Seurat’s default both cluster with k-medoids; with k-means, Seurat’s HTODemux makes the same calls as CyteArc in the comparison that the methods reference reports.

ds.qc.hto_demultiplexing reads a cell selection, a frozen record of which barcodes to analyze, and saves its calls as an artifact, an immutable stored result that records its inputs and settings; the cell table stays unchanged. Each singlet is labeled with its one positive tag, and every other barcode with Doublet, which includes higher-order multiplets, or Negative. Seurat instead names a singlet after the tag with its highest CLR value, which in unbalanced pools can be a tag that the cutoff called negative.

BarcodesPercent
Class
Singlet1632275.8
Doublet320314.9
Negative19979.3

Started: 2026-11-18T00:16:39.482755Z | Wall time: 2.027 s

The next table splits the singlets by tag and gives each tag’s cutoff in raw counts.

SingletsCutoff (raw counts)
Tag
BatchA219375
BatchB2281104
BatchC214193
BatchD1944112
BatchE176489
BatchF1790146
BatchG2007234
BatchH2202130

Started: 2026-11-18T00:16:41.511739Z | Wall time: 0.015 s

Every donor contributes between 1,764 (BatchE) and 2,281 (BatchB) singlets, as expected for samples pooled in equal proportion Stoeckius et al., 2018. The cutoffs range from 75 counts for BatchA to 234 for BatchG, because each tag has its own background level.

Inspect the tag signal

The heatmap shows the mean CLR value of each tag in each group of calls, and the table below it gives the range of those means.

Heatmap of mean CLR values, with the eight HTO tags in rows and the eight singlet groups, the doublets and the negatives in columns, colored from dark purple near 0.5 to yellow near 4. The diagonal is bright: each singlet group averages 2.96 to 4.12 on its own tag, with BatchG the dimmest in green, and 0.44 to 0.53 on the other seven tags. The doublet column is an even blue, 1.22 to 1.55 on every tag, and the negative column stays dark at 0.50 to 0.58.
Lowest mean CLRHighest mean CLR
Singlets, own tag2.964.12
Singlets, other tags0.440.53
Doublets, every tag1.221.55
Negatives, every tag0.500.58

Started: 2026-11-18T00:16:41.528401Z | Wall time: 0.399 s

Each singlet group averages 2.96 to 4.12 on its own tag and 0.44 to 0.53 on the other seven, close to the 0.50 to 0.58 that the negatives average on every tag. BatchG separates least: its singlets have the lowest own-tag mean, and its cutoff is the highest. Doublets average 1.22 to 1.55 on every tag, between the two levels.

The violins show the spread behind those means for BatchA and BatchB, one value per barcode.

Two panels of violin plots, for BatchA and BatchB, of each barcode's CLR value of that tag in the eight singlet groups, the doublets and the negatives. In each panel the tag's own singlets center near 4 and reach from about 1.6 up to 9 for BatchA and 7 for BatchB, while the other singlet groups and the negatives stay between 0 and about 1.6. The doublet violin is widest at background and has a long upper tail with a second bulge near the singlets' level.

Started: 2026-11-18T00:16:41.929708Z | Wall time: 0.764 s

In both panels the tag’s own singlets sit far above the other singlet groups and the negatives. Their violin narrows to a thin tail toward the tag’s cutoff, where the other groups end, so few barcodes lie near the cutoff. The doublet violins have two modes: most doublets sit at background on a given tag, and the doublets that include a cell from that donor reach the singlets’ level, which puts the doublet means of the heatmap between the two.

Check the calls against RNA content

The demultiplexing reads only the tag counts, so the RNA content of each barcode gives an independent check: a droplet with two cells should hold about twice the RNA of a singlet. The plot shows, for each group of calls, the fraction of barcodes at or below each RNA total, with a dashed line at 5,000 RNA UMIs, and the table compares the classes’ medians and their share of barcodes above that line.

Cumulative distributions of RNA UMIs per barcode on a log axis from 200 to about 80,000, one line for each of the eight singlet groups, the doublets and the negatives, with a dashed vertical line at 5,000 UMIs. The eight singlet lines lie close together and pass one half near 560 UMIs, with BatchB slightly right of the others below one half and BatchC slightly below them between 0.8 and 0.94; the doublet line lies to their right and passes one half near 1,000. The singlet and doublet lines level off near 0.95 by about 3,000 UMIs, leaving about 5% of their barcodes above the dashed line. The negative line rises to about 0.18 by the dashed line, stays nearly flat, then climbs steeply between 10,000 and 40,000 UMIs and passes one half near 19,000.
Median RNA UMIsPercent above 5,000 RNA UMIs
Class
Singlet5614.5
Doublet10025.4
Negative1918481.9

Started: 2026-11-18T00:16:42.696218Z | Wall time: 0.388 s

The eight singlet curves lie close together, so every donor contributes cells with similar RNA content. Doublets hold a median of 1,002 RNA UMIs, nearly twice the singlets’ 561. Negatives hold a median of 19,184 RNA UMIs, and 81.9% of them hold more than 5,000, a level that only 4.5% of singlets reach. Most negatives are therefore the unstained cell lines, as Stoeckius et al. (2018) also found; the authors attribute the remaining, lower-RNA negatives to failed reactions or droplets that hold only ambient RNA.

Hashing cannot see two kinds of multiplet, because each carries a single tag: two cells from the same donor, and a tagged PBMC paired with an untagged cell line. With eight donors in near-equal shares, about one PBMC doublet in eight pairs two cells of the same donor. The 4.5% of singlets above 5,000 RNA UMIs hold the RNA content of a cell line, as the second kind would. RNA quality control and RNA-based doublet scoring are the checks for such droplets.

Adjust the calls to your design

The default cutoff lets about one background count in a hundred through, so a singlet can gain a second positive tag by chance and be called a doublet. A stricter positive_quantile turns such false doublets back into singlets but can push weakly tagged singlets into the negatives. The next cell repeats the demultiplexing at 0.999 and follows the barcodes whose class changes, by their RNA content.

BarcodesMedian RNA UMIsPercent above 5,000 RNA UMIs
Class at 0.99Class at 0.999
SingletSinglet160815634.3
Negative24140018.3
DoubletSinglet2626227.3
Doublet293510375.1
Negative649233.3
NegativeNegative19971918481.9

Started: 2026-11-18T00:16:43.086464Z | Wall time: 0.830 s

At 0.999, 262 doublets become singlets and 241 singlets become negatives, so the number of singlets barely changes. The new singlets hold a median of 622 RNA UMIs, close to the 563 of the singlets that stay and well below the 1,037 of the doublets that stay, so most of them are singlets whose second tag crossed the default cutoff by chance. The new negatives hold the lowest median in the table, 400 RNA UMIs, yet 18.3% of them hold more than 5,000, the range of the cell lines, against 4.3% of the singlets that stay, so the stricter cutoff also moves some cell-line barcodes out of the singlets. Try a stricter quantile when the doublet calls exceed the multiplet rate that the cell loading predicts and their second tags sit near background, and compare the classes in this way. Each quantile is saved as its own artifact, so both sets of calls stay in the store; the selection below keeps the default calls that the rest of this page describes.

Pools of cells that used different tags cannot be demultiplexed together: each tag’s background cluster falls in a pool that never used the tag, where its counts are all zero, so CyteArc refuses and names the tag. Pass the cell column of each cell’s pool as sample_column to demultiplex each pool with its own tags. A warning that a tag’s calls overlap its background means that fewer than half of its positive barcodes lie in the one-in-a-million tail of its background fit at the default quantile, as for an unused tag or a failed stain; inspect that tag’s count distribution before keeping its singlets. The API reference lists the other options of ds.qc.hto_demultiplexing, such as hashtags for a subset of tags, and the per-barcode diagnostics that the artifact stores: the two strongest CLR tags, max_id and second_id, and the difference of their values, margin.

Select the singlets

ds.select_cells turns the eight tag calls into a new cell selection and deletes no rows, so the negatives and doublets stay in the store. In a store that also holds the RNA counts, pass the selection as cell_selection= to an analysis or as cells= to a pipeline recipe. The RNA recipe can also demultiplex within its own run: with an assay of type HTO in the store, ds.pipeline.rna(hashing=True) keeps the cells of exactly one tag and sets the median absolute deviation (MAD) bounds of the recipe’s quality-control filter within each tag, so that each donor’s cells are filtered against their own distribution. hashing= also takes the keywords of ds.qc.hto_demultiplexing, such as {"positive_quantile": 0.999}.

Selected singlets 16322 Barcodes retained in the store 21522 Name: Barcodes, dtype: int64

Started: 2026-11-18T00:16:43.919421Z | Wall time: 0.046 s

The selection keeps the 16,322 singlets, and all 21,522 barcodes stay in the store. Quality control and doublet detection covers the next step: filtering cells on their RNA quality metrics and scoring the doublets that hashing cannot see.

References
  1. Stoeckius, M., Zheng, S., Houck-Loomis, B., Hao, S., Yeung, B. Z., Mauck, W. M., Smibert, P., & Satija, R. (2018). Cell Hashing with barcoded antibodies enables multiplexing and doublet detection for single cell genomics. Genome Biology, 19(1). 10.1186/s13059-018-1603-1