본문으로 건너뛰기
cccskills
무료GitHub에 공개

bio-flow-cytometry-doublet-detection

Detects and removes doublets/aggregates from flow, spectral, and mass cytometry before clustering or quantification. Covers FSC-A vs FSC-H singlet discrimination (the Area-Height non-proportionality, not a 1D area gate), FSC-W/SSC width gating, CyTOF Gaussian discrimination parameters (Center/Offset/Width/Residual/Event_length) and DNA intercalator gating, and the residual heterotypic conjugates that survive scatter gating and masquerade as double-positive populations. Use when filtering aggregates before phenotyping, choosing a doublet method for flow vs CyTOF, or diagnosing a suspicious double-positive cluster.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

실행 점수 미검증

설치 방법 보기

포함된 파일(3)

  • SKILL.md7.8 KB
  • examples/detect_doublets.R2.1 KB
  • usage-guide.md3.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Version Compatibility

Reference examples tested with: flowCore 2.14+, CATALYST 1.26+, ggplot2 3.5+.

Before using code patterns, verify installed versions match. If versions differ:

  • R: packageVersion('<pkg>') then ?function_name to verify parameters

If code throws an error, introspect the installed package and adapt rather than retrying.

Doublet Detection

"Remove doublets from my cytometry data" -> Discriminate single cells from aggregates using pulse geometry (flow) or ion-cloud parameters (CyTOF), before any clustering or quantification.

  • R (flow/spectral): flowCore gate on the FSC-A vs FSC-H diagonal (+ FSC-W/SSC-W)
  • R (mass/CyTOF): gate on DNA intercalator + Gaussian/Event_length parameters

The Single Most Important Modern Insight -- Doublets Are Caught by Area-vs-Height Non-Proportionality, and Scatter Gating Is Necessary but Not Sufficient

A doublet has roughly double the pulse AREA of a singlet but NOT double the Height, and a longer Width/transit time - so singlets fall on a tight FSC-A vs FSC-H diagonal and doublets deflect above it. A 1D area histogram therefore does NOT remove doublets; the discriminating signal is the Area-Height relationship (plus Width). This matters because an unremoved doublet of a CD3+ and a CD19+ cell reads as an artifactual CD3+CD19+ "double-positive," and clustering will faithfully (and wrongly) carve it out as a real population. Crucially, scatter gating is necessary but NOT sufficient: heterotypic conjugates (e.g. a CD3+CD14+ T:monocyte) survive standard FSC-A/H gates and present as genuine double-positives whose lineage-marker levels look COMPARABLE to true single-positives - the tell is an ELEVATED shared marker (e.g. CD45) and a high bright-field aspect ratio, so the definitive resolver is imaging flow cytometry, not a lineage-intensity check (Stadinski 2020 Cytometry A 97:1102). On CyTOF there is no scatter at all - doublets are removed by ion-cloud Gaussian parameters and DNA intercalator content (Bagwell 2020 Cytometry A 97:184).

Method Taxonomy

MethodInstrumentPrincipleCaveat
FSC-A vs FSC-Hflow/spectralsinglets on the A-H diagonalthe standard; the discriminator is non-proportionality, not area
FSC-W / SSC-Wflow/spectraldoublets have longer pulse Widthcomplementary to A-vs-H
DNA intercalator (Ir191/193)CyTOFdoublets show ~2N+ DNAalso separates cells from beads/debris
Gaussian params + Event_lengthCyTOFion-cloud fit residual/length flags fusionscatches fusions DNA alone misses (Bagwell 2020)
imaging cytometryimaging flowbright-field aspect ratiothe only clean resolver of heterotypic conjugates

Note: cytometry doublet removal is GATING-based. DoubletFinder/Scrublet/scDblFinder are scRNA-seq DROPLET methods (they simulate artificial doublets) - limited transfer, because cytometry has direct physical doublet signals.

FSC-A vs FSC-H Singlet Gating (flow/spectral)

Goal: Keep events on the singlet diagonal.

Approach: A polygon along the A=H diagonal (preferred over a rectangle, which keeps off-diagonal doublets); visualize with the gate overlaid.

library(flowCore); library(ggcyto)

# matrix dimnames preserve 'FSC-A'/'FSC-H'; data.frame() would mangle them to FSC.A
singlet <- polygonGate(filterId = 'singlets', .gate = matrix(
  c(20000, 10000, 250000, 200000, 250000, 260000, 20000, 40000), ncol = 2, byrow = TRUE,
  dimnames = list(NULL, c('FSC-A', 'FSC-H'))))
singlets <- Subset(fs, singlet)
autoplot(fs[[1]], 'FSC-A', 'FSC-H') + ggcyto::geom_gate(singlet)

CyTOF Doublet Removal

Goal: Keep intercalator-positive single ion clouds.

Approach: Gate DNA intercalator (nucleated, ~2N) and Event_length/Gaussian residual; CATALYST exposes these as channels in the SCE.

library(CATALYST)
# prepData moves Time/Event_length to int_colData by default - keep them in the assay with FACS=TRUE
sce <- prepData(fs, panel, md, transform = TRUE, cofactor = 5, FACS = TRUE)
e <- assay(sce, 'exprs')

dna <- e['DNA1', ]                                   # intercalator-positive = nucleated single cells
keep <- dna > quantile(dna, 0.05) & dna < quantile(dna, 0.95)
if ('Event_length' %in% rownames(sce))               # retained by FACS=TRUE (now on the arcsinh scale)
  keep <- keep & e['Event_length', ] <= quantile(e['Event_length', ], 0.99)   # quantile-relative, so scale is fine
sce_singlets <- sce[, keep]

Per-Method Failure Modes

1D area gate leaves doublets

Trigger: gating only FSC-A. Mechanism: doublets overlap singlets in area. Symptom: double-positive clusters persist. Fix: gate the FSC-A vs FSC-H diagonal (+ Width).

Heterotypic conjugate survives scatter gating

Trigger: a surprising double-positive between two single-positive clusters. Mechanism: T:monocyte conjugate is scatter-normal, lineage markers comparable to singlets. Symptom: "novel" DP population with an elevated shared marker (e.g. CD45). Fix: treat as suspected doublet; check the shared-marker signal; confirm/resolve by imaging flow (bright-field aspect ratio) when load-bearing.

CyTOF "doublet gate" using scatter

Trigger: porting flow logic to CyTOF. Mechanism: no FSC/SSC exists. Symptom: no scatter channels. Fix: use DNA + Gaussian/Event_length.

Quantitative Thresholds

ThresholdSourceRationale
expected doublet rate ~1-5% (PBMC), higher in tissuecommunityflag samples far above as prep issues - not a removal cutoff
Gaussian + DNA gating improves CV (3.45 -> ~2.04)Bagwell 2020 Cytometry A 97:184combined DNA + Gaussian over baseline (Gaussian alone ~2.41)

Note: a fixed "95th-percentile residual" cutoff is arbitrary; prefer a visual diagonal gate or the instrument's Gaussian parameters over an unjustified quantile.

Common Errors

Error / symptomCauseSolution
double-positive cluster that "shouldn't" existresidual heterotypic doubletscheck for an elevated shared marker (CD45); confirm by imaging flow
no FSC/SSC channels (CyTOF)mass data has no scatteruse DNA/Gaussian/Event_length
over-removal of large cellsrectangle gate clips real large singletsuse a diagonal polygon, not a box

References

  • Stadinski 2020 Cytometry A 97(11):1102-1104 — heterotypic doublets survive scatter gating.
  • Bagwell 2020 Cytometry A 97(2):184-198 — automated CyTOF cleanup via Gaussian/Event_length.
  • Finck 2013 Cytometry A 83(5):483-494 — CyTOF DNA/event parameters in normalization context.

Related Skills

Workflow order (CyTOF): EQ-bead drift normalization (raw, FIRST) -> cytometry-qc -> doublet-detection -> clustering -> CytoNorm cross-batch (LAST)

  • cytometry-qc - Run first: flow-rate/signal/margin cleaning
  • bead-normalization - CyTOF drift correction after doublet removal
  • fcs-handling - Load FCS files
  • gating-analysis - Where singlet discrimination sits in the hierarchy
  • clustering-phenotyping - Downstream analysis after doublet removal
  • single-cell/doublet-detection - Droplet scRNA-seq doublet methods (different principle)

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Testing patterns for PHPUnit and Playwright E2E tests. Use when writing tests, debugging test failures, setting up test coverage, or implementing test patterns for ActivityPub features.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

lilinji/GeneTind-Life-Skills162026년 8월 21일 업데이트

adaptyv

무료

How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

lilinji/GeneTind-Life-Skills162026년 8월 21일 업데이트

Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

lilinji/GeneTind-Life-Skills162026년 8월 21일 업데이트

Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that actually work for neurodivergent minds.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

lilinji/GeneTind-Life-Skills162026년 8월 21일 업데이트

aeon

무료

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

lilinji/GeneTind-Life-Skills162026년 8월 21일 업데이트

Unified analysis pipeline for affinity-based proteomics platforms — Olink (PEA, NPX) and SomaLogic SomaScan (SOMAmer, RFU). Platform-aware QC, normalisation, differential abundance, volcano plots, heatmaps, and PCA.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

lilinji/GeneTind-Life-Skills162026년 8월 21일 업데이트

lilinji의 스킬 모두 보기

이 스킬의 문제 신고