Before ΔCq: Building a Synthetic qPCR Dataset That Can Fail Honestly
Most qPCR tutorials begin with a tidy spreadsheet: one row per sample, one expression value per target, and no explanation of how that number was produced.
That is convenient, but it hides the part of the analysis where many important decisions are made.
What happened when two technical replicates disagreed? Was a missing value truly absent, or did the assay fail? Were the study groups spread across laboratory batches, or was one group processed later than the other? Was the reference RNA stable enough to normalize anything?
This series starts one step earlier. We will build a synthetic qPCR dataset at the measurement level and carry every quality-control decision forward. The aim is not to manufacture a dramatic biomarker result. It is to see how measurement quality and normalization choices can change the result we think we have found.
> This tutorial uses independently generated synthetic data and a methodology-focused study design. It does not reproduce participant-level data, numerical results, tables, or figures from any external study.
The question for this series
The main question is simple:
How much can reference choice, technical variation, and batch effects alter an apparent miRNA group difference?
To answer it, the synthetic experiment contains:
– 96 biological samples;
– two equally sized study groups;
– three balanced laboratory batches;
– three candidate miRNA assays;
– two possible reference RNA assays;
– two technical replicates for every sample–assay combination.
The group names are intentionally generic: **reference group** and **inflammatory condition**. Candidate targets are called **candidate-miR-A**, **candidate-miR-B**, and **candidate-miR-C**. These labels keep the project focused on the analysis rather than making a biological claim about a named disease or molecule.

Biological samples and technical replicates are not the same thing
A technical replicate is a repeated measurement of the same biological material. It can help us detect imprecise measurement, but it does not create another independent sample.
This distinction matters for both the data structure and the statistics. Our study has 96 biological samples—not 960 independent observations. The larger number appears because each sample is measured for five assays, twice:
96 samples × 5 assays × 2 replicates = 960 planned qPCR measurements
Treating those 960 rows as independent observations would artificially inflate the sample size. Instead, the replicate-level table is used for quality control. Once the replicate decision is made, eligible measurements are summarized to the biological-sample level for downstream analysis.
This separation also follows the broader logic of the [MIQE guidelines](https://pubmed.ncbi.nlm.nih.gov/19246619/), which emphasize transparent experimental design, assay information, quality control, analysis, and reporting. The more recent [MIQE 2.0 revision](https://pubmed.ncbi.nlm.nih.gov/40272429/) expands that reproducibility framework.
Balance the batches before testing the biology
Batch effects are differences introduced by when or how samples are processed. A small shift in extraction, reagents, calibration, or plate conditions can move Cq values even when the underlying biology has not changed.
The dangerous situation is confounding. Imagine that most reference samples were processed in Batch 1 and most inflammatory samples in Batch 3. A batch difference could then look like a group difference, and the dataset alone might not be able to separate the two.
Our simulation avoids that trap by design. Each of the three batches contains:
– 16 reference-group samples;
– 16 inflammatory-condition samples.
The batches still have small Cq shifts, because perfectly identical batches would not make a useful teaching example. The important point is that those shifts are distributed evenly across the two groups.
Why two possible reference RNAs?
Normalization is often presented as a mechanical calculation:
ΔCq = target Cq − reference Cq
But the calculation is only as trustworthy as the reference measurement. If the reference itself changes by study group or batch, every normalized target can inherit that change.
The synthetic dataset therefore includes two reference RNAs with different behavior:
– ref-RNA-1 has a modest group-related drift;
– ref-RNA-2 is stable across groups, apart from ordinary measurement variation.
This is not revealed so that we can automatically discard the first reference. It creates a known benchmark. In later posts, we can test whether our diagnostic plots and sensitivity analyses correctly identify the problem.
Build the raw table before the analysis table
The first saved dataset is long rather than wide. Every row corresponds to one qPCR measurement.

This structure preserves information that would disappear if we immediately averaged the replicates. We can see which replicate is missing, calculate the disagreement between a pair, and trace a flagged mean back to its two original measurements.
The analysis-ready table is created only after those checks. It contains one eligible mean Cq value per biological sample and assay.
## Add imperfections on purpose
A synthetic dataset that never fails a quality check is easy to analyze but not very instructive.
This simulation therefore includes two kinds of measurement problem:
1. **Non-detect measurements:** nine candidate-miR-C measurements are missing.
2. **Discordant replicate pairs:** twelve pairs differ by more than 0.75 cycles.
These problems are generated reproducibly with a fixed random seed. They are not hidden, silently replaced, or deleted before inspection.
The quality-control rule is declared before looking at normalized results:
– a pair passes when both measurements are available and their absolute difference is no greater than 0.75 cycles;
– a pair is flagged as discordant when both are available but differ by more than 0.75 cycles;
– a pair is flagged as single-detected when only one replicate is observed.
The threshold is a teaching choice for this simulated assay, not a universal laboratory rule. A real study should justify its threshold using assay validation, laboratory procedures, and the expected precision of the platform.
What the first validation found
The dataset contains 480 sample–assay pairs. After the predefined checks:
– 459 pairs pass;
– 12 pairs are discordant;
– 9 pairs have only one detected replicate.
All eight structural integrity checks pass. Sample identifiers are unique, group and batch counts match the design, every sample has five planned assay pairs, observed Cq values remain within the allowed range, and missing measurements occur only where the simulation intended them.

Passing these checks does not prove that an assay is biologically valid. It means the generated dataset is internally consistent with its stated design. That narrower claim is still valuable: we know that later differences are not caused by duplicate sample IDs, accidental group imbalance, impossible Cq values, or an unnoticed reshaping error.
## Why we are not calculating p values yet
At this stage, a p value would be premature.
We have not yet decided how to handle discordant pairs, assessed whether the reference RNAs are stable, or compared normalization strategies. Running a group test now would attach a precise-looking number to an unfinished measurement process.
The order of operations matters:
1. verify the study structure;
2. inspect technical replicate agreement;
3. evaluate reference stability;
4. define the normalization strategy;
5. estimate group effects with uncertainty;
6. test whether QC choices change the conclusion.
That sequence is the real subject of this series.
What comes next
The next post will examine technical replicate agreement. We will compare a familiar correlation plot with a difference plot and show why a high correlation can coexist with clinically or analytically important disagreement.
**Next:** *Technical Replicates in qPCR: Why Correlation Is Not Enough*

Leave a Reply