bio-experimental-design-batch-design — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited bio-experimental-design-batch-design (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Reference examples tested with: limma 3.58+
Before using code patterns, verify installed versions match. If versions differ:
packageVersion('<pkg>') then ?function_name to verify parametersIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Design experiment to avoid batch effects" → Plan sample-to-batch assignments that confound biology with technical variation, and apply correction methods post-hoc.
sva::ComBat(), limma::removeBatchEffect()scanpy.pp.combat() for single-cell dataBatch effects are unavoidable. Good design makes them correctable.
# BAD: Confounded design
# Batch 1: All treated samples
# Batch 2: All control samples
# -> Cannot separate batch from treatment
# GOOD: Balanced design
# Batch 1: 3 treated, 3 control
# Batch 2: 3 treated, 3 control
# -> Batch effect can be estimated and removedlibrary(designit)
# Create balanced assignment
samples <- data.frame(
sample_id = paste0('S', 1:24),
condition = rep(c('ctrl', 'treat'), each = 12),
sex = rep(c('M', 'F'), 12)
)
# Optimize batch assignment
batch_design <- osat(samples, batch_size = 8,
balance_cols = c('condition', 'sex'))Goal: Identify hidden batch effects in expression data by estimating surrogate variables that capture unmodeled technical variation.
Approach: Fit a model matrix for the biological variable, estimate the number of surrogate variables using num.sv, then compute surrogate variables with sva for inclusion in downstream differential analysis.
library(sva)
# From count matrix
mod <- model.matrix(~condition, colData)
mod0 <- model.matrix(~1, colData)
# Estimate number of surrogate variables (hidden batches)
n_sv <- num.sv(counts_normalized, mod)
# Estimate surrogate variables
svobj <- sva(counts_normalized, mod, mod0, n.sv = n_sv)| Method | When to Use |
|---|---|
| ComBat | Known batches, moderate effects |
| SVA | Unknown batches, exploratory |
| RUVseq | Using control genes |
| limma::removeBatchEffect | Visualization only |
Always record:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.