Adaptive detection of human-mouse multiplets in patient-derived xenograft (PDX) single-cell RNA-seq data.
In mixed-species experiments (such as PDX models, where a human tumor
grows in a mouse host), some droplets capture both a human and a mouse
cell. These multiplets must be removed before
downstream analysis. multipletR detects them using an
adaptive threshold method that, unlike fixed cutoffs, does
not assume a fixed human/mouse proportion, so it
handles the imbalanced species mixtures typical of real PDX samples.
In a PDX sample, human tumor cells and mouse host cells are sequenced together, and some droplets capture one of each: a human-mouse multiplet. Cell Ranger flags multiplets with fixed read-count thresholds that assume a roughly balanced human/mouse mix. In real PDX data the mix is rarely balanced, so cells that are almost entirely human (or mouse) get mislabeled as multiplets.
Instead of fixed cutoffs, multipletR starts from a
conservative central region (cells with a genuinely balanced human/mouse
mix) and expands three thresholds step by step, stopping once the
selected cells stop looking like real multiplets (when their read
distributions become bimodal, stop overlapping, or drift apart). This
lets the multiplet region adapt to each sample.
Install the released version as:
For the latest development version, use:
The remove_multiplets() helper additionally requires
either the Seurat package or
SingleCellExperiment, depending on which object type you
use.
The package takes a single file as its primary input: the GEM classification CSV produced by Cell Ranger when reads are aligned to a combined two-species reference. This section explains where that file comes from, where to find it, and what it contains.
In droplet-based single-cell RNA-sequencing (10x Genomics Chromium), each droplet (a GEM, Gel Bead-in-EMulsion) captures one or more cells together with a barcoded gel bead, so every cell’s transcripts inherit a shared cell barcode and each molecule gets a unique molecular identifier (UMI). Most droplets contain a single cell (a singlet), but some capture two or more; when those cells come from different species, the droplet is a human-mouse multiplet.
To tell the two species apart, reads are aligned with
cellranger count against a combined (“barnyard”) reference
that contains both genomes, for example GRCh38 (human) and GRCm39
(mouse). In this reference every gene is prefixed by its genome of
origin (e.g. GRCh38-EPCAM, GRCm39-Col1a1), so
each read can be attributed to human or mouse. For every cell barcode,
Cell Ranger counts how many reads map to each genome and, using fixed
count thresholds, labels the barcode as human, mouse, or a multiplet.
This per-barcode, two-genome summary is written to the GEM
classification file.
The file is written only when the reference is a multi-genome
(barnyard) reference. For a run with --id=<SAMPLE>,
it is located at:
<SAMPLE>/outs/analysis/gem_classification.csv
The full expression matrix lives separately at
<SAMPLE>/outs/filtered_feature_bc_matrix/.
multipletR does not need the matrix, only
gem_classification.csv, although the
Seurat/SingleCellExperiment helper later joins the calls back onto a
matrix-derived object by barcode.
One row per cell barcode, with these columns:
| Column | Meaning |
|---|---|
barcode |
The 10x cell barcode (often carries a -1 suffix,
e.g. AAACCTGAG...-1). |
| human genome | Per-barcode count of reads assigned to the human genome, named after
the reference build, e.g. GRCh38. |
| mouse genome | Per-barcode count of reads assigned to the mouse genome, named after
the build: GRCm39 (2024-A references), or mm10
/ mm39 for older builds. |
call |
Cell Ranger’s own classification: the human genome name
(e.g. GRCh38), the mouse genome name
(e.g. GRCm39), or Multiplet. |
A typical file looks like:
barcode,GRCh38,GRCm39,call
AAACCTGAGAAACCAT-1,10432,58,GRCh38
AAACCTGAGATCCGAG-1,71,9903,GRCm39
AAACCTGCACGTGTGA-1,4821,5210,Multiplet
The first row is dominated by human reads (a human singlet), the second by mouse reads (a mouse singlet), and the third has substantial reads from both genomes (a multiplet).
The package ships a real PDX example (sample PC65). Here are the first rows:
gem_file <- system.file("extdata", "PC65_gem_classification.csv",
package = "multipletR"
)
head(read.csv(gem_file))
#> barcode GRCh38 GRCm39 call
#> 1 AAACCAAAGCAAGTGG-1 8755 123 GRCh38
#> 2 AAACCAAAGCGAACTC-1 1099 31769 Multiplet
#> 3 AAACCAAAGGAGGCAC-1 78678 452 GRCh38
#> 4 AAACCATTCAATGGCC-1 16813 168 GRCh38
#> 5 AAACCATTCAGCAACC-1 1007 27 GRCh38
#> 6 AAACCATTCGCATGGT-1 100603 11623 MultipletThe package’s whole premise is that a true human-mouse multiplet has
substantial reads from both genomes, whereas a singlet is dominated by
one. The GEM classification file provides exactly the two numbers needed
to test that: the human and mouse read counts per barcode. From them,
multipletR derives, for each barcode, the total reads
(human + mouse) and the percent mouse (mouse / total x 100), and applies
its adaptive thresholds in that total-reads by percent-mouse space
rather than trusting Cell Ranger’s fixed call. The
call column is kept only for the comparison plots. See make-data.R for how this bundled
PC65 example was created.
Because the genome columns are named after whichever reference build
was used, multipletR recognizes several common names
automatically, so you do not have to rename anything:
GRCh38, hg38,
human_reads, humanGRCm39, mm10,
mm39, mouse_reads, mousebarcode,
Barcode, barcodes (if none is present, the row
index is used as a fallback)call, Call,
classificationAs long as the file has a human read-count column and a mouse
read-count column, detect_multiplets() will run; the
barcode and call columns are optional but recommended (the barcode is
what lets you match results back to a Seurat or SingleCellExperiment
object).
Tip: barcode suffixes must match between the GEM
file and any object you later filter. Cell Ranger writes barcodes with a
trailing -1; if your object’s cell names lack it (or vice
versa), remove_multiplets() will match nothing. Make the
two consistent before joining.
detect_multiplets() reads the GEM classification file,
runs the adaptive threshold engine, writes an annotated CSV, and (by
default) draws diagnostic plots. It returns the input data with three
added columns: our_classification (Multiplet /
Singlet), pct_human, and
pct_mouse.
Here we draw both diagnostic views: the percent plot (total reads vs percent mouse) and the total-reads plot (mouse reads vs human reads).
res <- detect_multiplets(
fileIn = gem_file,
fileOut = tempfile(fileext = ".csv"),
plotPercent = TRUE,
plotTotalReads = TRUE
)
#> Final thresholds: T1 (upper % mouse) = 82%, T2 (lower % mouse) = 20%, T3 (lower reads) = 1427. Detected 59 multiplets. Wrote /tmp/Rtmpg5gidq/file1a36140f02e4.csv.The one-line summary reports the final thresholds and the number of multiplets found. The returned data frame carries the per-cell result:
head(res)
#> barcode GRCh38 GRCm39 call our_classification pct_human
#> 1 AAACCAAAGCAAGTGG-1 8755 123 GRCh38 Singlet 98.61
#> 2 AAACCAAAGCGAACTC-1 1099 31769 Multiplet Singlet 3.34
#> 3 AAACCAAAGGAGGCAC-1 78678 452 GRCh38 Singlet 99.43
#> 4 AAACCATTCAATGGCC-1 16813 168 GRCh38 Singlet 99.01
#> 5 AAACCATTCAGCAACC-1 1007 27 GRCh38 Singlet 97.39
#> 6 AAACCATTCGCATGGT-1 100603 11623 Multiplet Singlet 89.64
#> pct_mouse
#> 1 1.39
#> 2 96.66
#> 3 0.57
#> 4 0.99
#> 5 2.61
#> 6 10.36
table(res$our_classification)
#>
#> Multiplet Singlet
#> 59 7587Each plot has two panels: the left colored by Cell Ranger’s
call, the right by the multipletR classification. Across
both panels human singlets are blue and mouse singlets are green; Cell
Ranger’s multiplets are orange (left) and multipletR’s are red (right),
so it is easy to see which cells each method flags.
In the percent plot, multiplets sit in the central percent-mouse band, where a droplet carries a real mix of human and mouse reads; pure human cells fall near 0% mouse and pure mouse cells near 100%. In the total-reads plot, true multiplets have substantial reads from both genomes, so they sit away from the two axes.
The contrast with Cell Ranger is the key point. In this PDX sample Cell Ranger’s fixed thresholds label many predominantly single-species barcodes as multiplets, whereas the adaptive method keeps only the balanced droplets. You can see the size of that gap directly:
# Cell Ranger's multiplet calls (from the GEM file)
sum(read.csv(gem_file)$call == "Multiplet")
#> [1] 579
# multipletR's multiplet calls
sum(res$our_classification == "Multiplet")
#> [1] 59We can confirm the multiplets multipletR keeps are genuinely balanced by looking at their composition, which centers near a mixed human/mouse split rather than sitting at one extreme:
The defaults are the recommended values and rarely need changing, but
every parameter is adjustable. The three starting thresholds are
T1 (upper percent mouse), T2 (lower percent
mouse), and T3 (lower total-reads percentile); the two
stopping sensitivities are overlapDrop and
modeDiff. For example, a more conservative run:
res_strict <- detect_multiplets(
fileIn = gem_file,
fileOut = tempfile(fileext = ".csv"),
overlapDrop = 5, # stop expanding sooner
modeDiff = 0.5 # stricter on distribution similarity
)See ?detect_multiplets for the full list of
arguments.
Once multiplets are detected, remove_multiplets()
carries the result onto a single-cell object. It adds the per-cell
classification to the object’s cell metadata
(multipletR_class, multipletR_pct_human,
multipletR_pct_mouse) and, by default, removes the detected
multiplets so the object is ready for downstream analysis. Setting
remove = FALSE keeps all cells and only annotates them,
which is useful for visualizing where the multiplets fall (for example
on a UMAP colored by multipletR_class) before deciding
whether to filter, following the same idea as tools like
DoubletFinder.
Use object = "seurat" for a Seurat object or
object = "sce" for a SingleCellExperiment; the
classification logic is identical, only the metadata is written to the
appropriate slot.
library(Seurat)
# Build a Seurat object from the same sample's count matrix, then:
# Annotate only (keep all cells) to inspect the multiplets first
seu <- remove_multiplets(seu, res, object = "seurat", remove = FALSE)
table(seu$multipletR_class)
DimPlot(seu, group.by = "multipletR_class")
# Or annotate and remove in one step, ready for downstream analysis
seu_clean <- remove_multiplets(seu, res, object = "seurat")The same call works for a SingleCellExperiment:
library(SingleCellExperiment)
# With an existing SingleCellExperiment 'sce' whose colnames are barcodes:
sce <- remove_multiplets(sce, res, object = "sce", remove = FALSE)
table(sce$multipletR_class)
# Or annotate and remove in one step
sce_clean <- remove_multiplets(sce, res, object = "sce")The object steps are shown but not run here, since they need the full count matrix rather than just the GEM classification file.
| Function | Purpose |
|---|---|
detect_multiplets() |
Detect multiplets from a Cell Ranger GEM classification file; add the classification and draw diagnostic plots. |
remove_multiplets() |
Annotate a Seurat or SingleCellExperiment object with the
classification (Human / Mouse / Multiplet and percent human/mouse) and,
by default, remove the multiplets. Set remove = FALSE to
annotate only. |
The method defines a conservative starting region using three thresholds: T1 (upper percent mouse), T2 (lower percent mouse), and T3 (lower total reads), then expands them step by step to capture additional multiplets. It stops expanding when the human and mouse read distributions start to look like singlets: when a distribution becomes bimodal, when their overlap drops, or when their modes diverge. This lets the multiplet region adapt to each dataset rather than relying on a fixed cutoff.
sessionInfo()
#> R version 4.6.1 (2026-06-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 26.04 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Etc/UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] multipletR_0.99.0 rmarkdown_2.31
#>
#> loaded via a namespace (and not attached):
#> [1] sass_0.4.10 generics_0.1.4
#> [3] SparseArray_1.13.2 lattice_0.22-9
#> [5] magrittr_2.0.5 digest_0.6.39
#> [7] evaluate_1.0.5 grid_4.6.1
#> [9] RColorBrewer_1.1-3 fastmap_1.2.0
#> [11] jsonlite_2.0.0 Matrix_1.7-5
#> [13] SingleCellExperiment_1.35.2 scales_1.4.0
#> [15] jquerylib_0.1.4 abind_1.4-8
#> [17] cli_3.6.6 rlang_1.3.0
#> [19] XVector_0.53.0 Biobase_2.73.1
#> [21] withr_3.0.3 cachem_1.1.0
#> [23] DelayedArray_0.39.3 yaml_2.3.12
#> [25] otel_0.2.0 S4Arrays_1.13.0
#> [27] tools_4.6.1 dplyr_1.2.1
#> [29] ggplot2_4.0.3 SummarizedExperiment_1.43.0
#> [31] BiocGenerics_0.59.10 buildtools_1.0.0
#> [33] vctrs_0.7.3 R6_2.6.1
#> [35] matrixStats_1.5.0 stats4_4.6.1
#> [37] lifecycle_1.0.5 Seqinfo_1.3.0
#> [39] S4Vectors_0.51.5 IRanges_2.47.2
#> [41] pkgconfig_2.0.3 pillar_1.11.1
#> [43] bslib_0.11.0 gtable_0.3.6
#> [45] glue_1.8.1 tidyselect_1.2.1
#> [47] tibble_3.3.1 xfun_0.60
#> [49] GenomicRanges_1.65.1 sys_3.4.3
#> [51] MatrixGenerics_1.25.0 knitr_1.51
#> [53] farver_2.1.2 htmltools_0.5.9
#> [55] patchwork_1.3.2 labeling_0.4.3
#> [57] maketools_1.3.2 compiler_4.6.1
#> [59] S7_0.2.2 diptest_0.77-2