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

bio-flow-cytometry-cytometry-qc

Quality control for flow, spectral, and mass cytometry - time-based anomaly cleaning (flowAI, flowCut, PeacoQC, flowClean), margin/boundary event removal, signal-drift detection, dead-cell exclusion, CyTOF Gaussian/DNA/event-length checks, instrument calibration/standardization (MESF, CS&T, peak-2), and batch-level outlier flagging. Use when assessing acquisition quality, choosing a cleaning tool, ordering QC relative to compensation, deciding margin removal before density-based steps, or flagging problematic samples before clustering or differential analysis.

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

설치 방법 보기

포함된 파일(3)

  • SKILL.md9.9 KB
  • examples/run_qc.R6.2 KB
  • usage-guide.md3.5 KB

SKILL.md(원문)

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

Version Compatibility

Reference examples tested with: flowAI 1.32+, PeacoQC 1.12+, flowCore 2.14+, flowDensity 1.36+, CATALYST 1.26+.

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

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

Counterintuitive defaults to confirm: flowAI checks are FR/FS/FM (FM = dynamic range, not "flow"); PeacoQC MAD/IT_limit are LESS strict when HIGHER. Verify with ?flow_auto_qc and ?PeacoQC before tuning.

Cytometry QC

"Run quality control on my cytometry data" -> Detect and remove acquisition artifacts (flow-rate instability, signal drift, margin events, dead cells, CyTOF doublets) on the Time axis, then flag outlier samples.

  • R (flow/spectral): flowAI::flow_auto_qc(), PeacoQC::PeacoQC() (+ RemoveMargins())
  • R (mass): CATALYST::normCytof() beads + Gaussian/DNA/event-length gating

The Single Most Important Modern Insight -- The Time Parameter Is the Master QC Axis, and Order Matters

Nearly every acquisition artifact - clogs, bubbles, flow-rate surges, electronics warm-up, CyTOF sensitivity decay, oxide buildup - manifests as a CHANGE IN SIGNAL versus the Time channel. flowAI, flowCut, flowClean, and PeacoQC are all, at heart, Time-vs-signal anomaly detectors; a missing or mis-scaled $TIMESTEP silently degrades or breaks all of them. Just as important is the ORDER: compensation/unmixing -> transform -> margin removal -> time-based QC -> debris/doublet/dead-cell gating -> batch normalization. Margin (boundary) events piled at a detector min/max form spurious high-density ridges that fool density-based cleaning and density gates, so they must be stripped BEFORE any density step; and time-based QC on untransformed data misbehaves because the density structure the algorithms rely on lives on the transformed scale.

Cleaning-Tool Taxonomy

ToolCitationMechanismWhen to use / caveat
flowAIMonaco 2016 Bioinformatics 32:24733 checks: flow rate (FR), signal acquisition (FS), dynamic range (FM)classic; known AGGRESSIVE - can remove normal data
PeacoQCEmmaneel 2022 Cytometry A 101:325per-channel density peaks + MAD + isolation treeonly tool validated across flow + mass + spectral; QC engine of CytoPipeline
flowCutMeskas 2023 Cytometry A 103:71segments Time, removes low-density/deviant segmentsless aggressive than flowAI; flags whole files
flowCleanFletez-Brant 2016 Cytometry A 89:461tracks subset frequency in centered-log-ratio spacefloor ~30,000 events; writes a "GoodVsBad" parameter to gate on

Run flowAI (with the correct API)

Goal: Auto-clean a sample for flow-rate, signal-acquisition, and dynamic-range anomalies.

Approach: flow_auto_qc() returns a flowFrame of high-quality events when output=1; FM is the dynamic-range check; supply timeCh for concatenated/clock-reset files. flowAI is the time-based QC step - run it after compensation/transform/margin removal (per the ordering above), not on a raw uncompensated frame.

library(flowAI)

ff_clean <- flow_auto_qc(ff,
                         remove_from = 'all',          # FR + FS + FM
                         output = 1,                    # 1 = HQ events only; 2 = add QC param; 3 = bad-event IDs
                         ChExcludeFS = c('FSC', 'SSC'), # scatter excluded from the signal check
                         second_fractionFR = 0.1,
                         folder_results = 'qc_output')
cat('kept', nrow(ff_clean), 'of', nrow(ff), 'events\n')

Margins First, Then PeacoQC

Goal: Remove boundary events, then clean unstable time/peak structure across all channels.

Approach: RemoveMargins() strips detector-min/max events; then PeacoQC() - remember higher MAD/IT_limit = LESS strict.

library(PeacoQC)

ff_nm <- RemoveMargins(ff, channels = c('FSC-A', 'SSC-A'))   # do this BEFORE density QC
res <- PeacoQC(ff_nm, channels = marker_channels,
               MAD = 6, IT_limit = 0.55,                     # defaults; higher = less strict (counterintuitive)
               save_fcs = FALSE, plot = TRUE)
ff_clean <- res$FinalFF

Dead-Cell, Drift, and CyTOF Checks

Goal: Exclude dead cells, detect per-channel drift, and apply CyTOF-specific gates.

Approach: Viability dye threshold (bimodal); per-time-bin median slope for drift; for CyTOF use DNA intercalator + Gaussian/event-length; EQ-bead-median-vs-Time is the primary CyTOF drift readout (see bead-normalization).

expr <- exprs(ff)
# dead cells take up more viability dye -> cut at the bimodal density VALLEY (data-driven), not a fixed quantile
dead_cut <- flowDensity::deGate(ff, channel = 'Live_Dead')
live <- expr[, 'Live_Dead'] < dead_cut

# CyTOF single-cell gates
if ('Event_length' %in% colnames(expr)) {
    keep <- expr[, 'Event_length'] >= 10 & expr[, 'Event_length'] <= 75   # confirm range per instrument
}
dna <- grep('Ir191|Ir193', colnames(expr), value = TRUE)             # intercalator-positive = nucleated

Calibration and Standardization (cross-study comparability)

A discovery analyst often skips this, but cross-experiment/cross-site MFI comparison is meaningless without it (Maecker & Trotter 2006 Cytometry A 69:1037):

  • MESF / MEF / ERF beads express intensity in molecules-of-equivalent-fluorochrome - comparable across instruments and time (NIST/ISAC standard; PE/Pacific Blue use ERF surrogates).
  • Quantibrite PE (defined PE molecules/bead, ~1:1 conjugation) converts MFI to antibodies-bound-per-cell / receptor density (bead values are LOT-dependent).
  • CS&T / 8-peak rainbow beads for daily QC (laser delay, area scaling, linearity).
  • Peak-2 / voltration: run a dim particle across PMT voltages, pick the CV-vs-voltage inflection = minimum voltage for optimal resolution. This is why MIFlowCyt mandates reporting voltages.

Batch-Level Outlier Flagging

Goal: Flag samples whose event count, flow stability, or marker medians deviate from the batch.

Approach: Per-file metrics + MAD-based bounds; track an anchor/reference sample if present.

qc <- do.call(rbind, lapply(fcs_files, function(f) {
  ff <- read.FCS(f); e <- exprs(ff)
  data.frame(file = basename(f), events = nrow(ff),
             med_signal = median(apply(e, 2, median)))
}))
qc$outlier <- abs(qc$events - median(qc$events)) > 3 * mad(qc$events)

Per-Method Failure Modes

Density QC on un-margin-removed data

Trigger: PeacoQC/flowClean before RemoveMargins. Mechanism: axis pile-ups are false high-density ridges. Symptom: real events removed near the boundary, or margins kept. Fix: remove margins first.

flowAI over-removal

Trigger: default flowAI on a low-rate or short acquisition. Mechanism: FR check flags normal slow segments. Symptom: large unexplained event loss. Fix: raise second_fractionFR; inspect the HTML report; consider flowCut/PeacoQC.

QC on untransformed/uncompensated data

Trigger: running QC on raw linear values. Mechanism: high-intensity tail dominates density. Symptom: misplaced anomaly calls. Fix: compensate + transform first.

Time axis missing/reset

Trigger: concatenated files, some sorters. Mechanism: no usable Time. Symptom: flow-rate check fails or is meaningless. Fix: timeCh= or reconstruct; otherwise skip time-based checks.

Quantitative Thresholds

ThresholdSourceRationale
flowClean floor ~30,000 eventsFletez-Brant 2016 Cytometry A 89:461below this the CLR frequency tracking under-detects
PeacoQC MAD=6, IT_limit=0.55Emmaneel 2022 Cytometry A 101:325defaults; HIGHER = less strict
dead cells > ~10-30%communitysample-handling flag, not a hard cutoff - report, don't auto-exclude the sample
CyTOF retune ~ daily / per long runinstrument practice (flagged)sensitivity decays from cone fouling/plasma drift

Common Errors

Error / symptomCauseSolution
flow_auto_qc returns unexpected objectassuming $fcs/report listoutput=1 returns a flowFrame; set output explicitly
margins not removed by PeacoQCexpecting it built-incall RemoveMargins() separately, first
tuning MAD up removes moresign confusionhigher MAD/IT_limit = LESS strict
flowClean output unchangedit appends a parametergate on the "GoodVsBad" column

References

  • Monaco 2016 Bioinformatics 32(16):2473-2480 — flowAI.
  • Emmaneel 2022 Cytometry A 101(4):325-338 — PeacoQC.
  • Meskas 2023 Cytometry A 103(1):71-81 — flowCut.
  • Fletez-Brant 2016 Cytometry A 89(5):461-471 — flowClean.
  • Fienberg 2012 Cytometry A 81(6):467-475 — cisplatin viability reagent (CyTOF live/dead).
  • Maecker & Trotter 2006 Cytometry A 69(9):1037-1042 — controls, instrument setup, peak-2.
  • Lee 2008 Cytometry A 73(10):926-930 — MIFlowCyt reporting (voltages, clones, config).

Related Skills

  • compensation-transformation - Compensate/transform before time-based QC
  • doublet-detection - Singlet discrimination after QC
  • bead-normalization - EQ-bead drift correction for CyTOF (QC's normalization arm)
  • clustering-phenotyping - Cluster only QC-passed events
  • experimental-design/batch-design - Anchor/reference-sample design for batch QC

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

Predicts ADMET properties using ADMETlab 3.0 (119 platform features, including 77 prediction models with modeled-endpoint uncertainty), ADMET-AI, DeepChem MolNet, and chemprop D-MPNN with explicit handling of OECD QSAR principles, applicability domain assessment, calibration, hERG/CYP/AMES endpoints, and PAINS / Lipinski / Ro5 / Veber / BBB druglikeness filters. Use when filtering compounds for drug-likeness, prioritizing leads by predicted safety, or building an in-house ADMET QSAR model.

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

GPTomics/bioSkills1.2천2026년 8월 15일 업데이트

Trim PCR primers from aligned reads in amplicon-panel BAMs using samtools ampliconclip. Use when processing SARS-CoV-2 ARTIC, hereditary cancer panels, ctDNA hot-spot panels, or any amplicon assay where primer-derived bases would falsely confirm reference at primer footprints.

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

GPTomics/bioSkills1.2천2026년 8월 15일 업데이트

Filter alignments by flags, mapping quality, and regions using samtools view and pysam. Use when extracting specific reads, removing low-quality alignments, or subsetting to target regions.

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

GPTomics/bioSkills1.2천2026년 8월 15일 업데이트

Create and use BAI/CSI indices for BAM/CRAM files using samtools and pysam. Use when enabling random access to alignment files or fetching specific genomic regions.

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

GPTomics/bioSkills1.2천2026년 8월 15일 업데이트

Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO. Supports Clustal, PHYLIP, Stockholm, FASTA, Nexus, and other alignment formats for phylogenetics and conservation analysis. Use when reading, writing, or converting alignment file formats.

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

GPTomics/bioSkills1.2천2026년 8월 15일 업데이트

Parse and analyze multiple sequence alignments using Biopython. Extract sequences, identify conserved regions, analyze gaps, work with annotations, and manipulate alignment data for downstream analysis. Use when parsing or manipulating multiple sequence alignments.

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

GPTomics/bioSkills1.2천2026년 8월 15일 업데이트

GPTomics의 스킬 모두 보기

이 스킬의 문제 신고