TL;DR
Cleanet is an R package designed to automate the detection and classification of "doublets"—instances where two cells are erroneously recorded as a single event—in flow and mass cytometry data. By simulating synthetic doublets and using a nearest-neighbor approach in high-dimensional protein expression space, it provides a robust, data-driven way to clean cytometry datasets and identify the specific cell types contributing to doublet formation.
What Problem Does This Paper Address?
In cytometry, a "doublet" occurs when two cells pass through the detector so closely that they are recorded as one. This is a major source of noise: a doublet containing a T-cell and a B-cell might look like a rare, "novel" cell type that expresses markers for both.
Traditionally, researchers remove these through manual "gating" on scatter plots, which is subjective, time-consuming, and often fails to catch doublets that look like normal cells in two dimensions. As cytometry experiments move toward higher dimensionality (dozens of markers), manual methods become increasingly inadequate. Cleanet addresses the need for an automated, reproducible method to identify these artifacts across high-dimensional protein expression patterns.
Methods
Cleanet utilizes a simulation-based strategy to identify doublets:
- Preprocessing: The data is transformed using an
arcsinhtransformation (standard for cytometry) to handle the wide dynamic range of signal intensities. - Simulation: The algorithm generates "synthetic doublets" by mathematically combining the expression profiles of existing events in the dataset.
- Nearest Neighbor Analysis: The original dataset is augmented with these simulated doublets. For every real event, the algorithm finds its 15 nearest neighbors in the high-dimensional protein space.
- Classification: If a real event's neighborhood is heavily populated by simulated doublets (controlled by a user-defined threshold), that event is flagged as a doublet.
- Composition Analysis: Once doublets are identified, the
classify_doubletsfunction can determine their composition (e.g., a "Monocyte-NK cell" doublet) based on a user-provided classification of the singlets.
The package also includes specialized helper functions (filter_debris_cytof and filter_debris_flow) to remove non-cellular debris before the doublet detection process begins.
Datasets
The documentation references an internal example dataset:
- df_mdipa.csv: A sample dataset included in the
Cleanetpackage, used to demonstrate the workflow from debris filtering to doublet classification.
Large-scale benchmarking against other doublet-detection tools is not detailed in this technical manual.
Key Insights and Ideas
- Synthetic Ground Truth: The core "aha moment" is that we don't need a pre-labeled training set to find doublets. Because we know doublets are just combinations of singlets, we can create our own "ground truth" by simulating them directly from the sample being analyzed.
- Neighborhood as a Proxy for Identity: By looking at an event's "neighbors," the algorithm effectively asks: "Does this event look more like the single cells in my sample, or does it look like the fake doublets I just created?"
- Context-Specific Tuning: The package acknowledges the physical differences between technologies, offering different recommended
cofactorvalues for mass cytometry (5) versus flow cytometry (500-1000). - Beyond Detection: Unlike many tools that simply flag doublets for removal, Cleanet allows users to classify the types of cells within the doublet, which can help researchers understand if certain cell types are more prone to sticking together in their specific experimental conditions.
Key Results
As a software manual, the document focuses on functionality rather than experimental results. However, it establishes a clear, reproducible pipeline:
- Debris Filtering: High-specificity flagging of events with low protein signal or low scatter.
- Automated Labeling: Identification of doublets based on a local density of simulated events.
- Statistical Validation: The
compare_doublets_exp_obsfunction allows users to see if certain doublet combinations are occurring more frequently than would be expected by random chance, providing a metric for sample quality.
Limitations and Future Work
- Dependency on Singlet Classification: To classify the composition of doublets, the user must first provide a valid classification of the singlets. If the initial cell-typing is wrong, the doublet classification will be as well.
- Heuristic Thresholds: The default threshold (5 out of 15 neighbors) is a heuristic. While adjustable, users may need to perform their own validation to find the optimal sensitivity/specificity balance for their specific tissue type.
- Computational Load: While the package uses
RcppHNSWfor fast neighbor searching, high-dimensional simulation and neighbor calculation on very large datasets (millions of events) can be computationally intensive.
Summary updated