/bio-flow-cytometry-bead-normalization
Bead-based normalization for CyTOF and high-parameter flow cytometry. Covers EQ bead normalization, signal drift correction, and batch normalization. Use when correcting instrument drift in CyTOF or harmonizing data across batches.
Claude Code
$ npx -y skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-flow-cytometry-bead-normalization --agent claude-code
Codex
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-flow-cytometry-bead-normalization -a codex -y
Cursor
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-flow-cytometry-bead-normalization -a cursor -y
Gemini CLI
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-flow-cytometry-bead-normalization -a gemini-cli -y
GitHub Copilot
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-flow-cytometry-bead-normalization -a github-copilot -y
OpenCode
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-flow-cytometry-bead-normalization -a opencode -y
Windsurf
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-flow-cytometry-bead-normalization -a windsurf -y
SKILL.md
bio-flow-cytometry-bead-normalization.SKILL.mdname: bio-flow-cytometry-bead-normalization
description: Bead-based normalization for CyTOF and high-parameter flow cytometry. Covers EQ bead normalization, signal drift correction, and batch normalization. Use when correcting instrument drift in CyTOF or harmonizing data across batches.
tool_type: r
primary_tool: CATALYST
Version Compatibility
Reference examples tested with: flowCore 2.14+, 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 ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Bead Normalization
**"Normalize my CyTOF data using beads"** → Correct instrument signal drift over acquisition time using EQ calibration bead intensities for consistent measurements across runs.
- R: `CATALYST::normCytof()` for EQ bead normalization
CyTOF EQ Bead Normalization
**Goal:** Identify EQ normalization bead events in CyTOF data for signal calibration.
**Approach:** Score events by mean scaled intensity in known bead channels (Ce140, Eu151, Eu153, Ho165, Lu175) and threshold at the 99th percentile.
library(CATALYST)
library(flowCore)
# CyTOF data typically includes EQ normalization beads
# Fluidigm provides normalizer software, but can also do in R
# Load FCS with beads
ff <- read.FCS('cytof_with_beads.fcs')
# EQ beads contain known amounts of: Ce140, Eu151, Eu153, Ho165, Lu175
bead_channels <- c('Ce140Di', 'Eu151Di', 'Eu153Di', 'Ho165Di', 'Lu175Di')
# Identify bead events (high signal in bead channels)
bead_data <- exprs(ff)[, bead_channels]
bead_scores <- rowMeans(scale(bead_data))
# Beads typically have very high intensity
bead_threshold <- quantile(bead_scores, 0.99)
is_bead <- bead_scores > bead_threshold
cat('Identified', sum(is_bead), 'bead events (', round(mean(is_bead) * 100, 2), '%)\n')Calculate Normalization Factors
**Goal:** Compute per-channel normalization factors by comparing sample bead intensities to a reference.
**Approach:** Calculate median bead intensity per channel, then divide reference values by sample values to obtain correction factors.
# For each acquisition, calculate median bead intensity
# Compare to reference to get normalization factor
calculate_norm_factors <- function(ff, bead_channels, bead_idx) {
bead_intensities <- exprs(ff)[bead_idx, bead_channels]
# Median intensity per channel
medians <- apply(bead_intensities, 2, median)
return(medians)
}
# Reference values (from first file or known standards)
reference_beads <- c(Ce140 = 500, Eu151 = 600, Eu153 = 550, Ho165 = 450, Lu175 = 400)
# Calculate factors
sample_beads <- calculate_norm_factors(ff, bead_channels, is_bead)
norm_factors <- reference_beads / sample_beads
cat('Normalization factors:\n')
print(round(norm_factors, 3))Apply Normalization
**Goal:** Correct marker intensities using bead-derived normalization factors and remove bead events.
**Approach:** Multiply marker channels by the geometric mean of bead factors, then filter out bead events from the flowFrame.
# Apply normalization to all marker channels (not scatter)
marker_channels <- setdiff(colnames(ff), c('Time', 'Event_length', bead_channels))
normalize_cytof <- function(ff, norm_factors, channels) {
# Get expression matrix
expr <- exprs(ff)
# Apply geometric mean of bead factors to all channels
global_factor <- exp(mean(log(norm_factors)))
# Or apply per-channel if you have channel-specific factors
expr[, channels] <- expr[, channels] * global_factor
exprs(ff) <- expr
return(ff)
}
ff_normalized <- normalize_cytof(ff, norm_factors, marker_channels)
# Remove bead events
ff_clean <- ff_normalized[!is_bead, ]
cat('Final cell count:', nrow(ff_clean), '\n')Time-Based Drift Correction
**Goal:** Remove signal drift that accumulates during long CyTOF acquisitions.
**Approach:** Bin bead events by acquisition time, fit LOESS to per-bin median intensities, and scale all events to a reference level.
# Correct for signal drift over acquisition time
correct_drift <- function(ff, time_channel = 'Time') {
expr <- exprs(ff)
time <- expr[, time_channel]
# Bin by time
n_bins <- 20
time_bins <- cut(time, breaks = n_bins, labels = FALSE)
# For each marker, fit LOESS to bead signal over time
corrected <- expr
marker_cols <- setdiff(colnames(expr), c(time_channel, 'Event_length'))
for (marker in marker_cols) {
bin_medians <- tapply(expr[is_bead, marker], time_bins[is_bead], median)
if (length(unique(time_bins[is_bead])) > 3) {
# Fit smooth curve to drift
drift_data <- data.frame(
time = as.numeric(names(bin_medians)),
intensity = as.numeric(bin_medians)
)
loess_fit <- loess(intensity ~ time, data = drift_data, span = 0.5)
# Predict correction factor for all events
correction <- predict(loess_fit, newdata = data.frame(time = time_bins))
reference <- median(drift_data$intensity)
corrected[, marker] <- expr[, marker] * (reference / correction)
}
}
exprs(ff) <- corrected
return(ff)
}
ff_drift_corrected <- correct_drift(ff)Batch Normalization with CytoNorm
**Goal:** Harmonize marker distributions across batches using shared reference samples.
**Approach:** Train spline-based CytoNorm models on reference samples run in all batches, then apply the learned transformations to normalize new samples.
# CytoNorm for cross-batch normalization using reference samples
library(CytoNorm)
# Requires: training samples run on all batches (e.g., same PBMC reference)
# Creates spline-based transformation
# Prepare training data
train_files <- list.files('batch1_reference/', pattern = '\\.fcs$'Read more
name: bio-flow-cytometry-bead-normalization description: Bead-based normalization for CyTOF and high-parameter flow cytometry. Covers EQ bead normalization, signal drift correction, and batch normalization. Use when correcting instrument drift in CyTOF or harmonizing data across batches. tool_type: r primary_tool: CATALYST
Version Compatibility
Reference examples tested with: flowCore 2.14+, 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 ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Bead Normalization
**"Normalize my CyTOF data using beads"** → Correct instrument signal drift over acquisition time using EQ calibration bead intensities for consistent measurements across runs.
- R: `CATALYST::normCytof()` for EQ bead normalization
CyTOF EQ Bead Normalization
**Goal:** Identify EQ normalization bead events in CyTOF data for signal calibration.
**Approach:** Score events by mean scaled intensity in known bead channels (Ce140, Eu151, Eu153, Ho165, Lu175) and threshold at the 99th percentile.
library(CATALYST)
library(flowCore)
# CyTOF data typically includes EQ normalization beads
# Fluidigm provides normalizer software, but can also do in R
# Load FCS with beads
ff <- read.FCS('cytof_with_beads.fcs')
# EQ beads contain known amounts of: Ce140, Eu151, Eu153, Ho165, Lu175
bead_channels <- c('Ce140Di', 'Eu151Di', 'Eu153Di', 'Ho165Di', 'Lu175Di')
# Identify bead events (high signal in bead channels)
bead_data <- exprs(ff)[, bead_channels]
bead_scores <- rowMeans(scale(bead_data))
# Beads typically have very high intensity
bead_threshold <- quantile(bead_scores, 0.99)
is_bead <- bead_scores > bead_threshold
cat('Identified', sum(is_bead), 'bead events (', round(mean(is_bead) * 100, 2), '%)\n')Calculate Normalization Factors
**Goal:** Compute per-channel normalization factors by comparing sample bead intensities to a reference.
**Approach:** Calculate median bead intensity per channel, then divide reference values by sample values to obtain correction factors.
# For each acquisition, calculate median bead intensity
# Compare to reference to get normalization factor
calculate_norm_factors <- function(ff, bead_channels, bead_idx) {
bead_intensities <- exprs(ff)[bead_idx, bead_channels]
# Median intensity per channel
medians <- apply(bead_intensities, 2, median)
return(medians)
}
# Reference values (from first file or known standards)
reference_beads <- c(Ce140 = 500, Eu151 = 600, Eu153 = 550, Ho165 = 450, Lu175 = 400)
# Calculate factors
sample_beads <- calculate_norm_factors(ff, bead_channels, is_bead)
norm_factors <- reference_beads / sample_beads
cat('Normalization factors:\n')
print(round(norm_factors, 3))Apply Normalization
**Goal:** Correct marker intensities using bead-derived normalization factors and remove bead events.
**Approach:** Multiply marker channels by the geometric mean of bead factors, then filter out bead events from the flowFrame.
# Apply normalization to all marker channels (not scatter)
marker_channels <- setdiff(colnames(ff), c('Time', 'Event_length', bead_channels))
normalize_cytof <- function(ff, norm_factors, channels) {
# Get expression matrix
expr <- exprs(ff)
# Apply geometric mean of bead factors to all channels
global_factor <- exp(mean(log(norm_factors)))
# Or apply per-channel if you have channel-specific factors
expr[, channels] <- expr[, channels] * global_factor
exprs(ff) <- expr
return(ff)
}
ff_normalized <- normalize_cytof(ff, norm_factors, marker_channels)
# Remove bead events
ff_clean <- ff_normalized[!is_bead, ]
cat('Final cell count:', nrow(ff_clean), '\n')Time-Based Drift Correction
**Goal:** Remove signal drift that accumulates during long CyTOF acquisitions.
**Approach:** Bin bead events by acquisition time, fit LOESS to per-bin median intensities, and scale all events to a reference level.
# Correct for signal drift over acquisition time
correct_drift <- function(ff, time_channel = 'Time') {
expr <- exprs(ff)
time <- expr[, time_channel]
# Bin by time
n_bins <- 20
time_bins <- cut(time, breaks = n_bins, labels = FALSE)
# For each marker, fit LOESS to bead signal over time
corrected <- expr
marker_cols <- setdiff(colnames(expr), c(time_channel, 'Event_length'))
for (marker in marker_cols) {
bin_medians <- tapply(expr[is_bead, marker], time_bins[is_bead], median)
if (length(unique(time_bins[is_bead])) > 3) {
# Fit smooth curve to drift
drift_data <- data.frame(
time = as.numeric(names(bin_medians)),
intensity = as.numeric(bin_medians)
)
loess_fit <- loess(intensity ~ time, data = drift_data, span = 0.5)
# Predict correction factor for all events
correction <- predict(loess_fit, newdata = data.frame(time = time_bins))
reference <- median(drift_data$intensity)
corrected[, marker] <- expr[, marker] * (reference / correction)
}
}
exprs(ff) <- corrected
return(ff)
}
ff_drift_corrected <- correct_drift(ff)Batch Normalization with CytoNorm
**Goal:** Harmonize marker distributions across batches using shared reference samples.
**Approach:** Train spline-based CytoNorm models on reference samples run in all batches, then apply the learned transformations to normalize new samples.
# CytoNorm for cross-batch normalization using reference samples
library(CytoNorm)
# Requires: training samples run on all batches (e.g., same PBMC reference)
# Creates spline-based transformation
# Prepare training data
train_files <- list.files('batch1_reference/', pattern = '\\.fcs$'Other skills on openclaw-medical-skills.
adaptyv
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental…
adhd-daily-planner
Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time…
aeon
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting,…
agent-browser
Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data,…
More skills from other plugins.
paddleocr-doc-parsing
Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…
13c-metabolic-flux
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…
Questions about bio-flow-cytometry-bead-normalization.
- Which coding agents can use bio-flow-cytometry-bead-normalization?
- bio-flow-cytometry-bead-normalization installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

