This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Week 12 — Nov 30: Chemometrics & Miscellaneous Methods, Final Paper Presentations

Week 11 used one instrument on one product; this week maps the rest of the field. Tidy data and tidymodels preprocessing, Kuhn and Johnson’s model panels and ensembles, designed experiments as the route from correlation to cause, chromatogram alignment and curve resolution, multivariate monitoring of a biologic batch, and high-dimensional flow cytometry for CAR-T, plus ICH M7 as the clearest case of a prediction accepted in place of an experiment. Final paper presentations run alongside.
**Clear your calendar for this session.** Final paper presentations run alongside the lecture, and the capstone problem is assigned here for the following weeks.

(Lecture 11.) Last week built the modeling vocabulary on one instrument and one product: NIR spectra on a small-molecule tablet line. That was deliberate depth. This week is breadth. The same discipline applies to tables of process data, to chromatograms, to a bioreactor’s 14-day trajectory and to millions of single cells in a CAR-T product. The six readings walk across that range, from a small-molecule tablet to a biologic to an advanced therapy.

The one idea

A predictive model is a hypothesis about data in exactly the way a method is a hypothesis about a molecule. It is fit on the evidence you have, valid only within its range, and tested by every new sample. Chemometrics is machine learning with a 40-year head start in regulated analytical science. Whatever the data look like, the questions are the same: what is one observation, what did the model learn, did it learn a cause or a coincidence, and where does it stop applying?

On teaching this honestly. Nobody in the department specialises in machine learning, and this session does not pretend otherwise. The goal is not to make you model builders. It is to make you competent clients and reviewers: able to say what a model must do, what data it needs, whether its output can be trusted, and where the regulations draw the line.

A map of the field

Chemometrics is easiest to navigate by the shape of the data and the question asked of it.

Data shapeExampleTypical questionWhere
A table: one row per batch, one column per variableProduct T’s material and process dataPredict an outcome; find what causes itReadings 1, 2, 3
A spectrum per sampleNIR of a granule or tabletIdentity; quantity; is it in the model’s domain?Week 11
A signal over time per sampleAn HPLC chromatogramAlign peaks so samples can be comparedReading 4
A matrix per sampleHPLC-DAD (time × wavelength)Resolve overlapping compoundsReading 4
A cube across samplesFluorescence EEMs (sample × excitation × emission)Resolve components uniquelyReading 4
A trajectory per batchBioreactor variables over 14 daysIs this batch travelling like good batches?Reading 5
A cell × marker matrix per sampleSpectral flow cytometry of a CAR-T lotWhich populations exist?Reading 6
An image with a spectrum per pixelHyperspectral imaging of a tabletWhere is each component?Not covered this term

What we cover this week

Six readings, each about 15 minutes. Readings 1–3 share one constructed tablet, Product T, so the preprocessing, the models and the experiment build on the same data. Code is in R, written to be read even if you have never written it.

#ReadingThe one idea
1Tidy Data and the Preprocessing RecipeHadley Wickham’s tidy-data rules decide what one observation is. A tidymodels recipe (zero and near-zero variance, correlation filter, imputation, transformation, scaling) is re-estimated inside every fold. SNV never looks at another sample; MSC does.
2Many Models, One QuestionKuhn and Johnson’s model panel: PLS, lasso, MARS, SVM, KNN, random forest, boosting and a neural network, on identical batch-grouped folds. Read the result as a distribution, choose the simplest model within one standard error, and weigh what an ensemble costs to keep validated.
3Correlation Is Not CausationThe model blamed moisture; the experiment found particle size and blend time. Sir Ronald Fisher’s randomization and factorial designs, and a fractional factorial that screens seven factors in 8 runs instead of 128. Aliasing is the price, and it is written down.
4From Raw Signal to Resolved SignalAlign drifting chromatograms (RRT, parametric time warping, COW, DTW) without warping away a new degradant. Then resolve co-elution with MCR-ALS and its rotational ambiguity, PARAFAC and its uniqueness, and spectral flow unmixing, which is the same equation.
5Watching a Biologic Batch GrowA mAb fed-batch as a cube of batches × variables × time. Raman soft sensors, batch-wise vs observation-wise unfolding, aligning unequal batches, why one golden batch is not enough, and a day-6 Q alarm that says “unusual”, not “bad”.
6Cells as DataA 25-colour CAR-T panel is a data matrix. Manual gating vs FlowSOM vs UMAP, a CAR+ CD3− population the release gates never examined, batch effects that look like biology, and one patient per lot.

How to use the readings

Presentations take much of the session, so the readings carry most of the content.

RoleReadingsWhy
Before class1, 2, 3The Product T arc: data, models, cause. Class assumes them.
Worked in classReading 3’s “the model blames moisture” case; reading 5’s day-6 alarm; reading 6’s CAR+ CD3− clusterThree judgment calls, one per modality, about 15 minutes each between presentations.
After class4, and the R snippets throughoutSignal processing is best read with a chromatogram in front of you.

(Instructor: adjust to the presentation schedule.)

Why R

Every snippet this week is R. Python is equally capable, and you will meet both at work. The case for R here is specific:

  • The modeling framework is R’s. Max Kuhn wrote caret and leads tidymodels; the recipe steps in reading 1 are tidymodels functions. Hadley Wickham’s tidyverse sets the conventions.
  • Statisticians tend to work in R. It was built for statistical analysis, and much statistical method development appears there first.
  • Cytometry analysis lives in R. flowCore, FlowSOM and CytoNorm are Bioconductor packages.
  • Chemometrics is well served. prospectr, mdatools, ptw and FrF2 cover readings 1–4.

The Python equivalents are scikit-learn (Pipeline, ColumnTransformer and VarianceThreshold play the role of a recipe) and pandas. The concepts transfer completely; the syntax does not matter much.

Worked case: where a prediction already replaces an experiment

ICH M7 (assessment of DNA-reactive impurities) is the clearest example of a computational prediction being formally accepted in lieu of data. For a new impurity, M7 allows a mutagenicity conclusion drawn from two complementary (Q)SAR systems, one expert-rule-based and one statistical, to substitute for an Ames test. If both predict non-mutagenic and there is no conflicting knowledge, no bacterial assay is run. The conditions are two orthogonal models (the same instinct as orthogonal analytical methods), a defined scope, documentation and versioning, and expert review on top.

The principle generalizes. Regulators’ emerging position on AI and models, including FDA’s 2025 draft guidance on AI to support regulatory decisions, is credibility proportionate to consequence: the evidence a model needs scales with how much it influences the decision and how serious a wrong decision would be. Predictive stability (ASAP) is on the same trajectory, with a formal home in the modernized Q1 annex. So is the dissolution IVIVC biowaiver, where an in-vitro model stands in for a clinical study. Language models are held to the same standard in Week 11 reading 8.

Where the analyst sits

The analyst states what a model must do in measurable terms and decides what one observation is. They own the quality of the training data and ask whether a predictor caused the outcome or merely travelled with it. They also decide, sample by sample, batch by batch and lot by lot, whether a result is inside the domain the model knows. None of that is machine-learning expertise. All of it is analytical judgment, the STEAM “M” and “A” at once, and it is why Week 1 said every scientist is now a data scientist. The refrain: science → evidence → reduced uncertainty → control → regulatory confidence → patient trust.

On the job

  • You are far more likely to be handed a fitted model and asked to defend a day’s predictions than to build one. Know how to read resampled RMSE, a T²/Q chart and a contribution plot before you know how to fit anything.
  • When someone shows you a variable-importance plot and proposes a process change, ask two questions: did that variable actually vary in the data, and what varied with it?
  • If your lab exports instrument data, ask what one row is. Most data-integrity and modeling problems start with that answer being unclear.
  • Learn to read R or Python well enough to follow a colleague’s analysis. You will be reviewing it.

For discussion

  • M7 accepts two (Q)SAR predictions in place of an Ames test, but not one. Why two, and why does that mirror how you use analytical methods?
  • A random forest and a fractional factorial disagree about which factor drives dissolution. Which do you believe, and what would change your mind?
  • Alignment (reading 4), batch synchronization (reading 5) and batch normalization (reading 6) all make samples comparable. What is the shared risk?
  • Rank by the evidence they need: a (Q)SAR call on an impurity; a Raman glucose model driving a feed pump; a FlowSOM cluster in a characterization panel; an NIR model releasing tablets.

The capstone

An applied problem, worked in teams over the following weeks: a comparability exercise after a manufacturing change; an out-of-specification investigation; a method transfer to a second site; or a specification-setting exercise for a new attribute. Deliverable: a short analytical control strategy and a defence of it, the argument a regulator would have to follow.

Final paper presentations

The paper is a critical analysis of an analytical method, technique, or problem of the student’s choosing, argued the way the course has argued all term: what question does this measurement answer, what decision does it support, how is the result defended, and where does it fail? Strong papers interrogate a real method, incident, or guideline rather than survey a topic. They name the failure modes and their detectability (Week 2), connect the technique to a regulatory expectation and a patient consequence, and say what would change the conclusion.

Format

(Instructor: fill in: capstone team size and deliverable format; presentation length and Q&A; whether the written paper is due before or after the talk; grading split across paper, presentation, and capstone; peer-review expectations. Confirm the pacing of six readings plus presentations in a single 3-hour slot, and consider whether presentations should spill into the make-up slot. Datasets for running the R snippets are still to be produced.)


Source note. Each reading carries its own sources. The modeling thread follows Kuhn and Johnson, Applied Predictive Modeling (2013), Kuhn and Silge, Tidy Modeling with R (2022), and Wickham, “Tidy Data” (2014). Experimental design follows Fisher (1935) and Box, Hunter and Hunter (2005). Signal processing, batch monitoring and cytometry cite the primary literature. The M7 case is anchored in ICH M7(R2) and the FDA draft guidance Considerations for the Use of Artificial Intelligence to Support Regulatory Decision-Making for Drug and Biological Products (2025). Product T, Batch 27 and Lot 0420 are constructed teaching cases. (Instructor: confirm current AI-guidance versions.)

1 - Tidy Data and the Preprocessing Recipe

Hadley Wickham’s tidy-data rules decide what one observation is before any model is fitted. A tidymodels recipe then removes zero- and near-zero-variance predictors, filters correlated ones, imputes, transforms and scales, and is re-estimated inside every resampling fold.
Overview graphic titled 'What Is One Observation?', subtitled 'For Product T, decide what one observation is, build a tidy table, and let every preprocessing step learn only from the training data.' Left, 'The case: Product T': a constructed immediate-release tablet; predict % dissolved at 30 minutes from material and process data. Top row, 'The data: four sources', four panels with photographs: Batch record (granule moisture, lubricant blend time, compression force, tablet press); Certificate of analysis (API particle size D50, API supplier, API lot); In-process test (tablet hardness, sometimes missing); Dissolution (six vessels per batch, % dissolved at 30 min). Bottom row, left to right: '60 batches × 6 vessels per batch = 360 vessel results'; an arrow to 'Group by batch: calculate the mean % dissolved at 30 min across the six vessels for each batch'; an arrow to 'Tidy modeling table: 60 rows (one per batch), one column per variable', with columns Batch, Moisture, Force, Hardness and Mean % dissolved. Right, 'Tidy data rules (Hadley Wickham)': 1, one variable per column; 2, one observation per row; 3, one observational unit per table. Footer: 'The takeaway: the intended prediction defines the observational unit.'
Product T's four data sources, and how 360 vessel results become a 60-row batch table because the prediction is made about batches. Constructed teaching case; photographs are illustrative.

The one idea

Decide what one observation is, then let every preprocessing step that learns from the data learn only from the training data.

Most modeling failures in regulated work start before the model is chosen. The table had the wrong rows, or a preprocessing step quietly looked at the test set. This reading treats both as part of the method. It also teaches you to read R, the language this week’s code is written in.

The case: Product T

Product T is a constructed immediate-release tablet. Development wants to predict % dissolved at 30 minutes from material and process data so that a slow batch can be anticipated before the dissolution test is run. The same dataset runs through the next two readings.

SourceWhat it records
Batch recordGranule moisture, lubricant blend time, compression force, tablet press
Certificate of analysisAPI particle size (D50), API supplier and lot, disintegrant lot
In-process testTablet hardness, sometimes missing
DissolutionSix vessels per batch, % dissolved at 30 min

Sixty batches; 360 vessel results.

Hadley Wickham and tidy data

Hadley Wickham, a New Zealand statistician who is now chief scientist at Posit (formerly RStudio), wrote the paper that gives this reading its name. Tidy Data (2014) set out three rules1:

  1. Each variable is a column.
  2. Each observation is a row.
  3. Each type of observational unit is its own table.

The rules sound clerical. They are not. Rule 3 forces the question that decides whether a model can be trusted: what is the unit you are making a prediction about?

Product T has two observational units. A vessel is one dissolution result. A batch is one set of process conditions and one release decision. Putting 360 vessel rows into a model with the batch’s process settings copied onto each row creates six near-identical rows per batch. Random cross-validation will then put vessel 1 of batch 17 in training and vessel 2 in testing, and the model will appear to predict batch 17 when it has, in effect, already seen it.

The classic version of this failure is spectroscopic. An NIR tablet-assay model with three spectra per tablet reported RMSECV 0.9% when random spectra were left out, and 2.1% when whole batches were. The spectrum was not the observational unit; the tablet, and above it the batch, was. Week 11, reading 2 made the same point with whole-batch cross-validation on granule moisture.

Wickham also built much of the toolkit for this: ggplot2 for graphics and dplyr for data manipulation, gathered with other packages as the tidyverse. Max Kuhn’s tidymodels packages, used below, follow the same conventions2,3.

Reading R in five minutes

The code on this site reads top to bottom as a sequence of verbs:

library(tidyverse)

batches <- vessels |>                      # start with the vessel table
  group_by(batch_id) |>                    # one group per batch
  summarise(diss_30 = mean(pct_30min)) |>  # batch mean of six vessels
  left_join(batch_record, by = "batch_id") # add the process settings
  • <- assigns a result to a name.
  • |> is the pipe: “take what’s on the left and pass it to the next function”. Read it aloud as then.
  • group_by(), summarise(), left_join() are verbs; each does one thing to a table and returns a table.
  • # starts a comment.

That is enough to follow every snippet this week. The output is a tidy batch table: 60 rows, one per batch, one column per variable.

A recipe is a written preprocessing plan

Kuhn and Johnson’s central argument is that preprocessing is part of the model, not housekeeping done beforehand4,5. tidymodels makes this concrete. A recipe lists the steps; it does not run them until it is estimated on a particular set of data:

library(tidymodels)

rec <- recipe(diss_30 ~ ., data = batches) |>
  update_role(batch_id, api_lot, new_role = "id") |>   # keep, but don't model
  step_impute_median(hardness) |>                      # fill missing hardness
  step_YeoJohnson(api_d50) |>                          # tame a skewed predictor
  step_dummy(all_nominal_predictors()) |>              # supplier, press -> 0/1
  step_zv(all_predictors()) |>                         # drop constant columns
  step_nzv(all_predictors()) |>                        # drop near-constant ones
  step_corr(all_numeric_predictors(), threshold = 0.9) |>
  step_normalize(all_numeric_predictors())             # centre and scale

Each step answers a question the data raise.

StepThe problem in Product TWhat it does
step_impute_medianHardness missing for 7 batchesFills with the training-set median, which is learned from the data
step_YeoJohnsonAPI D50 is right-skewed; a few coarse lots dominateEstimates a power transformation that makes the distribution more symmetric
step_dummySupplier and press are categoriesConverts each category to 0/1 indicator columns
step_zvA column is constant in this foldRemoves it; many models fail on a zero-variance column
step_nzvPress B made 2 of 60 batchesRemoves predictors dominated by one value
step_corrHardness and compression force correlate at r = 0.94Removes one of each highly correlated pair
step_normalizeForce is in kN, moisture in %Centres each predictor and scales it to unit variance
Graphic titled 'The Preprocessing Recipe', subtitled 'A written, repeatable set of data operations that prepares the training data for modeling and is re-estimated inside every resampling fold.' Left, Product T: predict % dissolved at 30 minutes, 60 batches, 6 vessels per batch, batch-level model, with a tidy data input table of one row per batch (Batch, Moisture, Force, Diss_30). Seven numbered panels: 1, Imputation: a missing hardness value (NA) filled with 48.2, 'e.g., use the training median for hardness'; 2, Transformation: a right-skewed histogram becoming symmetric, 'reduce skewness (e.g., log or Box–Cox)'; 3, Dummy encoding: tablet press A and B converted to 1/0 indicator columns; 4, Zero variance: a flat line, 'remove predictors with no variation'; 5, Near-zero variance: one tall bar and three tiny ones, 'e.g., a press used in only a few batches'; 6, Correlation filtering: a correlation heat map, 'keep one representative (e.g., compression force and press load)'; 7, Normalization: two offset distributions brought onto a common scale. Below, 'The recipe in modeling practice': split data (folds), estimate recipe (on training only), transform training data, fit model, transform held-out data, evaluate predictions. Bottom: 'Pharma perspective: the preprocessing recipe is part of the method, like column, mobile phase and detector settings in an analytical method.' 'Important caveat: statistical filtering cannot replace process knowledge. Removing a variable (e.g., Press B) because it was used in only two batches could eliminate a critical manufacturing signal.' Footer: 'Define the observational unit, then apply a repeatable preprocessing recipe within each fold.'
The seven recipe steps applied to Product T, in the same order as the code above, and where the recipe is estimated in each resampling fold. The figure shows log or Box–Cox as examples of a transformation; the code uses Yeo-Johnson, which also handles zero and negative values.

Near-zero variance, specifically

Kuhn’s rule flags a predictor when both are true: the most common value is far more frequent than the second most common (by default a ratio above 95/5), and few values are unique (by default under 10% of rows)4. “Press B” fails both: 58 zeros, 2 ones. It carries almost no information, and in a five-fold split there is a good chance a fold contains no Press B batches at all. At that point it is a zero-variance column inside the fold, which breaks some models and destabilises others.

Removing it is a modeling decision, not a scientific one. If the two Press B batches are the slow ones, you have lost a signal. Check what step_nzv removed, then decide with process knowledge.

Correlation filters and spectra

step_corr suits a table of process variables, where two columns measuring nearly the same thing make coefficients unstable. It is the wrong tool for a spectrum. Neighbouring NIR wavelengths correlate above 0.99, so a correlation filter would discard most of the spectrum. For spectra, the answer to collinearity is to model it with latent variables (step_pca, or a PLS model), as Week 11 reading 3 showed.

Spectral preprocessing: what learns, and what doesn’t

MethodRemovesLearns from other samples?
SNV (standard normal variate)Multiplicative scatter and offset, spectrum by spectrumNo: each spectrum is centred and scaled by its own mean and SD
Savitzky–Golay smoothing and derivativesNoise; baseline offset (1st derivative) and slope (2nd)No: a fixed local polynomial filter
MSC (multiplicative scatter correction)Scatter, relative to a reference spectrumYes: the reference is usually the training-set mean
Mean-centring, autoscaling, PCAOffsets; magnitude differences; collinearityYes

That last column is the one that matters for honest validation. SNV and Savitzky–Golay can be applied once, before splitting, because they never look at another sample. Anything that learns a mean, a median, a reference spectrum, a set of removed columns or a set of components has to be learned inside each fold, from that fold’s training data only. The R package prospectr provides SNV and Savitzky–Golay6; derivatives amplify noise, so the window width is itself a tuning choice.

Graphic titled 'Preprocessing Pharmaceutical Spectra', subtitled 'Prepare spectroscopic data so the model sees chemical differences, not artifacts from the instrument or sample.' Left, the case: Product T, NIR spectra of tablets, predict % dissolved at 30 minutes. Five panels, each with a before-and-after sketch: SNV (standard normal variate), three offset spectra collapsing onto one, 'corrects for scatter and pathlength differences within each spectrum (center and scale each spectrum individually)'; Savitzky–Golay (smoothing / derivative), a noisy trace becoming smooth, 'reduces high-frequency noise and can calculate derivatives to better resolve overlapping features'; MSC (multiplicative scatter correction), offset spectra collapsing onto one, 'corrects additive and multiplicative scatter using a reference spectrum from the training data'; Autoscaling (center and scale), two distributions centred on a common scale, 'centers each variable (mean = 0) and scales to unit variance (SD = 1) so all wavelengths contribute on a comparable scale'; PCA, stacked spectra becoming a score plot with three clusters, 'reduces many correlated wavelengths to a few latent variables.' A workflow strip, 'a preprocessing workflow for spectra (training data only)': raw spectra, SNV / MSC, smoothing (Savitzky–Golay), autoscale, PCA (latent variables), model (e.g., dissolution). A table, 'What each step addresses', with a column 'Learns across samples?': SNV, scatter and pathlength differences, no; Savitzky–Golay, noise reduction and derivatives, no (with fixed settings); MSC, additive and multiplicative scatter, yes; autoscaling, different variable scales, yes; PCA, reduce redundancy and extract signal, yes. Key takeaways: use physics-informed steps that reflect the source of variation; estimate any data-driven step (MSC reference, scaling, PCA) using only the training data; apply the same steps to new data. Pharma context: treat preprocessing as part of the analytical method (e.g., per ICH Q14); lock the recipe and document the settings and rationale. Footer: 'Use a consistent, justified preprocessing recipe to turn raw spectra into reliable inputs for modeling.'
The common spectral preprocessing steps, and which of them learn from other samples and must therefore be estimated inside each fold.

SNV and MSC: the same problem, two different references

SNV and MSC are easy to confuse, because they fix the same physical problem. In diffuse-reflectance NIR, particle size, tablet surface roughness, packing density and the effective optical path length all change how light scatters. Scatter shifts a spectrum up or down (an additive effect) and stretches or shrinks it (a multiplicative effect) without any change in chemistry. Both methods try to remove that physical variation and leave the chemical variation behind.

The difference is where each method gets its correction:

  • SNV corrects a spectrum using information from itself. Each spectrum x is centred on its own mean and divided by its own standard deviation:

    xSNV=x−xˉsx x_{\text{SNV}} = \frac{x - \bar{x}}{s_x}

    Nothing from any other sample is used7.

  • MSC corrects a spectrum using information from a reference spectrum. Each spectrum is regressed against a reference xrefx_{\text{ref}} , usually the mean spectrum of the training set, as x≈a+b xrefx \approx a + b\,x_{\text{ref}} . The fitted offset a and slope b are then removed:

    xMSC=x−ab x_{\text{MSC}} = \frac{x - a}{b}

    Every corrected spectrum is pulled toward the shape of the reference8.

In practice the two usually give very similar results; Dhanoa and colleagues showed that they are closely related, linear transformations of each other9. The choice matters more for validation than for chemistry. Because the MSC reference is calculated from the training data, it must be recalculated inside each fold and then frozen with the model, and a new sample is corrected against that frozen reference. SNV needs no stored reference at all. Try both during development and choose on cross-validated performance and on the physics of the samples.

Graphic titled 'SNV vs. MSC: What's the Difference?', subtitled 'Both correct scatter effects, but they do it differently and with different assumptions.' Left, 'The problem: scatter': physical differences such as particle size, packing and surface roughness change the offset and slope of NIR spectra without changing chemistry, shown as three parallel offset spectra labelled 'same chemistry, different scatter', above a photograph of tablets and powder. Centre, SNV, standard normal variate: a per-spectrum correction that centres and scales each spectrum by its own mean and standard deviation, removing additive and multiplicative effects for each sample individually, with the formula x prime equals x minus mean of x, divided by sd of x, and a before-and-after sketch of three offset spectra becoming aligned. Right, MSC, multiplicative scatter correction: a reference-based correction across samples that fits each spectrum to a reference, often the mean spectrum, with a linear model and corrects the offset and slope, preserving the reference's shape, with the formula x prime equals x minus a, divided by b, where a is the offset (intercept) and b the slope (scale), and a before-and-after sketch of spectra fitted to the reference. A comparison table: how it works, SNV per spectrum (centre and scale), MSC reference-based (linear fit: offset and slope); learns across samples, SNV no, MSC yes (uses a reference); assumption, SNV each spectrum has its own scatter effects, MSC differences are mainly additive and multiplicative; common use, SNV classification and robust exploratory modeling, MSC quantitative models such as assay or dissolution. 'When to use which?': use SNV for a simple, robust correction when scatter varies from sample to sample; use MSC when you want spectra to match a reference shape, especially for quantitative work; evaluate both during model development and choose based on performance and scientific rationale. Footer: 'Both reduce scatter; SNV standardizes each spectrum, while MSC aligns spectra to a reference.'
SNV standardizes each spectrum against itself; MSC fits each spectrum to a reference spectrum and removes the fitted offset and slope. The 'common use' row is a tendency, not a rule: both are used for quantitative and qualitative models.

Estimate inside the fold, every time

A recipe is estimated with prep() and applied with bake(). You will rarely call either directly. When the recipe is combined with a model and resampled, tidymodels re-estimates it on each fold’s analysis set:

folds <- group_vfold_cv(batches, group = api_lot, v = 5)

group_vfold_cv keeps every batch from one API lot in the same fold. Product T’s realistic future is a new API lot, so that is what the held-out fold should look like. The choice of grouping is a statement about how the model will be used.

Graphic titled 'Data Leakage: When the Model Cheats', subtitled 'Results look better than they really are when information from the test set leaks into model training.' Left, the Product T case: predict % dissolved at 30 minutes, 60 batches, 6 vessels per batch (360 results). Centre, a table, 'Three validation setups — what is being tested?': random vessel split, individual vessel results split at random, tests another measurement from a potentially familiar batch, typical outcome too optimistic (e.g., RMSE 0.9%); grouped batch split, all six vessels for a batch stay together, tests a previously unseen manufacturing batch, more realistic (e.g., RMSE 2.1%); grouped API lot split, all batches from an API lot stay together, tests batches from a previously unseen API lot (new supply), intended use (e.g., RMSE 2.4%). Right, 'The key idea: keep related data together when you split': define the observational unit (e.g., batch or API lot); split by that unit; estimate preprocessing and the model using only the training data. Bottom left, 'How leakage happens': a leaky random split sends vessel V1 of batch B017 to training and vessel V2 to testing, so the model sees batch B017 in both; a correct grouped split keeps all vessels of B017 together in training. Bottom right, 'The correct workflow within each fold': split data (fold), estimate preprocessing (on training only), transform training data, fit model, transform held-out data (same steps), evaluate predictions, with the note 'Preprocessing must be re-estimated inside every resampling fold. Imputation values, scaling parameters, PCA loadings and other data-driven steps are learned from the training data only, then applied to the held-out data.' Footer: 'Avoid leakage, test the right question, and get a performance estimate you can trust.'
Three ways to split Product T, and the question each one actually tests. The stricter the grouping, the higher and more honest the error. RMSE values are illustrative, echoing the NIR example above.

To see what a fitted recipe actually did, ask it:

prepped <- prep(rec, training = batches)
tidy(prepped, number = 5)   # which columns did step_nzv remove?

The reading on one page

Five-panel summary figure. Panel 1, 'What is tidy data?': Hadley Wickham's three rules: each variable is a column; each observation is a row; each type of observational unit is its own table. Panel 2, 'The observational units (Product T)': a dissolution vessel (1 result, % dissolved at 30 min) with an arrow to a tablet representing a batch (1 set of conditions: material, process, release decision); 'Two units, two tables: vessel results (360 rows) and batch data (60 rows), joined by batch_id.' Panel 3, 'Why the unit matters for validation': random cross-validation by vessel, marked with a red cross, splits the vessels of batches 17 and 42 between training (filled circles) and test (open circles) and 'leaks information (the model sees part of a batch in training and the rest in testing)'; grouped cross-validation by batch, marked with a green tick, puts all of batch 17 in training and all of batch 42 in test, which 'keeps whole batches together for a fair test of new batches.' Panel 4, 'The preprocessing recipe (tidymodels)': a recipe document, 'a written plan', leading to five steps (remove zero- and near-zero-variance predictors; filter correlated predictors; impute missing values; transform, e.g. log or Box–Cox; scale, centre and standardize), bracketed as 'estimated inside every resampling fold (training data only)'. Panel 5, 'End-to-end for Product T': tidy tables (vessel, batch), then recipe (preprocessing), then resampling (grouped by batch), then model (e.g. predict % dissolved at 30 min). Footer: 'The one idea: decide what one observation is, then let every preprocessing step that learns from the data learn only from the training data.'
The reading in one figure: tidy-data rules, Product T's two observational units, why random cross-validation by vessel leaks, the recipe estimated inside each fold, and the end-to-end workflow. The figure groups folds by batch; the code above groups by API lot, a stricter version of the same idea.

Where the analyst sits

The analyst decides what one observation is, which grouping makes cross-validation resemble real use, and whether a column removed by an automatic filter carried a process signal. Under ICH Q14, the preprocessing sequence is part of the procedure. It is locked with the model, documented and revalidated if changed, just as a column and mobile phase are in an HPLC method.

For discussion

  1. Product T’s vessel table has 360 rows. Give one modeling question for which the vessel is the right observational unit.
  2. step_nzv removes Press B. What evidence would make you put it back?
  3. Why can SNV be applied before splitting, but MSC cannot?
  4. Grouping folds by API lot gives a worse cross-validated error than random folds. Which number do you report, and why?

Bridge back to the week

Next: Many Models, One Question, which puts this recipe in front of eight models built on different mathematics. Return to Week 12.

Sources

Product T and its numbers are constructed for teaching. The NIR leakage example is a composite of commonly reported failures.


  1. H. Wickham, “Tidy Data,” Journal of Statistical Software 59(10) (2014). DOI. ↩︎

  2. H. Wickham, M. Çetinkaya-Rundel and G. Grolemund, R for Data Science, 2nd ed. (O’Reilly, 2023). Free online at r4ds.hadley.nz. ↩︎

  3. M. Kuhn and J. Silge, Tidy Modeling with R (O’Reilly, 2022). Chapter 8 on recipes. Free online at tmwr.org. ↩︎

  4. M. Kuhn and K. Johnson, Applied Predictive Modeling (Springer, 2013). Chapter 3, data pre-processing, including the near-zero-variance criteria. DOI. ↩︎ ↩︎

  5. M. Kuhn and K. Johnson, Feature Engineering and Selection (CRC Press, 2019). Free online at feat.engineering. ↩︎

  6. A. Stevens and L. Ramirez-Lopez, prospectr: Miscellaneous functions for processing and sample selection of spectroscopic data, R package. CRAN. ↩︎

  7. R. J. Barnes, M. S. Dhanoa and S. J. Lister, “Standard Normal Variate Transformation and De-trending of Near-Infrared Diffuse Reflectance Spectra,” Applied Spectroscopy 43(5) (1989) 772–777. DOI. ↩︎

  8. P. Geladi, D. MacDougall and H. Martens, “Linearization and Scatter-Correction for Near-Infrared Reflectance Spectra of Meat,” Applied Spectroscopy 39(3) (1985) 491–500. DOI. ↩︎

  9. M. S. Dhanoa, S. J. Lister, R. Sanderson and R. J. Barnes, “The Link between Multiplicative Scatter Correction (MSC) and Standard Normal Variate (SNV) Transformations of NIR Spectra,” Journal of Near Infrared Spectroscopy 2(1) (1994) 43–47. DOI. ↩︎

2 - Many Models, One Question

Kuhn and Johnson’s practice of fitting a panel of models built on different mathematics (PLS, penalized regression, MARS, SVM, KNN, random forest, boosting and a neural network) on the same resamples, comparing them honestly, stacking them into an ensemble and choosing what a regulated setting can defend.

The one idea

No single algorithm is right in advance. Fit several that explain the outcome in different mathematical ways, compare them on identical resamples, and let the evidence, then the intended use, choose.

Kuhn and Johnson make this the backbone of Applied Predictive Modeling1. Their worked case studies do not pick an algorithm and tune it to death. They fit a panel: linear, nonlinear, tree-based, kernel-based. They compare the resampled performance distributions and only then decide. Judging a model by how well it predicts held-out data, rather than by how plausible its assumptions look, is what Leo Breiman called the algorithmic modelling culture2. The reason is not fashion. Each model makes different assumptions about how predictors relate to the outcome, so a panel is a set of competing hypotheses about the data.

Graphic titled 'Many Models, One Question', subtitled 'No single algorithm is right in advance. Fit several that explain the outcome in different mathematical ways, compare them, and let the evidence choose.' Left, 'Product T: manufacturing inputs (same dataset for all models)': API particle size (D50), granule moisture, lubricant blend time, compression force, tablet hardness, supplier and manufacturing equipment, above a photograph of tablets. An arrow leads to 'Same dataset', which branches into four model families, each with two models, a small sketch and a one-line description. Regression and latent variables: PLS, a weighted sum of a few latent variables related to the outcome; lasso, a linear model with coefficients shrunk toward zero (variable selection). Nonlinear functions: MARS, joined straight-line segments with automatic interactions; neural network, weighted sums through nonlinear functions (learns flexible relationships). Similarity and kernel methods: SVM, a smooth nonlinear model with a tolerance band; KNN, the average of the k most similar training batches. Tree-based methods: random forest, the average of many decision trees (more stable and robust); boosted trees, many shallow trees, each fitted to the errors of the previous trees. All four families point to 'Outcome (same question): percent dissolved at 30 minutes', with a photograph of dissolution vessels. Footer: 'The takeaway: one question, one dataset, multiple mathematical hypotheses.'
The eight-model panel for Product T, grouped into four families. Every model sees the same batches and answers the same question; they differ only in how they assume the inputs relate to % dissolved. Constructed teaching case; photographs are illustrative.

Eight models, eight explanations

Product T, from reading 1: predict % dissolved at 30 minutes from material and process data.

ModelHow it explains the outcomeWhat it assumesPreprocessing it needs
Partial least squares (PLS)A weighted sum of a few latent variables chosen to covary with yRoughly linear; collinearity is fineCentring, usually scaling
Penalized regression (lasso, elastic net)A weighted sum of predictors with coefficients shrunk toward zero; lasso sets some exactly to zeroLinear, additiveScaling (the penalty is scale-dependent)
MARSJoined straight-line segments (“hinges”), with interactions added automaticallyPiecewise linearLittle
Support vector machine (radial kernel)A smooth surface in a transformed space, ignoring errors inside a tolerance bandSmooth, possibly curvedScaling, essential
k-nearest neighboursThe average of the k most similar training batchesSimilar inputs give similar outputsScaling, essential (it is all distances)
Random forestThe average of hundreds of decision trees, each grown on a bootstrap sample with random subsets of predictorsStep-like relationships; interactions are naturalAlmost none
Boosted treesMany shallow trees, each fitted to the errors of the trees before itSame as forest, built sequentiallyAlmost none
Neural network (single hidden layer)Weighted sums passed through nonlinear functions, layeredVery flexible; needs dataScaling, essential

Three practical consequences follow from the table.

  • Different preprocessing for different models. Trees need almost nothing; KNN, SVM and neural networks are useless without scaling. tidymodels handles this by pairing recipes with models.
  • Different extrapolation behaviour. A tree ensemble cannot predict outside the range of outcomes it was trained on; it plateaus. A linear model extrapolates confidently, and can be confidently wrong. Neither is safe outside the applicability domain, which is why T² and Q monitoring matter regardless of model.
  • Different explanations. If PLS, the lasso and a random forest all rank API particle size first, that is evidence about the data. If only the neural network finds a signal, ask what it is fitting.

Run the panel on the same resamples

A workflow joins one recipe to one model. A workflow set crosses several recipes with several models:

library(tidymodels)

basic  <- recipe(diss_30 ~ ., data = batches) |>
  update_role(batch_id, api_lot, new_role = "id") |>
  step_impute_median(hardness) |>
  step_dummy(all_nominal_predictors()) |>
  step_nzv(all_predictors())

scaled <- basic |> step_normalize(all_numeric_predictors())

panel <- workflow_set(
  preproc = list(basic = basic, scaled = scaled),
  models  = list(
    pls    = parsnip::pls(num_comp = tune()) |> set_mode("regression"),
    lasso  = linear_reg(penalty = tune(), mixture = 1) |> set_engine("glmnet"),
    mars   = mars(prod_degree = tune()) |> set_mode("regression"),
    svm    = svm_rbf(cost = tune(), rbf_sigma = tune()) |> set_mode("regression"),
    knn    = nearest_neighbor(neighbors = tune()) |> set_mode("regression"),
    forest = rand_forest(mtry = tune(), trees = 1000) |> set_mode("regression"),
    boost  = boost_tree(trees = tune(), learn_rate = tune()) |> set_mode("regression"),
    nnet   = mlp(hidden_units = tune(), penalty = tune()) |> set_mode("regression")
  )
)

results <- panel |>
  workflow_map("tune_grid", resamples = folds, grid = 15,
               metrics = metric_set(rmse, rsq), seed = 2026)

autoplot(results, rank_metric = "rmse")

In practice you would pair the tree models with basic and the rest with scaled instead of fitting every combination. The point to see is the structure: one folds object (the batch-grouped folds from reading 1), used by every workflow. Each model is scored on exactly the same held-out batches, so the comparison is paired. Differences come from the models, not from luck in the split.

Read the result as a distribution, not a leaderboard

The constructed Product T panel gives these cross-validated RMSE values, in % dissolved:

ModelMean RMSESpread across folds
Random forest3.12.4–3.9
Boosted trees3.22.3–4.2
MARS3.32.6–4.0
PLS3.42.8–4.1
Lasso3.52.9–4.1
SVM3.62.7–4.6
Neural network4.02.9–5.6
KNN4.43.3–5.8

The forest “wins” by 0.3 percentage points. The spread across folds is about 1.5 points. The top five are not meaningfully different on this evidence. Kuhn and Silge recommend formal paired comparisons of resampled metrics for exactly this reason3. Two things are clear: KNN and the neural network are worse, and the relationships appear to be mostly linear, since PLS and the lasso keep up with the flexible models.

The one-standard-error rule

When several settings perform within noise of each other, choose the simplest one within one standard error of the best. tune provides select_by_one_std_err(). In a regulated setting this rule has more force, because the simpler model is easier to explain, validate, monitor and transfer. Here PLS or the lasso is the defensible choice. The forest’s 0.3 points do not pay for what it costs to justify.

Ensembles: let models vote

Sometimes the models are wrong in different places. Then a combination beats any member. Stacking fits a second, simple model whose inputs are the out-of-fold predictions of the candidates, and learns how much weight each deserves3:

library(stacks)

ens <- stacks() |>
  add_candidates(results) |>     # out-of-fold predictions from the panel
  blend_predictions() |>         # penalized weights; most get zero
  fit_members()                  # refit the survivors on all training data

add_candidates needs the tuning run to keep its predictions (control_grid(save_pred = TRUE, save_workflow = TRUE)). The blending step uses a lasso-type penalty, so most candidates get zero weight; a typical result keeps two to four members. Random forests and boosted trees are themselves ensembles of trees. Stacking is the same idea one level up.

For Product T the stack (PLS 0.55, random forest 0.30, MARS 0.15) reaches RMSE 2.9. Is that worth it? An ensemble is several locked models plus a blending model, each with its own preprocessing. Every one has to be validated, monitored for drift and change-controlled. Ensembles are common in research and in high-volume, low-consequence prediction. For a model that supports a release decision, the extra 0.5 points must be weighed against that lifecycle burden.

What the panel tells you that one model cannot

  • Is the problem linear? If PLS keeps up with the forest, yes, mostly.
  • Is there more signal to find? If every model plateaus near the same error, the limit is the data, not the algorithm. Compare the plateau with the reference method’s own noise. In Product T, vessel-to-vessel SD is about 3%, so a six-vessel batch mean carries roughly 1.2 points of noise, and run-to-run variation adds a little more. Every model stalls near 3, well above that floor. Something that drives dissolution is either not in the table or not varying enough in it to be learned.
  • Do the explanations agree? Variable importance from different model families that agrees is stronger evidence than one model’s ranking.

None of this establishes cause. Every model here learns associations in historical batches. Reading 3 is about that limit.

Where the analyst sits

The analyst sets the comparison up honestly (same folds, grouped the way the model will be used) and reads the result as a distribution. They also know the error floor set by the reference method, and choose the simplest model the evidence supports. The final choice is a judgment about intended use, consequence and lifecycle cost, not a sort by RMSE.

Graphic titled 'From Predictive Performance to Pharmaceutical Confidence', subtitled 'Linking model performance, intended use and lifecycle controls with ICH Q14 and ICH Q2(R2).' Panel 1, 'Extrapolation and applicability domain': two plots of % dissolved at 30 minutes against a process or material variable, each with a shaded region marked 'outside the applicability domain'. The linear model's line keeps rising into that region; the random forest's curve flattens into a plateau. Below, 'T² and Q monitoring'. Panel 2, 'Performance versus complexity': a balance scale. One pan holds predictive accuracy, robustness, sensitivity and improved decision-making; the other holds interpretability, validation effort, model maintenance, technology transfer, change control and drift monitoring. Panel 3, 'Intended use determines the burden of evidence': a table comparing a process advisory model with a model supporting product release. Intended use: identify potential slow batches, versus support a consequential quality decision. Model complexity: may justify a more flexible ensemble, versus must justify complexity against risk. Human oversight: scientist evaluates the prediction, versus a defined and controlled decision procedure. Lifecycle controls: proportionate to risk, versus more rigorous evidence and controls. A strip below, 'The analytical lifecycle': intended purpose, development, validation, deployment, monitoring, change control. Footer: 'The takeaway: choose the simplest model that adequately and reliably fulfills its intended purpose.'
Why the best RMSE is not the whole decision. Models extrapolate differently, every added model carries lifecycle cost, and the evidence needed depends on whether the prediction advises the process or supports release.

The reading on one page

Six-panel summary figure, each panel ending in a takeaway. Panel 1, 'Many Models, One Question': Product T's inputs (API particle size D50, granule moisture, lubricant blend time, compression force, tablet hardness, supplier and equipment) feed a panel of eight models in four families (PLS and lasso; MARS and neural network; KNN and SVM; random forest and boosted trees), all answering one question, predict % dissolved at 30 minutes. Takeaway: one question, one dataset, multiple mathematical hypotheses. Panel 2, 'Eight Models, Eight Mathematical Explanations': a sketch and one-line description of how each model learns the relationship. Takeaway: different models make different assumptions about the data. Panel 3, 'A Fair Competition': model-specific recipes (a basic recipe for trees and MARS: impute missing values, encode categorical variables, remove zero and near-zero variance; a scaled recipe for PLS, lasso, SVM, KNN and the neural network that adds centring and scaling), a workflow from Product T's 60 batches through grouped cross-validation by API lot, model workflows and hyperparameter tuning to held-out predictions, and three levels of model development (preprocessing, model parameters, hyperparameters). Takeaway: compare the algorithms, not the luck of the data split. Panel 4, 'Read the Distribution, Not the Leaderboard': mean RMSE with ranges for the eight models, from random forest 3.1 (2.4 to 3.9) to KNN 4.4 (3.3 to 5.8); the one-standard-error rule, choose the simplest model within one standard error of the minimum; and the analytical noise floor, a vessel SD of 3% giving a batch-mean SE of 3 over root 6, about 1.22%, below the model RMSE of about 3 to 4. Takeaway: a lower error does not automatically mean a better analytical procedure. Panel 5, 'Ensembles, When Models Work Together': bagging (random forest), boosting (gradient boosting) and stacking, with the example stack 0.55 PLS plus 0.30 random forest plus 0.15 MARS reaching RMSE 2.9, against PLS 3.4 and random forest 3.1. Takeaway: the value of an ensemble comes from diversity in prediction errors. Panel 6, 'From Predictive Performance to Pharmaceutical Confidence': extrapolation outside the applicability domain (linear model extrapolates, random forest plateaus) with T² and Q monitoring; performance versus operational burden; intended use (process advisory versus product release) determines the evidence; and the analytical lifecycle under ICH Q14 and Q2(R2). Takeaway: choose the simplest model that adequately and reliably fulfills its intended purpose.
The reading in one figure: the model panel, how each model explains the outcome, a fair comparison on identical grouped resamples, reading results as distributions against the measurement noise floor, ensembles, and choosing a model for its intended use. The fifth panel is misnumbered '3' in the figure.

For discussion

  1. Why must every model in the panel use the same resampling object?
  2. The neural network has the widest spread across folds. Give two reasons a flexible model might be unstable with 60 batches.
  3. A random forest is trained on batches with 70–90% dissolved. What does it predict for a batch whose true value is 60%? What does PLS predict?
  4. Make the case for and against deploying the three-member stack for in-process prediction. Then do the same for release.

Bridge back to the week

Next: Correlation Is Not Causation. Return to Week 12.

Sources

Product T and the panel results are constructed for teaching.


  1. M. Kuhn and K. Johnson, Applied Predictive Modeling (Springer, 2013). Chapters 6–9 for the regression models; Chapter 10 compares a full model panel on one case study. DOI. ↩︎

  2. L. Breiman, “Statistical Modeling: The Two Cultures,” Statistical Science 16(3) (2001) 199–231. The classic argument for judging models by predictive accuracy, with replies from statisticians who disagree. DOI. ↩︎

  3. M. Kuhn and J. Silge, Tidy Modeling with R (O’Reilly, 2022). Chapter 11 on comparing models with resampling, Chapter 15 on workflow sets, Chapter 20 on ensembles and the stacks package. Free online at tmwr.org. ↩︎ ↩︎

3 - Correlation Is Not Causation: From Designed Experiments to Sustained Pharmaceutical Quality

Use ISA-88 process recipes, FMEA, screening and response-surface optimization to transform predictive associations into pharmaceutical process understanding, design space, lifecycle control and organizational learning.

The one idea

A model fitted to data you observed can tell you what goes together. Only data you caused, by changing a factor on purpose, can tell you what happens when you change it.

R&D deliberately introduces variation to generate knowledge. Manufacturing deliberately controls variation to deliver consistent quality. Quality by Design connects these activities through risk management, experimental evidence, technology transfer and continuous learning.

The organization learns when development evidence and commercial experience are connected, evaluated and reused. The goal is not merely to transfer a product into manufacturing, but to retain the knowledge that sustains its quality and improves future development programs.

In the preceding readings, we prepared historical manufacturing data and compared predictive models. Those models can identify patterns and anticipate a slow batch. They cannot, without additional causal evidence or assumptions, tell us what would happen if we changed a material attribute or manufacturing parameter. Design of experiments (DoE) provides a disciplined way to generate that evidence, rather than simply waiting for variation to occur.

Experiments also come in stages. You do not open the design software and ask “how many factors do I have?” You ask “what am I trying to learn?” Early on the question is which factors matter (screening). Later it is how do they behave, and where should we operate (optimization). Last, it is can we reliably operate there (confirmation). Each question needs a different design.

The case: the model blames moisture

The Product T random forest from reading 2 ranks granule moisture as its most important predictor. Wetter granules go with slower dissolution, and manufacturing proposes tightening the drying endpoint. Before anyone does, look at how moisture varied:

  • Moisture was higher in summer, because the dryer inlet air is more humid.
  • In the same summer, purchasing introduced coarser API from a second supplier (D50 about 85 µm instead of 50 µm).
  • Lubricant blend time never appeared in the importance ranking. It was held near 3.0 ± 0.2 minutes in every batch.

The moisture association could reflect the concurrent particle-size change. And blend time’s restricted range made its potential effect impossible to detect, although magnesium stearate over-blending is a well-known cause of slow dissolution1.

This is a paradox of controlled manufacturing: a critical parameter can appear unimportant precisely because it rarely varies. The absence of a strong historical association does not justify removing its control. R&D must deliberately investigate such parameters within scientifically appropriate ranges.

Variable importance measures how a fitted model uses a predictor, not what an intervention would accomplish. Before tightening the dryer endpoint, ask whether moisture is causal, whether it is a surrogate for API particle size, and which factors never varied enough to be evaluated.

Historical manufacturing dataDesigned experimental data
Moisture, season, supplier and API D50 changed togetherMoisture, API D50 and blend time are each set independently
Blend time sat in a 0.4-minute windowBlend time is deliberately run from 2 to 10 minutes
Answers “what went with slow batches?”Answers “what happens if we change this?”
Good for predicting the next routine batchNeeded before changing the process

George Box put it in one sentence: “To find out what happens to a system when you interfere with it you have to interfere with it (not just passively observe it)”2.

Why Fisher changed the way we generate data

In 1919 Ronald A. Fisher joined Rothamsted Experimental Station in England to analyse decades of crop records. He found the problem every pharmaceutical data scientist eventually finds: weather, soil, field and treatment were tangled together in happenstance data, and no amount of analysis could untangle them. His answer was to change how the data were produced. The principles he set out, collected in The Design of Experiments (1935), remain the basis of pharmaceutical DoE3:

PrincipleWhat it doesProduct T version
RandomizationReduces systematic bias in expectation: unknown factors cannot line up with the factor being studiedRun order randomized, so season, operator and API drum cannot track blend time
ReplicationIndependent repeat runs estimate the experimental variability effects must beatCentre-point batches repeated
BlockingAccounts for known nuisance sourcesRuns grouped by API drum, if one drum cannot supply all runs
Factorial designInvestigates factors together, not one at a timeAll seven candidate factors change in a planned pattern

Fisher argued that nature “will best respond to a logical and carefully thought out questionnaire; indeed, if we ask her a single question, she will often refuse to answer until some other topic has been discussed”4. One-factor-at-a-time experiments cannot see an interaction, where one factor’s effect depends on the level of another. He also warned that “to consult the statistician after an experiment is finished is often merely to ask him to conduct a post mortem examination”5.

A factorial design turns a scientific question into an experimental plan. A pharmaceutical scientist uses prior knowledge and the FMEA to choose which questions are worth the experimental cost.

1. Start with the product and the process

Slide 1 of 7, titled 'Quality by Design: from platform recipe to process understanding', subtitled 'Use structured experiments to identify critical factors, understand their behavior and establish a robust, controlled process.' Top band, 'ISA-88 platform manufacturing recipe (unit operations)', six photographs joined by arrows, each labelled with an example factor: dispense, API particle size; granulate, water addition; dry, residual moisture; blend, lubricant level and time; compress, compression force; coat, coating conditions. Middle band: 'R&D deliberately introduces variation to build process understanding' and 'Commercial manufacturing controls variation to deliver quality', linked by statistical design of experiments (DoE). Lower band, six steps joined by arrows: FMEA, map failure modes and prioritize factors; screen (2-level DoE), 2⁶ = 64 runs full reduced to 16 or 8 fractional, study many factors with few runs; reassess FMEA, update risk and resolve uncertainty; optimize (response surface), model curvature with a CCD or Box–Behnken design; confirm (design space), test robustness and establish the operating region; transfer (to commercial), implement recipe, controls and monitoring (CPV). Beneath: ICH framework Q8 development, Q9 quality risk, Q10 quality system, Q11 drug substance, Q12 lifecycle. Takeaway: experiments reduce uncertainty; effective controls reduce risk.
A risk-driven development workflow. The platform recipe structures the process-wide FMEA, and knowledge is reassessed after screening and confirmation. The 64-run calculation illustrates a six-factor, two-level screening problem; Product T below has seven candidate factors. The steps are stages of experimentation, not clinical trial phases or mandated regulatory phases.

Consider Product T, our constructed immediate-release tablet. One critical quality attribute (CQA) is dissolution at 30 minutes. Content uniformity, hardness and friability also influence the suitability of the product and its manufacturing process.

An ISA-88-inspired platform manufacturing recipe provides a consistent starting structure: dispense materials, granulate, dry, blend, compress and, if appropriate, coat6. This is a manufacturing recipe, distinct from the tidymodels preprocessing recipe of reading 1. Both specify repeatable procedures, but one defines product manufacture and the other defines data preparation.

R&D examines each unit operation using failure mode and effects analysis (FMEA), considering severity, occurrence and detectability where appropriate. The FMEA is a living representation of risk, not merely an initial ranking. What could go wrong? Which material attributes, formulation choices and process parameters might influence a CQA? What evidence supports our understanding, and where are we uncertain? For Product T the risk assessment puts seven candidates forward: API particle size, granule moisture, granulation water, magnesium stearate level, lubricant blend time, disintegrant level and compression force. Blend time is on the list because of pharmaceutics knowledge, even though the forest ignored it.

Screen, optimize, confirm

Development then moves through three experimental stages, each narrowing the problem7,8:

ScreeningOptimizationConfirmation and robustness
QuestionWhich factors matter?How do they behave, and where can we operate?Can we reliably operate in that region?
FactorsManyA selected few (2–4)The chosen operating conditions
LevelsUsually two: low and highThree or more for each continuous factorTarget, plus deliberately challenging settings
ModelMain effects and some interactionsQuadratic response surfacePredictions compared with new observations
Typical designsTwo-level fractional factorial, Plackett–Burman, definitive screeningCentral composite, Box–Behnken, three-level factorialConfirmation runs, replicates, small deliberate perturbations
OutputThe important factorsResponse surfaces and a candidate operating regionExperimental evidence that the region works

The stages are defined by the scientific question, not strictly by the number of levels. Definitive screening designs, for example, run continuous factors at three levels and can investigate some quadratic effects while screening9.

What do I want to learn?Design approachMinitabR
Which factors matter?Screening or fractional factorialStat > DOE > Factorial, or Stat > DOE > ScreeningFrF2::FrF2(), FrF2::pb()
Is there curvature anywhere?Factorial with centre pointsStat > DOE > Factorial (add centre points)FrF2::add.center()
What shape is the response?Response surface designStat > DOE > Response Surfacersm::ccd(), rsm::bbd()
Where are all CQAs acceptable?Overlaid contours, multiple-response optimizationOverlaid Contour Plot, Response OptimizerPredict each response on a grid and overlay
Does the predicted setting actually work?Confirmation runsCompare with the prediction intervalpredict(..., interval = "prediction")

2. Phase 1: screening to reduce uncertainty

Slide 2 of 6, titled 'Screening: factors, levels and experimental space', subtitled 'Choose the factor type, then choose a design that answers the scientific question.' Three cards: continuous (blend time 2, 6, 10 min; disintegrant level 2–6%); categorical (API supplier A or B; disintegrant identity X or Y); mixture (excipient proportions that must sum to a fixed total). Lower left, 'Three continuous factors: experimental geometry', three cubes: 2 levels, 8 corner runs; 2 levels plus a centre point, 8 + 3 = 11 runs; 3-level factorial, a 27-point grid, 27 runs. Note: 'Mixed factors: no midpoint for supplier. 8 corners + 3 center runs per supplier = 14 runs.' Lower right, 'Same endpoints, different curvature': dissolved at 30 min (%) against blend time (2, 6, 10 min) for three curves that all run from 95% at 2 minutes to 85% at 10 minutes: linear, 90% at 6 minutes; interior maximum, 98% at 6 minutes; interior minimum, 82% at 6 minutes. Notes: centre replicates estimate pure error; they do not isolate every quadratic effect. Takeaway: screen broadly; center points test for curvature; optimization estimates it.
Factor types, the run cost of corners, centre points and a full three-level grid, and three hypothetical blend-time curves that share their endpoints. Centre points can detect overall curvature but cannot estimate each quadratic effect separately.

Screening begins by defining the experimental unit, responses, factors and factor levels. One independently manufactured experimental batch is a run; the six dissolution vessels from that batch are subsamples, not six independent manufacturing replicates. This is the same observational-unit question as in reading 1.

Product T’s seven candidate factors:

FactorLowHigh
API particle size (D50)45 µm90 µm
Granule moisture1.5%3.0%
Granulation water2834
Magnesium stearate0.5%1.5%
Lubricant blend time2 min10 min
Disintegrant level2%6%
Compression force8 kN16 kN

The granulation-water units are left unspecified in this constructed example; define the basis before execution. Disintegrant levels are illustrative percent by mass. These ranges are not approved manufacturing settings.

Continuous factors have meaningful intermediate values. Categorical factors, such as supplier or disintegrant type, have distinct alternatives but no numerical midpoint. For formulations where component proportions must sum to a fixed total, use an appropriate mixture or mixture-process design rather than assuming all ingredient amounts can vary independently.

Two-level screening estimates directional changes across selected ranges. A factorial arrangement also permits investigation of interactions, subject to the design’s alias structure. Longer blending may have little influence at low magnesium stearate concentration but substantially reduce dissolution at higher concentration; one-factor-at-a-time experimentation can miss this dependence. For two coded factors (−1 = low, +1 = high), the screening model is first-order with an interaction:

Y=β0+β1X1+β2X2+β12X1X2+ε Y = \beta_0 + \beta_1 X_1 + \beta_2 X_2 + \beta_{12} X_1 X_2 + \varepsilon

A two-level design cannot characterize individual quadratic effects from its corner points alone. The same endpoint contrast can hide very different response shapes:

Blend timeLinearInterior maximumInterior minimum
2 min95%95%95%
6 min90%98%82%
10 min85%85%85%

Centre points are a cheap check. For three continuous factors, eight corner runs plus three independent centre runs give eleven experiments, against 27 for a three-level full factorial. The centre replicates estimate pure error, and their mean compared with the corner average tests for curvature. They cannot say which factor is curved, because every factor sits at its midpoint in the same runs. If one factor is a two-level categorical factor such as supplier, only the continuous factors are centred: three centre runs per supplier give fourteen runs in total10.

Screening tells you what matters. It does not tell you where to operate.

3. Fractionation: obtaining information at a practical cost

Slide 3 of 7, titled 'Fractional factorials: information versus experimental cost', subtitled 'Six two-level factors: select the fraction based on the effects that must be estimable.' Left, 'Choose a screening design for 6 factors': six factors A to F, each at − and +, give 2⁶ = 64 runs, the full factorial. Bars for full factorial, 64 runs; 1/2 fraction, 32 runs, resolution VI, 50% saved; 1/4 fraction, 16 runs, resolution IV, 75% saved, highlighted; 1/8 fraction, 8 runs, resolution III, 87.5% saved. Below, 'Design selection in Minitab or R: follow the highlighted six-factor column' for 4 to 8 factors: 8 runs, IV, III, III, III, not available; 16 runs, full, V, IV, IV, IV; 32 runs, not applicable, full, VI, IV, IV; 64 runs, not applicable, not applicable, full, VII, V. The six-factor, 16-run cell is outlined: 'Example choice: 16 runs, IV, main effects clear of two-factor interactions.' Right, 'Worked alias example: regular 8-run fraction', an 8-run sign table with columns A, B, C, D = AB, E = AC, F = BC, BD and CE; the A, BD and CE columns are highlighted and identical (four minus signs, then four plus signs). Text: 'A = BD = CE. A, BD and CE share the same sign pattern; their effects are not separable.' 'Fold over all signs: 8 + 8 = 16 runs. Separates main effects from two-factor interactions in this example.' 'Plackett–Burman: efficient screening with potentially partial aliasing.' Takeaway: fewer runs mean more aliasing; add targeted experiments when ambiguity matters.
The Minitab six-factor example: start with 2⁶ = 64 runs and follow the six-factor column of the design-selection table. The 16-run resolution IV quarter fraction is an illustrative screening choice; the 8-run resolution III fraction on the right is a separate demonstration of aliasing. Resolution describes alias structure, not a complete measure of pharmaceutical risk.

Suppose six two-level factors are under investigation. A full factorial requires 26=642^6 = 64 runs. A half fraction requires 32, a quarter fraction 16 and an eighth fraction 8: savings of 50%, 75% and 87.5%11. A seven-factor full factorial requires 128 runs, or 2,187 if every factor is studied at three levels. Fractions work because of effect sparsity (only a few factors usually matter) and hierarchy (main effects are usually larger than interactions).

Six-factor designRunsResolution for the illustrated designs
Full factorial64No aliasing among factorial effects
Half fraction32VI
Quarter fraction16IV
Eighth fraction8III

To make the software decision explicit, find the six-factor column in the design-selection table and read down it: 64 runs (full), 32 (resolution VI), 16 (resolution IV) or 8 (resolution III). For this teaching example, choose 16 runs when the priority is estimating main effects without aliasing them with two-factor interactions, accepting that some interactions remain aliased with each other. That saves 48 runs, 75% of the full factorial. If the screen leaves a consequential interaction unresolved, plan targeted follow-up experiments. The same logic applies in R: FrF2(nruns = 16, nfactors = 6) requests a six-factor regular fraction; inspect its generators and alias structure before execution.

We pay for efficiency with aliasing: different effects have identical design columns and cannot be separated using those runs. In the eight-run example, let A, B and C be independent two-level columns and define D = AB, E = AC and F = BC. Because the coded values are −1 or +1, B2=1B^2 = 1 , so

BD=B(AB)=ACE=C(AC)=A BD = B(AB) = A \qquad CE = C(AC) = A

The main effect A is aliased with the interactions BD and CE, among higher-order terms. A large estimated effect cannot be attributed uniquely to A. This eight-run design shows what the more aggressive fraction costs; it is not the 16-run design chosen above.

Resolution is the length of the shortest word in a regular design’s defining relation; here I=ABDI = ABD , so resolution III.

ResolutionMain effectsTwo-factor interactions
IIIAliased with two-factor interactionsAliased with main effects and each other
IVClear of two-factor interactionsAliased with each other
VClearClear of each other

Higher resolution does not eliminate all aliases, and a design with fewer runs is not automatically appropriate for a high-consequence question. If the FMEA says a particular interaction is plausible and serious, choose a design that can estimate it.

This is confounding again, but now it is known and written down. Historical data had unknown confounding you could not repair; a fractional factorial has documented confounding you can break with more runs. A full fold-over of the resolution III design reverses all factor signs in an additional set of runs. Combined with the original fraction, it separates main effects from two-factor interactions, although some interaction aliases remain. More selective follow-up designs may be preferable when specific interactions need resolution12. Plackett–Burman designs provide economical main-effects screening, often with partial rather than complete aliasing13.

In Minitab, use Stat > DOE > Factorial > Create Factorial Design, then Display Available Designs14. In R, FrF2 supplies regular fractional factorial designs and fold-over construction15. For Product T:

library(FrF2)

screen <- FrF2(nruns = 8, nfactors = 7,
               randomize = TRUE, seed = 1935,
               factor.names = list(
                 api_d50   = c(45, 90),   moisture = c(1.5, 3.0),
                 gran_h2o  = c(28, 34),   mgst_pct = c(0.5, 1.5),
                 blend_min = c(2, 10),    disint   = c(2, 6),
                 force_kN  = c(8, 16)))

summary(screen)                  # inspect the actual generators and aliases
followup <- fold.design(screen)  # 8 mirror-image runs that break main-effect aliasing

The six-factor matrix in Figure 3 is a separate illustration, not the generated seven-factor Product T matrix. Review the actual design before randomizing and executing runs.

An unreplicated, saturated seven-factor, eight-run screen has no residual degrees of freedom for estimating error. A half-normal effect plot (DanielPlot() in FrF2) can suggest active effects under sparsity assumptions, but follow-up runs are essential for resolving important ambiguity.

In the constructed Product T study, the eight-run screen followed by eight fold-over runs produced these illustrative effects on dissolution:

EffectChange in % dissolved at 30 min, low → high
API D50, 45 → 90 µm−9.8
Blend time, 2 → 10 min−7.1
Lubricant level × blend time (alias group)−3.4
Granule moisture, 1.5 → 3.0%−0.9 (within noise)
All otherswithin noise

The interaction remains aliased with other two-factor interactions and requires further investigation. These are teaching results, not experimental measurements. They show how the apparently important historical moisture signal can be reconsidered in light of deliberate variation: moisture rode along with the coarse summer API lot. Tightening the dryer would have cost money and fixed nothing.

4. Phase 2: optimization from direction to curvature

Slide 4 of 6, titled 'Response surface optimization: from direction to curvature', subtitled 'After screening, study fewer continuous factors at more settings to estimate a quadratic model.' Top, two equations: screening, 2 levels, Y = β0 + β1X1 + β2X2 + β12X1X2 + ε; optimization, quadratic, the same plus β11X1² + β22X2². Lower left, 'Response-surface design geometries': a 3-level factorial, a 3 × 3 grid, 9 runs for 2 factors; a central composite design, 13 runs for 2 factors, with orange corners at ±1, teal axial points at ±1.41 on each axis and a purple centre point; a Box–Behnken design, 15 runs for 3 factors, with points at the midpoints of the cube's edges and one centre point. Notes: CCD 4 + 4 + 5 = 13 runs; Box–Behnken 12 + 3 = 15; centre replicates are chosen for the study. Lower right, 'Five levels, within feasible bounds': inscribed rotatable CCD, 2 factors, α = √2, blend time 2–10 min, with coded levels −α, −1, 0, +1, +α at 2.00, 3.17, 6.00, 8.83 and 10.00 minutes. Note: face-centred CCD, α = 1, gives 3 levels. A small dome-shaped fitted surface over X1 and X2, with notes 'Corners move inward. Prior runs may not be reusable.' and 'Fit, assess, optimize.' Takeaway: axial points address curvature; fold-over runs address aliasing.
Response-surface designs add levels so the model can estimate curvature. Inscribing the CCD keeps every blend time between 2 and 10 minutes, at the cost of moving the factorial points inward. The fitted surface is illustrative.

Screening helps decide which factors deserve further study. Optimization investigates how those factors behave across the relevant region. Two endpoint measurements cannot distinguish a straight line from a curve passing through the same endpoints, and replicated centre points detect overall curvature without separating individual quadratic terms.

A quadratic response-surface model for two coded continuous factors is:

Y=β0+β1X1+β2X2+β12X1X2+β11X12+β22X22⏟curvature+ε Y = \beta_0 + \beta_1 X_1 + \beta_2 X_2 + \beta_{12} X_1 X_2 + \underbrace{\beta_{11} X_1^2 + \beta_{22} X_2^2}_{\text{curvature}} + \varepsilon

The interaction term describes dependence between factors. The squared terms allow curvature along individual factor directions, so the model can describe local maxima, minima, ridges or saddle points. Each βii\beta_{ii} needs at least three levels of its factor. Predictions remain conditional on model adequacy and the investigated region. Box and Wilson introduced this sequential, second-order approach in 195116.

DesignGeometryLevels per factorRuns (example)
Three-level full factorialA full grid39 for 2 factors, 27 for 3
Central composite (CCD)Factorial points + centre points + axial (star) points5 (rotatable) or 3 (face-centred)13 for 2 factors (4 + 4 + 5)
Box–BehnkenEdge midpoints + centre of the cube3; needs at least 3 factors15 for 3 factors (12 + 3)17

A circumscribed CCD typically has five distinct coded levels per continuous factor: −α, −1, 0, +1 and +α. A face-centred CCD uses α = 1 and therefore only three. The choice of α and physical bounds matters: unsafe or infeasible settings should never be chosen simply to obtain a mathematically convenient design. For a two-factor inscribed rotatable CCD, α = √2. With blend time bounded at 2–10 minutes, the five levels are 2.00, 3.17, 6.00, 8.83 and 10.00 minutes. The outer bounds are the axial settings and the factorial settings move inward18,19.

A CCD can be built sequentially from suitable prior factorial runs, if the factors, ranges, blocking and estimability remain compatible. Inscribing the design may prevent that reuse. Box–Behnken designs sample edge midpoints rather than corners, so they never run every factor at its extreme together. A fold-over resolves aliasing; axial points estimate curvature. They solve different problems.

For Product T, API particle size was the strongest screening effect. One scientifically plausible next step is to characterize and control D50 within a justified material range, then study magnesium stearate concentration and blend time jointly. If particle size remains variable or interactions with it are plausible, include D50 in the optimization instead. Neither a material specification nor a causal mechanism is established by the constructed screen alone.

library(rsm)

set.seed(1951)
opt <- ccd(~ x1 + x2, n0 = c(3, 2), alpha = "rotatable", inscribed = TRUE,
           randomize = TRUE,
           coding = list(x1 ~ (blend_min - 6) / 4,      # axial points at 2 and 10 min
                         x2 ~ (mgst_pct  - 1.0) / 0.5)) # axial points at 0.5 and 1.5%
opt   # 13 runs: 4 factorial + 4 axial + 5 centre, in two blocks

# after the runs, add the measured diss_30 to the design and fit
fit <- rsm(diss_30 ~ Block + SO(x1, x2), data = opt_results)
summary(fit)                                   # quadratic terms, lack of fit, stationary point
contour(fit, ~ x1 + x2, image = TRUE)

SO() fits the full second-order model: linear terms, the interaction and pure quadratics20. With inscribed = TRUE, the coded ±1 in coding are the axial settings, so every run stays within the screened ranges.

Screening tells you which direction to move. Optimization tells you how far to move and where to operate.

5. From response surfaces to a proposed design space

Slide 5 of 6, titled 'Pharmaceutical design space: from optimum to robust operating region', subtitled 'Optimize multiple responses together, then verify the proposed operating region with independent evidence.' Left, 'Individual quality response regions', three small plots of magnesium stearate (0.5–1.5%) against blend time (2–10 min), each shaded where an illustrative criterion is met: dissolution at least 85%, a teal ellipse; hardness 70–115 N, a purple diagonal band; friability at most 1%, an orange ellipse. Note: API D50 held within a justified material range. Right, 'Overlay: common acceptable region', the three boundaries overlaid on magnesium stearate (%) against lubricant blend time (min), with the region meeting all three criteria shaded green, spanning roughly 3 to 9 minutes. A navy dot marks the proposed robust setpoint at 6 minutes and 1.0%, surrounded by a dashed ellipse of illustrative normal variation. A purple star marks the predicted optimum at about 6.8 minutes and 1.0%. A red arrow labelled 'edge of failure' points to the friability boundary near 9 minutes. Text: 'Candidate design space ≠ demonstrated design space. Confirm predictions, assess uncertainty, scale and robustness.' Takeaway: choose an operating region that remains acceptable despite normal variation.
Illustrative overlay of CQA acceptance regions. The response models and criteria are hypothetical: dissolution ≥85%, hardness 70–115 N and friability ≤1%. The star maximizes an illustrative combined score; the dot is the proposed setpoint. The dashed ellipse is assumed normal process variation, not a statistical confidence region. The green region is not a demonstrated design space.

Pharmaceutical optimization rarely means maximizing one response. Increasing compression force may improve hardness while affecting disintegration or dissolution. More lubricant or longer blending can slow dissolution and soften tablets, while too little can cause sticking. An acceptable formulation and process must balance multiple CQAs. Fit suitable response models, evaluate their residuals and predictive uncertainty, and overlay the regions meeting the relevant criteria. Desirability functions combine the responses into a single score, as Minitab’s Response Optimizer does21.

The intersection provides a candidate operating region. Figure 5 uses three illustrative response functions and a combined score that rewards higher dissolution, hardness near a target and lower friability. Three kinds of point are worth distinguishing:

  • The predicted optimum (the star) maximizes the combined score.
  • The proposed robust setpoint (1.0% magnesium stearate, 6 minutes) is chosen so that normal variation, the dashed ellipse, stays inside the region.
  • The edge of failure is the boundary beyond which a quality attribute fails. ICH Q8(R2) notes that it can be useful to know where it lies22.

The robust setpoint differs from the score-maximizing point because distance from failure boundaries matters. The overlay is also drawn from mean predictions: near a boundary, a batch predicted to dissolve 86% has a real chance of falling below 85%. Draw edges using prediction intervals or the probability of meeting every criterion, as Week 8 did for the MODR.

The plotted region is conditional on the assumed material conditions; other CQAs, including content uniformity and disintegration, still need evidence. Select a robust setpoint sufficiently distant from failure boundaries, taking expected material, equipment and process variation into account. Independent confirmation runs test whether the model predicts adequately at the setpoint, and targeted robustness experiments test small deliberate perturbations around it. Scale-up, sampling and other practical sources of variability must also be addressed.

ICH Q8(R2) defines the design space as “the multidimensional combination and interaction of input variables (e.g., material attributes) and process parameters that have been demonstrated to provide assurance of quality”22. Demonstrated is doing the work: a fitted contour alone is not a demonstrated design space. ICH Q14 applies the same logic to analytical procedures23:

ICH Q8: manufacturingICH Q14: analytical procedures
Material attributes and process parametersAnalytical procedure parameters
Product CQAsPerformance criteria from the analytical target profile
Design spacemethod operable design region (MODR)
Process control strategyAnalytical procedure control strategy

These are conceptual parallels, worked through for an HPLC method in Week 8’s column-screening reading and MODR reading.

Return to the FMEA. Which risks have been better characterized? Which remain uncertain? Screening reduces uncertainty; effective controls reduce actual risk. A negligible effect within the studied range does not establish irrelevance outside that range.

6. Technology transfer and sustained quality

Slide 6 of 6, titled 'From scientific understanding to sustained pharmaceutical quality', subtitled 'Translate development knowledge into a controlled manufacturing recipe and maintain it throughout the lifecycle.' Left, 'Technology transfer: knowledge becomes action', seven development deliverables, each with an arrow to a manufacturing control: material attributes to material specifications; process parameters to recipe setpoints and limits; factor interactions to coordinated process controls; candidate region plus confirmation to justified operating conditions; experimental uncertainty to monitoring requirements; updated FMEA to risk-based control strategy; predictive model to qualified decision support. Right, 'Manufacturing: continued process verification', a trend of an illustrative response over 18 batches, varying between about 89 and 91 inside dashed limits near 87.6 and 92.4. Text: monitor CPPs and CQAs, then investigate shifts; trend analysis, deviations, change control; knowledge management, reassess residual risk; feedback to R&D, FMEA and the control strategy. A purple arrow runs back to the left, labelled 'continuous learning, ICH Q8–Q12'. Takeaway: R&D creates variation to build knowledge; manufacturing controls variation to sustain quality.
Development knowledge informs technology transfer, manufacturing controls and continued process verification. The trend and dashed monitoring limits are schematic, not actual control limits.

The deliverable of R&D is not merely a statistical report. It is actionable knowledge that informs the manufacturing recipe and control strategy. Relevant material specifications, process setpoints and ranges, in-process checks, sampling requirements and monitoring procedures are transferred through a controlled process. The ISA-88 structure helps organize those decisions across unit operations, while the pharmaceutical quality system governs implementation and change.

ICH Q8 addresses pharmaceutical development and design space; Q9 addresses quality risk management; Q10 establishes the pharmaceutical quality system and emphasizes knowledge management; Q11 addresses drug-substance development and manufacture, including attributes such as API particle size; and Q12 provides a framework for post-approval lifecycle changes. ISA-88 is complementary process architecture, not a mandated element of those guidelines. For analytical procedures, ICH Q14 and Q2(R2) provide analogous development and validation concepts.

Technology transfer is a two-way exchange of knowledge, not simply a handoff of documents. The receiving site needs the scientific rationale for each material specification, process setting and monitoring requirement, as well as known interactions and unresolved risks. Scale-up and equipment differences may require further studies. In the FDA lifecycle approach, process design is followed by process qualification (including process performance qualification, PPQ) and continued process verification (CPV) during routine manufacture24. These validation stages are distinct from the screening and optimization stages of DoE. Qualification and later commercial evidence can refine the original understanding under appropriate change control.

Manufacturing experience then feeds back into development. Continued process verification, trend analysis and investigations identify emerging variability or drift. Changes are assessed through the quality system and supported by appropriate evidence. Predictive models can be strengthened with designed variation, reducing dependence on incidental historical associations; their own intended use and lifecycle controls still require attention, as reading 2 argued.

7. The learning pharmaceutical organization

Slide 7, titled 'The learning pharmaceutical organization', subtitled 'From product development to commercial manufacturing and back into organizational knowledge.' Top row, three panels joined by arrows: R&D, develop and understand (designed variation; FMEA and risk assessment; DoE, screening and optimization); technology transfer (scale-up and process understanding; control strategy and specifications; process qualification, e.g. PPQ); commercial manufacturing (controlled execution of the ISA-88 recipe; continued process verification, CPV; operational experience and performance data). Middle, the ISA-88 platform recipe: dispense, granulate, dry, blend, compress, coat. Below it, a shared organizational knowledge repository holding development studies, FMEAs, material and process models, batch trends, investigations and CAPA, and control strategies. On the right, an arrow from commercial manufacturing through 'product learning: update product risk and controls' into the repository; on the left, an arrow from the repository through 'platform learning: improve future product development' back to R&D. Bottom band, ICH Q10 pharmaceutical quality system: performance monitoring, CAPA, change management, management review; enablers, knowledge management plus quality risk management. Takeaway: R&D creates knowledge; manufacturing generates experience; knowledge management turns both into organizational capability.
Two connected feedback loops: product learning improves the existing product and its controls; platform learning informs future product development. The shared repository and ISA-88-inspired architecture are proposed implementation approaches, not system designs prescribed by ICH Q10.

The development program does not end when R&D transfers the recipe. A company may manufacture Product T for decades. During that time, production provides evidence about raw material variability, equipment differences, scale, process capability, analytical performance and product stability. The value of that experience depends on whether the organization can turn it into accessible, scientifically qualified knowledge.

Two feedback loops: product learning and platform learning

Product-specific learning begins with a defined product and its control strategy. Suppose continued process verification detects a gradual decrease in Product T dissolution, even though blend time and lubricant level remain within their established limits. A cross-functional team reviews API particle-size distributions, supplier changes, blending equipment, analytical method performance and the relevant development experiments. Historical associations generate hypotheses; a targeted experiment may be needed to distinguish competing explanations. The team records its conclusions and remaining uncertainty, reassesses the FMEA, and evaluates any proposed change through the quality system. A trend alone is not authorization to change a recipe or a registered condition.

Platform learning extends the benefit beyond Product T. Imagine thirty immediate-release tablet development programs, each investigating similar operations. The scientist developing Product 31 should be able to retrieve relevant prior studies of lubricant concentration, blend time and dissolution, including conditions that failed. That evidence can inform initial factor selection, experimental ranges, analytical targets and the initial FMEA, and so reduce unnecessary experiments. Prior knowledge is not a substitute for demonstrating suitability for the new product: transferability depends on the formulation, API properties, equipment, scale, process mechanism and intended quality attributes.

The platform recipe as a knowledge structure

The ISA-88-inspired recipe gives a consistent way to locate knowledge by unit operation. It connects development experiments with commercial experience without assuming that every product uses identical equipment or settings.

Unit operationDevelopment knowledgeCommercial evidenceReusable platform knowledge
DispenseAPI attributes and material studiesSupplier and lot variabilityMaterial characterization strategy
GranulateWater addition and mixing experimentsEquipment and scale effectsCandidate factors and scale-up considerations
DryMoisture endpoint studiesSeasonal and inlet-air trendsDrying risks and monitoring approaches
BlendLubricant level × blend time studiesUniformity and dissolution trendsLubrication mechanisms and prior experimental ranges
CompressForce versus tablet propertiesTooling wear and press variabilityCompression risk and control patterns
CoatSpray rate and temperature studiesCoating defects and performanceCoating development and monitoring strategy

For each knowledge item, retain the product and process context, source study or batch record, experimental ranges, response methods, model version, uncertainty, conclusions, limitations, approval status and responsible owner. Link the record to the relevant failure mode, material attribute, process parameter and CQA. Preserve source evidence and version history rather than replacing them with an unsupported summary. Negative experiments and unresolved effects are knowledge too.

ICH Q10: the system that closes the loops

ICH Q10 names knowledge management and quality risk management as the two enablers of the pharmaceutical quality system (PQS). Its four system elements give practical routes for organizational learning across the lifecycle25:

PQS elementContribution to learning
Process performance and product quality monitoringDetect shifts and characterize process variability
Corrective action and preventive action (CAPA)Investigate causes, address systemic issues and verify effectiveness
Change managementEvaluate proposed improvements, implement them under appropriate controls and assess their outcomes
Management reviewEvaluate system performance, prioritize resources and identify improvements across products and sites

Knowledge management is how evidence is captured, assessed, shared and made available for future decisions. Quality risk management helps decide which evidence is needed and which actions are justified. Together they connect R&D, manufacturing, analytical science, quality, regulatory affairs and engineering. Product-specific changes remain subject to the appropriate quality and regulatory controls, and platform knowledge must be evaluated before reuse.

From data to organizational wisdom

Return to Week 1: Knowledge Management. Individual measurements are data; trends and model outputs provide information; experimentally supported explanations and qualified manufacturing experience become knowledge; applying that knowledge appropriately to a new product or control strategy is wisdom. DoE moves information towards knowledge, and the PQS makes that knowledge actionable and reusable.

This is the organizational return on investment from pharmaceutical development: every study can strengthen the current product and, where its applicability is justified, improve the next development program.

R&D creates knowledge. Manufacturing generates experience. Knowledge management turns both into organizational capability.

Machine learning and DoE work together

Machine learning and designed experiments answer different questions and feed each other.

StageQuestion answeredOutput
Machine learning on historical dataWhat patterns exist?Hypotheses
Risk assessment (FMEA)Which hypotheses matter most?Prioritized candidate factors
Screening DoEWhich factors matter?The important factors
Optimization DoEHow do those factors behave?Response surfaces
Multiple-response optimizationWhere are all quality requirements met?A candidate operating region
Confirmation and robustnessCan we reliably operate there?Experimental evidence
Technology transfer and control strategyHow do we keep it there?Sustained quality

Commercial data complete the cycle. A newly detected pattern can prompt a revised FMEA or a targeted experiment, while designed variation can improve future predictive models. A calibration set for an NIR potency model, for example, should vary API concentration independently of moisture and particle size where feasible, so that the model cannot lean on a correlation that will not hold in production. Model updates need their own assessment and lifecycle controls. Capture the experimental conditions, assumptions, limitations and evidence in a form other product teams can evaluate and reuse.

Where the analyst sits

The analyst is the person in the room who asks “did this factor vary, and what varied with it?” before a model’s importance ranking becomes a process change. They choose the experimental stage that fits the question, write down the aliasing, and do not let a convenient interpretation of an aliased effect stand in for a follow-up experiment, or a predicted optimum stand in for a demonstrated operating region. Their role is to translate uncertainty into purposeful experiments and translate experimental knowledge into reliable decisions.

For discussion

  1. Why might the best-controlled process parameter appear unimportant in historical data?
  2. When would a resolution III screen be insufficient given an FMEA finding?
  3. How do a fold-over and axial points solve different scientific problems?
  4. Why might a robust manufacturing setpoint differ from the mathematical optimum?
  5. What additional evidence would be needed before controlling API particle size within a narrower range?
  6. Why does a categorical supplier factor require separate pseudo-centre points?
  7. What knowledge should transfer from development to the ISA-88 recipe, and how should manufacturing feed new knowledge back?
  8. A commercial trend suggests slower dissolution despite a controlled blend time. What evidence should be reviewed, and when would a follow-up DoE be appropriate?
  9. What knowledge from Product T could inform Product 31, and what differences would prevent direct reuse?
  10. How do the four ICH Q10 system elements and its two enablers help turn commercial experience into organizational learning?

Bridge back to the week

Next: From Raw Signal to Resolved Signal. Return to Week 12.

Sources

Product T, its factor ranges, response values, effect sizes and design-space diagrams are constructed for teaching. This reading does not establish a validated process or actual product specifications.


  1. M. E. Aulton and K. M. G. Taylor (eds.), Aulton’s Pharmaceutics, 5th ed. (Elsevier, 2018), chapters on tableting excipients, for the effect of magnesium stearate blending on dissolution. ↩︎

  2. G. E. P. Box, “Use and Abuse of Regression,” Technometrics 8(4) (1966) 625–629. DOI. ↩︎

  3. R. A. Fisher, The Design of Experiments (Oliver and Boyd, 1935). ↩︎

  4. R. A. Fisher, “The Arrangement of Field Experiments,” Journal of the Ministry of Agriculture of Great Britain 33 (1926) 503–513. ↩︎

  5. R. A. Fisher, Presidential address to the First Indian Statistical Congress, Sankhyā 4 (1938) 14–17. ↩︎

  6. ISA-88 (IEC 61512), Batch Control, series of standards. ↩︎

  7. G. E. P. Box, J. S. Hunter and W. G. Hunter, Statistics for Experimenters, 2nd ed. (Wiley, 2005). ↩︎

  8. Minitab, “Phases of a designed experiment,” Minitab Help. Link. ↩︎

  9. B. Jones and C. J. Nachtsheim, “A Class of Three-Level Designs for Definitive Screening in the Presence of Second-Order Effects,” Journal of Quality Technology 43(1) (2011) 1–15. ↩︎

  10. Minitab, “How Minitab adds center points,” Minitab Help. Link. ↩︎

  11. Minitab Blog, “Design of Experiments: Fractionating and Folding a DOE.” Link. ↩︎

  12. Minitab, “What is folding?,” Minitab Help. Link. ↩︎

  13. R. L. Plackett and J. P. Burman, “The Design of Optimum Multifactorial Experiments,” Biometrika 33(4) (1946) 305–325. DOI. ↩︎

  14. Minitab, “Available 2-level factorial designs,” Minitab Help. Link. ↩︎

  15. U. Grömping, “R Package FrF2 for Creating and Analyzing Fractional Factorial 2-Level Designs,” Journal of Statistical Software 56(1) (2014). DOI. ↩︎

  16. G. E. P. Box and K. B. Wilson, “On the Experimental Attainment of Optimum Conditions,” Journal of the Royal Statistical Society B 13(1) (1951) 1–45. ↩︎

  17. G. E. P. Box and D. W. Behnken, “Some New Three Level Designs for the Study of Quantitative Variables,” Technometrics 2(4) (1960) 455–475. ↩︎

  18. Minitab, “Response surface central composite and Box-Behnken designs,” Minitab Help. Link. ↩︎

  19. NIST/SEMATECH, “Central composite designs,” e-Handbook of Statistical Methods. Link. ↩︎

  20. R. V. Lenth, “Response-Surface Methods in R, Using rsm,” Journal of Statistical Software 32(7) (2009). DOI. ↩︎

  21. G. Derringer and R. Suich, “Simultaneous Optimization of Several Response Variables,” Journal of Quality Technology 12(4) (1980) 214–219. ↩︎

  22. ICH, Q8(R2) Pharmaceutical Development (2009). The other quality guidelines cited (Q9(R1), Q10, Q11, Q12, Q14, Q2(R2)) are at ich.org. ↩︎ ↩︎

  23. ICH, Q14 Analytical Procedure Development (2023). ↩︎

  24. FDA, Process Validation: General Principles and Practices, Guidance for Industry (January 2011). Link. ↩︎

  25. ICH, Q10 Pharmaceutical Quality System (2008), particularly sections 1.6 and 3.2. FDA page. ↩︎

4 - From Raw Signal to Resolved Signal

Clean and align analytical signals, investigate overlapping components with MCR-ALS and PARAFAC, and connect spectral flow cytometry to the same mathematical framework.

The one idea

A model compares numbers in columns. Before that comparison means anything, the same column has to mean the same chemistry in every sample, and a single peak has to be a single compound.

Remove nuisance variation without removing chemical information. A predictive model cannot tell a change in the measurement system from a change in the product unless the data and the experimental evidence allow it to.

Reading 1 introduced preprocessing for tables and spectra, reading 2 compared predictive models, and reading 3 showed why designed experiments matter. Here we return to the analytical measurement itself. A chromatogram is a time-ordered signal, not a collection of interchangeable predictors. It needs two more steps: alignment, so that column 1,402 is the same peak in every run, and resolution, so that one peak is one compound. This reading works through both, then shows that the resolution mathematics reaches as far as flow cytometry.

The case: stability profiles that will not line up

Slide 1, titled 'From raw signal to resolved signal', subtitled 'HPLC-DAD stability profiles: clean, align, then estimate overlapping chemical contributions.' Top row, four panels of signal against retention time: raw chromatograms, three offset traces with peaks near 2, 5 and 8 minutes on a noisy, drifting baseline (baseline plus noise plus drift); clean the signal, the same traces smooth and flat (baseline correction plus smoothing); align retention time, the peaks lined up across traces (match chemically equivalent peaks); resolve overlap, a single observed peak split into a large API component centred at 5.02 minutes and a small minor component centred at 4.98 minutes on its leading edge (estimate components using DAD). Bottom row: 'Product T stability case: 90 HPLC-DAD traces, 3 column lots, 18 months, lot 3 retention about 4% later; PCA initially detects the column lot, not necessarily chemical change.' Before alignment, a PC1 against PC2 scores plot with three separate clusters, one per column lot. After alignment, a PC1 against PC3 scores plot with the lots intermixed and one point, labelled 18-month sample, standing apart at the top right. Both plots are marked as illustrative PCA scores, not measured data. Takeaway: remove nuisance variation without removing chemical information.
Product T stability case: 90 HPLC-DAD chromatograms, three column lots and 18 months. Column lot 3 elutes about 4% later. The traces and the overview PCA panels are schematic; Figure 2B below is calculated from the exercise data. The overlap panel uses the same component centres as Figure 3: minor at 4.98 min, API at 5.02 min.

Product T’s stability study has 90 HPLC-DAD chromatograms from three column lots over 18 months. QA wants a PCA of the impurity profiles to see whether any time point drifts from the pattern. The first attempt clusters perfectly, by column lot. Retention times on lot 3 run about 4% later, so every peak sits in a different column of the data matrix. The PCA has found the column, not the chemistry. A high-quality statistical fit is not necessarily a useful analytical result: the model has found real variation, but not the variation it was meant to find.

The response is not to delete every source of variation that makes the scores plot inconvenient. First understand the measurement. Then decide which sources of variation should be corrected, which should be retained and which need an investigation.

OperationWhat changes?What should be preserved?
CleaningBaseline or high-frequency noiseReal peak area, shape and small features
AlignmentThe time coordinate of comparable featuresChemical identity and genuine differences
Resolution or unmixingEstimated contributions to a composite measurementChemically defensible component information

Physical separation and mathematical resolution are complementary. The chromatographic method creates differences in retention; a multivariate detector may add differences in spectral response. If the measurements do not distinguish the components, no algorithm can reliably recover their individual contributions without further assumptions or evidence.

Step 1: clean the signal

A gradient can produce a drifting baseline, detector noise can hide small peaks, and peak detection depends on the processing settings. These are the same tools as for spectra in reading 1, applied along the time axis.

OperationPrincipleRisk if overapplied
Baseline correctionEstimate a slowly varying background, for example by asymmetric least squares (a smooth curve fitted mostly under the signal), and subtract itRemoving a broad chemical peak
SmoothingFit local polynomials (Savitzky–Golay) or otherwise attenuate noiseChanging peak height, width or area; merging nearby peaks
Peak detectionLocal maxima above a noise threshold, or zero-crossings of the first derivativeMissing weak impurities or treating noise as peaks. Thresholds decide what a “peak” is, so they are method parameters

A baseline correction is not a justification for deleting an unexplained signal. Choose parameters using representative blanks, standards, low-level impurities and stressed samples. Compare the processed result with the original trace, especially where a small peak sits next to the main API peak.

The controls should match the intended use. An exploratory fingerprinting workflow can tolerate processing choices that would need much more supporting evidence in an impurity quantitation or release procedure. Keep the original signal, and record the processing settings and software version.

Step 2: align the peaks

Slide 2, titled 'Peak alignment: correct the time axis', subtitled 'Schematic time mappings: start with the least flexible alignment that corrects the drift.' Four panels plot time offset (0 to 1) against reference time (0 to 10): RRT, relative retention, a straight line from 0 to 0.5, one anchor and a proportional stretch, low flexibility; PTW, polynomial warp, a smooth upward curve to about 0.8, smooth global warp; COW, segment warping, a line made of straight segments with changing slope, local segment adjustment; DTW, dynamic warping, an irregular stepped path to about 0.9, high flexibility, constrain it. Lower left, 'Observed: a new peak is not a time shift': a reference peak at 5.0 minutes and an aged-sample peak slightly later at about 5.05 minutes with a small shoulder labelled 'new feature' near 4.7 minutes. Lower right, 'Analytical guardrails': 1, use known anchor peaks; 2, constrain and inspect the warp; 3, compare aligned and unaligned results; 4, investigate unexplained features. Note: a visually better match is not proof of chemical equivalence. Takeaway: align known equivalents; never warp away a real degradant.
Alignment methods differ in flexibility. The time offsets illustrate possible correction shapes; they are not fitted warps from Product T. The new shoulder must be investigated, not forced into agreement with the reference.

Retention time drifts with column age, column lot, mobile-phase preparation and temperature. A detector sampling at regular intervals produces columns indexed by time, so if the same compound elutes at two different times, comparing raw columns manufactures an apparent difference. Alignment corrects that coordinate mismatch.

Choose the least flexible correction that works

MethodHow it worksWhen to consider it
Relative retention time (RRT)Divide retention time by a reference peak’s retention timeApproximately proportional shifts
Parametric time warping (PTW)Fit a smooth, low-order polynomial transformation of the time axisGlobal shifts, stretching or modest nonlinear drift1
Correlation optimized warping (COW)Stretch or compress segments to maximize correlation with a referenceLocal changes in retention behaviour2,3
Dynamic time warping (DTW)Find a constrained point-by-point matching path through two ordered sequencesMore complicated timing differences4,3

RRT is the entry point, and you have used it all term: a one-parameter alignment, a stretch anchored on one peak. Suppose a reference chromatogram has its API at 5.00 min and an impurity at 4.85 min. A second column elutes both 4% later: 5.20 and 5.044 min. In both cases the impurity’s RRT is 0.970, because the relative timing is unchanged. (This arithmetic example is separate from the Product T minor component below.) If early and late peaks shift by different proportions, RRT alone is not enough.

reference <- c(impurity = 4.85, api = 5.00)
lot3 <- reference * 1.04          # column lot 3 elutes 4% later
reference / reference["api"]
lot3 / lot3["api"]
# impurity = 0.97; api = 1.00 for both

PTW models the time axis of each sample as a low-order polynomial, usually quadratic, of the reference time axis, and finds the coefficients that best match the reference. Few parameters means the warp is smooth and hard to overfit.

library(ptw)

fit <- ptw(ref = reference_trace,      # a representative chromatogram
           samp = lot3_traces,         # rows = chromatograms
           init.coef = c(0, 1, 0),     # start from "no warp": shift 0, stretch 1, curve 0
           warp.type = "global")       # one warp for all samples of this lot
aligned <- fit$warped.sample
fit$warp.coef                          # the warp itself, which you inspect

In a predictive workflow, reference selection and any learned alignment parameters belong inside the training procedure, as in reading 1’s recipe; assessment samples must not be used to tune them. A new sample is then mapped to the frozen reference by the predefined procedure.

COW and DTW, the latter borrowed from speech recognition, handle uneven drift that a polynomial cannot. Both are more flexible, which brings the danger below.

The danger: warping away a real difference

A stability-indicating procedure exists to reveal a peak that was not there before. If a flexible algorithm slides an unfamiliar shoulder onto a neighbouring known peak, the mathematical agreement improves while the chemical interpretation gets worse. Tomasi and colleagues showed how unconstrained DTW in particular can distort peak shapes3.

  • Warp on anchor peaks chosen on scientific grounds and known to be present in every sample.
  • Constrain the permitted time displacement, and use the least flexible method that works.
  • Inspect the warping function. It should be smooth and monotonic, and similar across samples from the same column lot. Monotonic preserves peak order, but does not on its own establish chemical equivalence.
  • Run the analysis aligned and unaligned. A feature that appears in only one of them needs explaining.
  • Where peak areas matter, check the effect of resampling: integration on a warped time axis need not preserve area.

Follow the evidence: scores and loadings

Slide 2B, titled 'Follow the evidence: PC3 points to the API leading edge', subtitled 'Product T, 90 simulated chromatograms, three lots, one 18-month candidate.' Panel 1, before alignment: absorbance against observed time, the reference lot 1 peak centred at 5.02 min and the candidate lot 3 peak at about 5.22 min; column lot 3 shifts retention by 4%. Panel 2, after alignment: on the aligned time axis the two peaks coincide, but the 18-month candidate is taller with extra signal on the leading edge; dashed lines at 4.98 and 5.02 min; shift removed, excess signal remains. Panel 3, PC3 loading against aligned time: a single positive peak with its maximum marked 'minor centre: 4.98'; the loading localizes the difference. Panel 4, scores identify a candidate: PC3 score against PC1 score for all 90 traces, every sample near zero except one red point, the 18-month candidate, at about 0.53; exploratory PCA of all 90 traces. Panel 5, confirm with independent chemistry: loading, then peak window, then DAD and MCR, then LC-MS; a loading is an investigative lead, not a compound identity; PC signs are arbitrary, the feature location is meaningful. Takeaway: scores tell us which sample; loadings tell us where to look.
Calculated from the exercise's synthetic dataset, not a schematic. The minor component is centred at 4.98 min and the API at 5.02 min. The largest absolute PC3 loading is near 4.97 min: a loading maximum need not coincide exactly with the centre of a chemical peak. PCA signs are arbitrary.

After the timing correction, the column-lot clustering disappears and one 18-month sample stands apart on PC3. The scores identify which sample is unusual; the loading identifies where in the signal to look. Compare the candidate with the reference on both time axes: the lot 3 API is observed near 5.22 min (5.02 × 1.04), and once the shift is corrected, excess absorbance remains on the API’s leading edge. That is an investigative lead, not the identity of a new impurity. The next step is the DAD peak window and orthogonal evidence, not a name assigned from PCA.

Try it in R: the Product T exercise

Download the R scripts and simulated data (ZIP, 0.4 MB). Extract it into a working folder and, from the folder that contains examples/, run:

source("examples/product_t_signal.R")

The core exercise needs only base R 4.1 or later. It reads 90 simulated chromatograms (three column lots × six stability time points, 0 to 18 months × five replicates), cleans and aligns them, and runs the PCA behind Figure 2B. Lot 3 has a 4% proportional timing shift, and one sample, L3-M18-R5, contains the simulated minor component. To keep the exercise transparent, alignment uses known anchor ratios from the metadata rather than a fitted warp; PTW is an optional extension. The script creates time, clean, aligned_time, aligned, reference_trace, lot3_traces, peak_window, pca_after, pc3, scores3 and candidate, and writes two plots to examples/output/.

plot(aligned_time, pc3, type = "l",
     xlim = c(4.65, 5.4), xlab = "Aligned time (min)",
     ylab = "PC3 loading")
abline(v = 4.98, col = "red", lty = 2)   # simulated minor-component centre

Expected results: candidate L3-M18-R5, the largest absolute PC3 loading near 4.97 min, and a candidate PC3 score far outside the other 89. This PCA includes all 90 samples by design: it is an investigation, not a validated anomaly detector. For monitoring, fit the preprocessing and PCA on an independent reference population, then project new samples and assess detection performance.

For the optional extension, install ptw and mdatools and source examples/optional_ptw_mcr.R. It fits the global PTW warp and the two-component MCR shown in this reading to the exercise data. Compare the estimated warp with the known 4% mapping, and the MCR solution with the simulation’s true profiles; they need not match exactly, for the reasons in Step 3.

Classroom question: if the aligned scores plot looks better, what evidence would convince us that we have not removed the very signal the stability study was meant to detect?

Step 3: resolve what overlaps

DAD peak purity flags the API peak at 18 months as possibly impure. Week 8 was clear that peak purity is supporting evidence, not proof: similar spectra, low impurity levels and noise all limit its ability to detect co-elution. Mathematical resolution can support the investigation, interpreted alongside chemical evidence.

MCR-ALS: separating overlapping compounds

Slide 3, titled 'MCR-ALS: resolve overlapping compounds', subtitled 'A diode-array detector records an absorbance spectrum at every chromatographic time point.' Three panels: measured matrix D, a heat map of retention time (4.6 to 5.4 min) against wavelength (220 to 340 nm) with one bright spot near 5.0 min and 265 nm; elution profiles C, a large API peak labelled 5.02 min and a small minor peak labelled 4.98 min; pure-component spectra S, the API spectrum peaking near 263 nm with a shoulder near 300 nm and the minor component peaking near 278 nm. Centre, the equation D = C Sᵀ + E. Lower left, 'Alternating least squares': start with estimated spectra S, solve C; use estimated C, solve S; repeat. Chemical constraints: non-negativity, peak unimodality, known reference spectra where justified. Lower right, 'Rotational ambiguity': C Sᵀ = (C T)(T⁻¹ Sᵀ). Different component profiles can reconstruct the same D; constraints reduce ambiguity; orthogonal evidence (LC-MS) helps confirm the candidate degradant. Takeaway: a good mathematical fit is not proof of a unique chemical solution.
Multivariate curve resolution works on a matrix of absorbance across time and wavelength. The profiles and spectra shown are the simulation's ground truth (the exercise's DAD window), not an independently fitted MCR solution or identified Product T compounds.

A single-wavelength detector records absorbance against retention time. A DAD records many wavelengths at each time. Arrange the data for the peak window as a matrix DD : rows are time points, columns are wavelengths. If absorbance is additive and each component’s spectral shape is stable, the data follow a bilinear model:

D=CST+E D = C S^{\mathsf T} + E
MatrixDimensionsScientific interpretation
DDtime points × wavelengthsObserved absorbance
CCtime points × componentsElution (concentration) profiles
SSwavelengths × componentsPure-component spectra
EEtime points × wavelengthsResidual the model does not explain

Multivariate curve resolution by alternating least squares (MCR-ALS) estimates both CC and SS 5. Start from a guess at SS , solve for CC by least squares, use CC to solve for SS , and repeat until stable. Chemical knowledge enters as constraints, used only where chemically justified:

  • Non-negativity: concentrations and absorbances cannot be negative.
  • Unimodality: a chromatographic elution profile has one maximum.
  • Known spectra: if a pure standard is available, fix its spectrum.
  • Closure is a different kind of constraint, appropriate only when a total is known.
library(mdatools)

m <- mcrals(peak_window, ncomp = 2,
            cont.constraints = list(constraint("nonneg"), constraint("unimod")),
            spec.constraints = list(constraint("nonneg")))
plotSpectra(m)          # resolved pure spectra
plotContributions(m)    # resolved elution profiles

At any one retention time the API and a small overlapping degradant add up to a single absorbance. Across many wavelengths their relative absorbances differ, which gives more information, though not automatically a unique answer. For Product T, a two-component model resolves a minor component eluting about 0.04 min before the API, with a shifted spectral maximum. It is a candidate degradant: LC-MS is the orthogonal test of identity, and a quantitative impurity claim would also need response factors or suitable calibration.

Rotational ambiguity: why chemistry has to choose

For any invertible matrix TT ,

CST=(CT)(T−1ST) C S^{\mathsf T} = (C T)(T^{-1} S^{\mathsf T})

so different combinations of elution profiles and spectra reproduce the same measured matrix equally well. A low residual cannot, on its own, show that the estimated profiles are pure compounds. There is generally a range of feasible solutions; constraints narrow it, and software can calculate the band that remains. When the band is wide, the resolved impurity level is uncertain by that much. Check sensitivity to initialization, number of components and constraints, and report the uncertainty. A candidate peak and an independently confirmed degradant are not the same claim.

Classroom question: what experiment would distinguish two chemically plausible decompositions that both reproduce the original absorbance matrix?

PARAFAC: add a third measurement dimension

Slide 4, titled 'PARAFAC: add a third measurement dimension', subtitled 'Fluorescence excitation–emission matrices (EEMs) across samples form a three-way array.' Upper left, 'Stack sample EEMs into a data cube': three overlapping heat maps of emission wavelength against excitation wavelength, the front one labelled Sample 3, with the cube labelled sample × excitation × emission. Upper right, 'A component has three linked profiles': for two components, a sample profile across samples 1 to 6, an excitation spectrum (peaks near 275 and 315 nm) and an emission spectrum (peaks near 335 and 385 nm), with the model X_ijk ≈ Σ_r a_ir b_jr c_kr. Lower left, 'Why the third mode helps': a matrix can admit many rotations; a three-way model constrains all three profiles together; essential uniqueness requires suitable rank and structure. Lower right, 'Check the chemical assumptions': component spectral shapes must remain consistent; scatter, inner-filter effects and time shifts can break the trilinear model; biologics example, media fingerprints and protein fluorescence. Takeaway: more independent structure can make component estimates identifiable, if the model fits.
A three-way array can supply structural information a single matrix lacks. The EEMs are simulated. Essential uniqueness depends on appropriate rank, distinguishable profiles and the model's assumptions holding.

A fluorescence excitation–emission matrix (EEM) records emission across many wavelengths for each of many excitation wavelengths. Stack EEMs from many samples and you have a cube: sample × excitation × emission. PARAFAC models it as a sum of components, each the product of three linked profiles6:

Xijk≈∑r=1Rair bjr ckr X_{ijk} \approx \sum_{r=1}^{R} a_{ir}\, b_{jr}\, c_{kr}

Here aa describes how component rr varies across samples, bb its excitation spectrum and cc its emission spectrum. Unlike MCR on a single matrix, the three-way structure can give an essentially unique decomposition, up to scaling and the order of components, because the third mode supplies information a matrix lacks.

In biologics, EEM with PARAFAC is used for cell-culture media raw-material checks and to follow tryptophan and tyrosine environments in proteins. The extra mode helps only when it carries independent information; simply adding a dimension does not guarantee identifiability. The condition is trilinearity: every component must keep the same spectral shape in every sample. Scatter peaks, inner-filter effects and, for LC-DAD cubes, retention-time shifts all break it. That is one more reason alignment comes first.

Evaluate residual structure, component stability and the chemical plausibility of the recovered profiles. Where possible, use independent samples or split-half comparisons to test whether the interpretation is reproducible.

Classroom question: why can another measurement dimension reveal more than simply repeating the same measurement more often?

The same equation in a flow cytometer

Slide 5, titled 'Spectral flow cytometry: the same unmixing equation', subtitled 'Each cell produces a combined detector signal; reference controls supply the component signatures.' Panel 1, reference controls: relative emission across 24 detector channels for dye A (peak near channel 8), dye B (near 13), dye C (near 19) and a broad autofluorescence signature, from single-stained and unstained controls. Panel 2, measured cell emission: one combined curve across the channels, the sum of dye signatures plus autofluorescence. Panel 3, unmixed abundances: a least-squares estimate with known S, bars of A 1.20, B 0.65, C 0.90 and autofluorescence 0.40. Lower left, 'Same mathematics, different unknowns': D = C Sᵀ + E; MCR-ALS estimates C and S; spectral flow takes S from reference controls and solves C. Lower right, 'When signatures are too similar': two almost overlapping emission curves; near-collinearity amplifies uncertainty; unmixing corrects spillover, not measurement spread. Takeaway: reference quality and spectral similarity determine confidence in the unmixed values.
Spectral flow cytometry uses reference signatures to estimate each cell's component signals. The signatures and bars are the idealized ones in the R example below: simulated relative abundances, not molecule counts or measured cell-therapy results.

Week 9 introduced compensation: correcting each detector for spillover from fluorophores it was not meant to see. A spectral flow cytometer generalizes this. It records each cell’s emission across dozens of detectors, and every fluorophore has a full spectral signature. For each cell:

measured emission = Σ (abundance of fluorophore f × signature of f) + autofluorescence + noise

That is D=CST+ED = C S^{\mathsf T} + E again, one row per cell, with a different reading of the matrices:

HPLC-DAD MCR-ALSSpectral flow unmixing
Row of DDChromatographic time pointIndividual cell event
Column of DDWavelengthDetector channel
SSComponent spectra, possibly unknownMeasured reference signatures
CCEstimated elution profilesEstimated fluorescence contributions
Main challengeIdentifiability and chemical constraintsReference quality and spectral similarity

Here SS is known: the signatures come from single-stained reference controls, so the abundances are found by ordinary or weighted least squares. Chemometricians call this classical least squares. Autofluorescence is treated as one more component, with a signature from an appropriate unstained control7. This self-contained base R demonstration uses the same 24 detector channels, three dyes and autofluorescence as Figure 5. The signatures are idealized, not real dye reference controls:

channel <- 1:24
g <- function(x, mu, sigma) exp(-0.5 * ((x - mu) / sigma)^2)   # Gaussian signature
S <- cbind(A    = g(channel, 8, 3),
           B    = g(channel, 13, 3),
           C    = 0.7 * g(channel, 19, 2.8),
           Auto = 0.6 * g(channel, 5, 5))           # autofluorescence
truth <- c(A = 1.20, B = 0.65, C = 0.90, Auto = 0.40)
y <- drop(S %*% truth)                # one cell's measured emission
estimate <- qr.solve(S, y)            # least-squares unmixing
round(estimate, 2)
#    A    B    C Auto
# 1.20 0.65 0.90 0.40
barplot(estimate, ylab = "Relative component contribution")

Least squares recovers the known coefficients in this noiseless, full-rank example. The values depend on how the reference signatures are scaled; they are not concentrations or molecule counts. Add noise to y, or move two signature maxima closer together, and repeat to see the uncertainty grow.

The chemometric cautions carry over.

  • Wrong reference signature, wrong answer. A tandem dye that has degraded in the stained sample, but not in its reference control, unmixes into the wrong channels.
  • Similar signatures amplify noise. If two signatures are nearly proportional, the matrix is poorly conditioned, and small changes in measured emission cause large changes in the estimates: the same instability collinear predictors cause in regression. Panel design software reports a similarity or complexity index for exactly this reason.
  • Unmixing removes spillover, not spread. As Week 9 said of compensation, measurement noise propagates into the resolved values. Negative values after unconstrained unmixing are expected, not necessarily a faulty event.

Where the analyst sits

The analyst decides what is information and what is measurement variation. They decide how much warping is acceptable before a real difference could be hidden, choose and justify MCR constraints, report a range when rotational ambiguity is wide, and know that a spectral cytometer’s unmixed value is only as good as its reference controls. In each case the mathematics produces an answer; chemical knowledge decides whether it is the right one.

A processing sequence is not just code. Its reference selection, parameters, acceptance criteria, software versions and review steps all shape the reported result, so it is part of the analytical procedure. Under ICH Q14 and Q2(R2)8, define the intended use and performance criteria, assess the risks, challenge preprocessing choices with representative samples, and demonstrate the performance of the complete procedure. Use the designed experiments of reading 3 to investigate sensitive settings such as smoothing window, permitted time shift and reference-signature selection. Preserve raw data, processing history and reviewable evidence; changes to a controlled procedure need appropriate assessment.

In practice: what is the instrument software doing?

Commercial chromatography data systems (CDS), including Waters Empower, Thermo Scientific Chromeleon and Agilent OpenLab CDS, run processing methods for peak detection, integration and identification; some configurations add spectral processing such as peak purity. Spectral-cytometer software such as Cytek SpectroFlo unmixes using reference controls. Exact capabilities depend on the product, version, options and configured method: do not assume that a platform implements PTW, MCR-ALS or PARAFAC.

Ask the same questions of vendor software that you would ask of an R pipeline:

  • Which processing parameters and reference controls are specified?
  • Which are locked or permission-controlled, and which changes need documented justification and review?
  • Which steps have supporting analytical performance evidence?
  • Can a reviewer reconstruct the result from the original signal, method version and processing history?

System qualification or software validation alone does not show that the selected processing procedure is fit for its analytical purpose. Vendor documentation for discussion: Waters Empower processing methods, Thermo Fisher on Chromeleon data-processing controls, Agilent OpenLab processing methods and Cytek SpectroFlo.

Physical separation creates differences we can measure. Chemometrics extracts information from differences we have measured. Neither replaces chemical understanding or evidence of analytical performance.

For discussion

  1. When is relative retention sufficient, and when should a more flexible alignment method be considered?
  2. A DTW-aligned PCA shows no stability trend; the unaligned chromatograms show a new shoulder at 12 months. Which do you believe, and what should the analyst investigate?
  3. Why is a low MCR residual insufficient to demonstrate the identity and amount of a degradant?
  4. What assumptions must hold for PARAFAC to give an essentially unique decomposition, and why is MCR on a single matrix not unique?
  5. What happens to the uncertainty of each unmixed value when two fluorophore signatures are nearly collinear, and what is the regression analogue?
  6. How would you use a designed experiment to establish smoothing or alignment settings for a stability-indicating workflow?

Bridge back to the week

Next: Watching a Biologic Batch Grow, where time warping returns to align bioreactor runs. Return to Week 12.

Sources

Product T’s stability profiles, the column-lot drift, the resolved component and all five figures are constructed for teaching, not experimental findings.


  1. P. H. C. Eilers, “Parametric Time Warping,” Analytical Chemistry 76(2) (2004) 404–411. DOI. R package: ptw on CRAN. ↩︎

  2. N.-P. V. Nielsen, J. M. Carstensen and J. Smedsgaard, “Aligning of single and multiple wavelength chromatographic profiles for chemometric data analysis using correlation optimised warping,” Journal of Chromatography A 805 (1998) 17–35. DOI. ↩︎

  3. G. Tomasi, F. van den Berg and C. Andersson, “Correlation optimized warping and dynamic time warping as preprocessing methods for chromatographic data,” Journal of Chemometrics 18(5) (2004) 231–241. DOI. ↩︎ ↩︎ ↩︎

  4. H. Sakoe and S. Chiba, “Dynamic programming algorithm optimization for spoken word recognition,” IEEE Transactions on Acoustics, Speech, and Signal Processing 26(1) (1978) 43–49. DOI. ↩︎

  5. R. Tauler, “Multivariate curve resolution applied to second order data,” Chemometrics and Intelligent Laboratory Systems 30(1) (1995) 133–146. DOI. R implementation: mdatools. ↩︎

  6. R. Bro, “PARAFAC. Tutorial and applications,” Chemometrics and Intelligent Laboratory Systems 38(2) (1997) 149–171. DOI. ↩︎

  7. L. M. Park, J. Lannigan and M. C. Jaimes, “OMIP-069: Forty-Color Full Spectrum Flow Cytometry Panel for Deep Immunophenotyping of Major Cell Subsets in Human Peripheral Blood,” Cytometry Part A 97(10) (2020) 1044–1051. DOI. ↩︎

  8. ICH, Q14 Analytical Procedure Development (2023) and Q2(R2) Validation of Analytical Procedures (2023). ICH quality guidelines. ↩︎

5 - Watching a Biologic Batch Grow

Follow a CHO fed-batch from Raman soft sensors and three-way batch data through maturity alignment, multivariate monitoring, investigation and lifecycle learning.

The one idea

A batch process is judged by its whole path, not its endpoint. Multivariate batch monitoring asks, at every hour, whether this batch is travelling the way good batches travelled, and points to which variables are off course.

Week 11 followed a continuous tablet line, where the question is whether this minute’s material is in control. A biologic fed-batch asks a different question: is this batch’s history so far normal? The tools from Week 11 reading 7, PCA scores, Hotelling’s T² and the Q residual, carry over. What changes is the shape of the data and the meaning of time. The aim is to understand and control the process while the product is being made, rather than depend entirely on tests after harvest.

This reading draws on tidy data, designed experiments and alignment and applies them to process analytical technology (PAT).

The case: a monoclonal antibody at day 6

Slide 01, titled 'A Bioreactor Is a Living Manufacturing Process', subtitled 'Monitor a 2,000 L CHO fed-batch as cells grow, consume nutrients and produce antibody.' Centre, a flat illustrated cutaway of a 2,000 L fed-batch CHO culture vessel with labelled gas inlets (O₂, CO₂, air), nutrient feed pump, base pump, impeller, sparger, Raman probe (fibre optic), capacitance probe (viable biomass) and sampling port. Left panel, process instrumentation, for example every minute: pH (culture conditions), dissolved oxygen (oxygen availability), temperature (growth and productivity), agitation and gas flow (mixing and mass transfer), base addition (pH-control demand). Right panel, biological measurements: Raman plus PLS for glucose, lactate, glutamine, ammonium and antibody titer, for example hourly; capacitance for viable biomass, with VCD requiring calibration, for example every minute; offline reference samples for cell density, viability, osmolality and metabolite reference values, for example daily. Bottom, a timeline: inoculation day 0, cell growth approximately days 0 to 5, production approximately days 4 to 14, harvest approximately day 14. Takeaway: a biologic batch is a trajectory, not simply an endpoint.
The physical process and its measurement streams. The vessel is an illustrative rendering, not an engineering drawing. Capacitance responds to viable biomass; converting it to viable cell density needs calibration. Stage timing is product-specific.

A Chinese hamster ovary (CHO) cell line makes a monoclonal antibody in a 2,000 L fed-batch bioreactor over about 14 days. Feeds add nutrients during the run, without the continuous harvest of a perfusion process. The impeller and sparger provide mixing and gas transfer; pH, dissolved oxygen and temperature are controlled. The cells change their own environment as they grow, so the relationships among the variables shift over the batch.

Data streamFrequencyExamples
Process sensorsEvery minutepH, dissolved oxygen, temperature, agitation, gas flows, base addition
In-line Raman, through a PLS modelEvery hourGlucose, lactate, glutamine, ammonium, titer
Capacitance probeEvery minuteViable biomass
Off-line samplesDailyViable cell density, viability, osmolality, metabolite checks

These streams measure different things. A pH probe gives an electrochemical response. A Raman instrument gives a spectrum from which a concentration is inferred. A feed-pump record is an actuator setting, not a measure of metabolism. Treating them as interchangeable columns hides that difference.

A typical culture grows, shifts toward production as growth slows, keeps accumulating titer, and is harvested as viability falls. The exact profile depends on the cell line, medium and feeding strategy.

Batch 27 looks normal on every individual chart. Every variable is inside its own limits. At day 6, the multivariate monitoring screen flags it.

Teaching question: Is 2 g/L glucose acceptable? Before answering, ask about the product, the stage of the batch and the feeding strategy.

Raman as a soft sensor

Slide 02, titled 'Raman Spectroscopy as a Soft Sensor', subtitled 'From molecular vibrations to model-based concentration estimates and controlled feeding.' Top, a photo of an illustrative Raman probe on a vessel port beside a flow of six boxes: Raman spectrum, preprocess and scale, PLS calibration, glucose prediction, model and safety checks, feed controller, with a return arrow labelled 'controlled feed returns to the vessel, fallback if invalid'. Bottom, three panels: 1, Spectrum, a simulated Raman spectrum from 600 to 1,800 cm⁻¹ with six peaks; 2, Calibration, predicted against reference glucose from 0 to 10 g/L, points close to the identity line; 3, Designed variation, lactate against glucose, with historical points (orange crosses) lying along a rising diagonal and designed points (green circles) on a grid of glucose 1, 3, 5, 7 g/L by lactate 1, 3, 5 g/L. Note: all spectra and calibration points are simulated; each predicted analyte needs supporting evidence. Takeaway: measure a spectrum, infer concentration, check the model before acting.
The soft sensor turns a spectrum into an estimated concentration. Historical glucose and lactate rise together; a designed calibration breaks that correlation. The plots are simulated, and the feedback loop shows a possible application, not a validated control system.

Raman spectroscopy measures light scattered inelastically by molecular vibrations, through a probe in the vessel wall. Water is a weak Raman scatterer, which is why Raman suits aqueous culture better than NIR, although fluorescence and other matrix effects still matter. A culture spectrum holds contributions from many molecules, so a PLS model, built as in Week 11, converts each spectrum into metabolite concentrations, calibrated against off-line reference analysers. For one analyte the prediction is

y^=b0+xTb \hat y = b_0 + \mathbf{x}^{\mathsf T}\mathbf{b}

where x\mathbf{x} is the preprocessed spectrum, b\mathbf{b} the fitted coefficients and y^\hat y the predicted concentration.

This is a soft sensor: the probe, acquisition settings, preprocessing and calibration together. A Raman glucose value is an inference from a model, with an applicability domain, not a direct glucose measurement. Abu-Absi and colleagues showed in-line Raman estimation of several culture parameters at 500 L1. That shows the approach is feasible; it does not show that a model calibrated for one process will work in another.

Designed calibration versus happenstance data

In ordinary batches glucose and lactate move together. A model trained on those batches can learn to predict glucose from lactate’s spectral bands. It will cross-validate well and then fail on the first batch where the metabolic relationship changes, which is exactly the batch you most need it for.

That is reading 3’s lesson applied to a calibration set. Build in designed variation, such as glucose spiked independently of lactate, so that each analyte has to be predicted from its own signal. Cover the media lots, cell lines, stages and scales the model will meet. Spiked samples improve chemical discrimination but do not replace representative process samples. When estimating performance, keep all samples from one batch in the same fold, for the reason given in reading 1.

From prediction to control

The prize is control, not just monitoring: hourly glucose predictions can drive the feed pump in a closed loop. The controller must then cope with prediction error, measurement delay, pump limits and an invalid prediction. An applicability-domain check, sensor health checks and a predefined fallback belong in the design. A failed soft sensor must not silently drive the process.

Under ICH Q14 and Q2(R2)2, the model and its preprocessing are part of an analytical procedure whose performance must be shown for its intended use. A model good enough for trending is not automatically good enough for closed-loop control.

Batch data is a cube

Slide 03, titled 'Batch Data Is a Three-Dimensional Cube', subtitled 'Same measurements, different representations: choose the observation to match the question.' Three panels. Left, aligned batch data: a cube of 20 batches by 10 variables by 336 hourly records, 20 × 10 × 336 = 67,200 measurements, stored as one long tidy table of batch, hour, variable, value. Centre, batch-wise unfolding: a 20 × 3,360 heatmap, one row is one entire batch, columns are 3,360 variable-time features; used to compare entire trajectories and predict final quality; note that online use needs a strategy for handling future data. Right, observation-wise unfolding: a 6,720 × 10 heatmap, one row is one batch-hour, columns are 10 process variables; used to monitor the current state and compare stage-matched scores; note that time points within a batch are not independent batches. Footer: schematic cube and heatmaps, displayed cells are not drawn to the labelled dimensions. Takeaway: the structure of the data determines the question the model can answer.
Twenty aligned batches, ten variables and 336 hourly records, unfolded two ways. The heatmaps show matrix shapes, not measurements.

Each batch gives a table of variables over time. Stack the batches and you get a three-way array,

X∈RI×J×K \mathcal{X} \in \mathbb{R}^{I \times J \times K}

with II batches, JJ variables and KK aligned time points. Twenty batches, ten variables and 336 hourly records give 20×10×336=67,20020 \times 10 \times 336 = 67{,}200 entries.

The choice of observational unit matters as much here as in reading 1, where a dissolution vessel was not a batch. An hour of a bioreactor run is not an independent run either. Instruments also report at different rates, so before building the cube, set rules for sampling or aggregating, handle missing values, and keep the batch and time stamp on every row. A daily lab result copied into 24 hourly rows is still one result.

Classical PCA needs a matrix, so the cube is unfolded. Unfolding rearranges the data; it creates no new observations. The two ways of doing it answer different questions3,4.

UnfoldingShapeExampleOne row isQuestion it answers
Batch-wiseI×JKI \times JK20 × 3,360A whole batchWas this batch, taken as a whole, like the good ones? How does its trajectory relate to final quality (titer, glycan profile)?
Observation-wiseIK×JIK \times J6,720 × 10One time point of one batchIs this batch, right now, where good batches were at this stage? This is the batch evolution model

Nomikos and MacGregor introduced batch-wise multiway PCA for batch monitoring in 19943. Wold and colleagues developed the observation-wise batch evolution approach in 19984. A batch-wise model can be used on a running batch only with an established method for filling in the hours that have not happened yet; feeding it the batch’s real future values would be leakage.

In R: an observation-wise control chart

In tidy terms, the stored data are one long table with one row per batch, hour and variable. Unfolding is a choice of how to pivot it. The sketch assumes every batch, Batch 27 included, has already been aligned to a common time axis and is complete, and that good_batches was chosen in advance.

library(tidyverse)

ref <- runs |>                                    # long, tidy: batch, hour, variable, value
  filter(batch %in% good_batches) |>
  pivot_wider(names_from = variable,              # observation-wise: one row per batch-hour
              values_from = value)

variables <- setdiff(names(ref), c("batch", "hour"))

pca <- prcomp(select(ref, all_of(variables)),     # fit on reference batches only
              center = TRUE, scale. = TRUE, rank. = 3)

envelope <- ref |>
  mutate(t1 = pca$x[, 1]) |>
  group_by(hour) |>
  summarise(mid = mean(t1),
            lo  = mid - 3 * sd(t1),
            hi  = mid + 3 * sd(t1))               # the normal path of PC1, with limits

batch27 <- runs |>
  filter(batch == 27) |>
  pivot_wider(names_from = variable, values_from = value)

chart <- batch27 |>
  mutate(t1 = predict(pca, select(batch27, all_of(variables)))[, 1]) |>   # frozen centring, scaling, loadings
  left_join(envelope, by = "hour")

Plot t1 hour by hour against lo, mid and hi, and you have a batch control chart. Batch 27 is projected with the reference model’s centring, scaling and loadings; it never influences them. The mean ± 3 SD band is a teaching choice, not a validated limit. A full batch evolution model regresses on batch maturity with PLS rather than plain PCA, and adds T² and Q at every time point. In practice you would also remove constant variables before scaling, choose the number of components deliberately, and check the false-alarm rate on batches the model has not seen.

Teaching question: Are the 6,720 rows 6,720 independent observations? No. Rows from the same batch share a history, and neighbouring hours are correlated.

Batches are not the same length

Slide 04, titled 'Batch Alignment: Clock Time versus Biological Time', subtitled 'A 10-hour delay is not automatically a quality problem, but the delay remains evidence.' Three panels of viable cell density (relative units). 1, Clock time: against hours after inoculation (0 to 336), a reference S-shaped growth curve, the same curve about 10 hours behind, and a dashed abnormal curve that plateaus lower, at about 12 instead of 16; caption 'same hour is not the same biological stage'. 2, Time mapping: running batch time against reference time, a straight purple line offset 10 hours above the dashed identity line; caption 'constrain the warp; monitor its size'. 3, Biological time: against reference-equivalent time, the delayed curve now lies on the reference, while the abnormal curve still plateaus lower; caption 'do not normalize away abnormality'. Box: maturity indicators, cumulative glucose consumption or integrated viable cell density; online alignment must use only measurements available at the current time. Takeaway: align comparable stages without erasing meaningful process differences.
A 10-hour delay, aligned by comparing equivalent stages of growth. The mapping here is a simple shift; real dynamic time warping can stretch and compress locally. The abnormal batch stays distinct after alignment.

Batch 27 was inoculated at a slightly lower cell density and is running about 10 hours behind. Comparing hour 140 with hour 140 compares different stages of growth. Two fixes:

  • Align on a maturity variable that tracks progress better than clock time, such as cumulative glucose consumed or integrated viable cell density (IVCD), the area under the viable cell density curve. Either works only if it suits the process and is measured reliably.
  • Align by dynamic time warping, the same algorithm used for chromatograms, applied to whole batch trajectories to match equivalent stages of growth rather than equivalent peaks. Kassidas, MacGregor and Taylor showed this for batch monitoring in 19985.

The caution from chromatography applies with more force: a warp flexible enough can make an abnormal batch look normal. The warping path itself is a diagnostic. A batch that needed severe warping is unusual, and a 10-hour delay may deserve investigation in its own right. Look at the original time axis, the aligned trajectory and the mapping together, and constrain the warp on scientific grounds. For online monitoring, compute the mapping only from data available so far, never from the batch’s future.

Teaching question: A batch lines up perfectly, but only after a large warp. Is it normal? Why might the delay itself matter for quality or for the manufacturing schedule?

The “golden batch” and why one is not enough

Slide 05, titled 'Beyond the Golden Batch', subtitled 'Use a representative reference population to estimate normal trajectories and variation.' Three panels. 1, One reference batch: a single viable cell density growth curve over 14 days; caption 'one path cannot estimate spread'. 2, 20 acceptable batches: twenty thin overlapping growth curves with their mean in bold and a shaded mean ± 3 SD band; caption 'illustrative pointwise envelope'. 3, Two kinds of unusual behaviour: Q residual (squared error, 0 to 2) against the modelled score on one retained PC (−4 to 4). Two vertical purple dashed lines at about ±2.5 mark the T² limit and a horizontal red dashed line at 1 marks the Q limit. Green reference points sit inside both limits. A red point labelled 'large Q' lies above the Q limit but within the score limits; an orange point labelled 'large T²' lies beyond the right score limit but below the Q limit; caption 'separate T² and Q limits (schematic)'. Box: monitoring limits are not product specifications; evaluate reference selection, time dependence, false alarms and scale transfer. Takeaway: a population of acceptable trajectories is more informative than one perfect batch.
One reference batch gives a path but no spread. A population of good batches gives both. Right: T² and Q have separate limits. A large T² is an extreme position along the modelled direction; a large Q is variation the model does not explain. The envelope and geometry are illustrative, not established control limits.

The phrase golden batch means a reference trajectory to compare against. Taken literally, one best batch, it is a weak standard: a single batch has no variance, so it cannot say how far from it is still normal. The working version is a set of good batches, which defines both the normal path and the normal spread around it. That spread is the control limit. Twenty is an example, not a required minimum; what matters is that the set covers acceptable operation.

For a new biologic this is hard. A commercial product may make only a handful of batches a year, and development batches often come from smaller vessels where mixing, gas transfer and sensor response differ. Which batches count as reference needs written inclusion criteria and a scientific judgment, not whatever historical records are convenient.

Scores, T² and Q

For a centred and scaled observation x\mathbf{x} , let PP hold the retained PCA loadings. Then

t=PTx,e=x−Pt \mathbf{t} = P^{\mathsf T}\mathbf{x}, \qquad \mathbf{e} = \mathbf{x} - P\mathbf{t}

The scores t\mathbf{t} locate the observation in the model; the residual e\mathbf{e} is what the model cannot reconstruct. With Λ\Lambda the diagonal matrix of score variances,

T2=tTΛ−1t,Q=eTe=∑jej2 T^2 = \mathbf{t}^{\mathsf T}\Lambda^{-1}\mathbf{t}, \qquad Q = \mathbf{e}^{\mathsf T}\mathbf{e} = \sum_j e_j^2
StatisticAsks
ScoresWhere is this observation in the modelled space?
T²Is it extreme along directions the reference batches vary in?
Q (SPE)How much of it does the model fail to explain?

High T² with modest Q is an extreme case of a familiar pattern. High Q with modest T² is a combination the reference batches never showed. A change of equipment, calibration or stage can move either.

Control limits are not product specifications. Checking hundreds of correlated time points per batch produces false alarms, so the alarm rate has to be evaluated and every alarm needs a defined response.

What the day-6 alarm meant

Slide 06, titled 'From Process Excursion to Scientific Investigation', subtitled 'Batch 27: individual variables are acceptable, but their combination at day 6 is unusual.' Three panels. 1, Individual trajectories: standardized traces for pH, glucose, lactate, ammonium and base addition over days 0 to 8, each between dashed schematic limits, with a vertical red line at day 6; lactate keeps rising through and beyond day 6, ammonium rises steadily, and base addition peaks near day 6, all inside their limits. 2, Multivariate alarm: a normalized statistic over days 0 to 8, T² oscillating low and below the dashed limit throughout, Q flat until a sharp peak at day 6 that crosses the limit; below, a bar chart of Q contributions at day 6 as an illustrative share of Q: lactate about 0.38, base addition about 0.32, ammonium about 0.20, glucose about 0.06, other about 0.04; caption 'contributions identify leads, not causes'. 3, Investigate and learn: a flow of five boxes, verify Raman and reference sample, investigate metabolism and gas transfer, assess relevant CQAs and disposition, update FMEA and controlled changes, capture knowledge for future batches. Footer: constructed teaching case, charts are schematic, not Batch 27 measurements. Takeaway: a multivariate alarm is evidence to investigate, not a product disposition decision.
The constructed Batch 27 case. Every variable stays inside its own limits and lactate is still rising; Q crosses its limit at day 6 while T² does not, and three variables carry most of the Q contribution. Schematic, not a fitted model.

Batch 27’s T² is inside its limit; its Q residual is not. In Week 11 terms, the batch is not extreme along the familiar directions of variation. It is moving in a direction the reference batches never moved. A contribution plot breaks the Q value into variables. Each ej2e_j^2 is non-negative and together they sum to Q; the sign of the residual eje_j then tells you which way the variable is off.

VariableContribution
Lactate (Raman)Large; residual positive: still rising
Base additionLarge; residual positive: more base to hold pH
Ammonium (Raman)Moderate; residual positive
All othersSmall

In the reference batches, the cells switch from producing lactate to consuming it around day 4 to 6. That timing is process-specific, but here Batch 27 has not switched. Each variable alone is within range, because lactate at day 6 is normal in absolute terms. The combination, still rising alongside high base addition at this stage, is not. It suggests a metabolic or culture-environment difference; it does not prove a cause.

The monitoring system has detected that the batch is unusual. It has not shown that the product is bad. The next steps are the ones Week 11 practised:

  1. Rule out the sensor. Is the Raman prediction in its applicability domain? Check against the off-line lactate result.
  2. Investigate the cause. Inoculum, media and feed lots, a gas-transfer issue raising dissolved CO₂, and the alignment itself. Decide whether experiments are needed.
  3. Connect to quality. Lactate accumulation and the changes that accompany it can affect quality attributes such as glycosylation. Characterization and release testing of the relevant critical quality attribute (CQA)s, such as glycan profile by liquid chromatography–mass spectrometry (LC–MS), aggregates by size-exclusion chromatography (SEC), charge variants and potency, decide the batch, not the control chart. The right panel depends on the product’s control strategy.
  4. Feed the knowledge back. Update the risk assessment and decide whether the control strategy or the model should change. The model learns a new normal only through controlled change, as a model has a lifecycle.

The learning organization

Reading 3 followed knowledge from R&D’s designed experiments into manufacturing controls. Batch 27 runs the loop the other way: commercial manufacturing raises a new question about the biology, which may lead to targeted experiments, a better calibration set or a better control strategy.

Across many batches, the same scores and limits support continued process verification, Stage 3 of the US Food and Drug Administration (FDA)’s process validation lifecycle6. Monitoring results, investigations, CAPA and change management feed back into risk assessments through the pharmaceutical quality system (PQS). Before that knowledge is reused for another cell line, scale or site, it has to be checked there. A new reference population or model is a controlled change, never a quick response to an inconvenient alarm.

PAT makes process information available while it can still change a decision. The quality system turns that information into reliable action and knowledge that transfers.

Where the analyst sits

The analyst owns the soft-sensor calibrations and their applicability domain, and decides which batches count as reference and how time and missing data are handled. They judge whether alignment has hidden an anomaly, and read a contribution plot as a lead to investigate rather than a root cause. They decide which lessons from a batch are robust enough to inform future development. Above all, they keep two statements apart: “this batch is unusual” and “this batch’s product is unacceptable”.

For discussion

  1. Why does a single golden batch make a poor control limit?
  2. How could a batch-wise model monitor an incomplete batch without leaking future data?
  3. Batch 27 is unusual on Q but normal on T². Explain the difference to a manufacturing supervisor in two sentences.
  4. A Raman glucose model was calibrated at 200 L. What evidence would you need before trusting it at 2,000 L?
  5. When could alignment hide a real difference in the biology, and how would you detect it?
  6. How would you tell a Raman sensor problem from a real metabolic change?
  7. What should be captured from Batch 27 for future development, and how would you decide whether it applies to other products?

Bridge back to the week

Next: Cells as Data: Flow Cytometry for CAR-T Release. Return to Week 12.

Sources

Batch 27, its alarm, its contribution values and all trajectories, spectra and calibration plots in the figures are constructed for teaching.


  1. N. R. Abu-Absi et al., “Real time monitoring of multiple parameters in mammalian cell culture bioreactors using an in-line Raman spectroscopy probe,” Biotechnology and Bioengineering 108(5) (2011) 1215–1221. DOI. ↩︎

  2. ICH, Q14 Analytical Procedure Development (2023) and Q2(R2) Validation of Analytical Procedures (2023). ICH quality guidelines. ↩︎

  3. P. Nomikos and J. F. MacGregor, “Monitoring batch processes using multiway principal component analysis,” AIChE Journal 40(8) (1994) 1361–1375. DOI. ↩︎ ↩︎

  4. S. Wold, N. Kettaneh, H. Fridén and A. Holmberg, “Modelling and diagnostics of batch processes and analogous kinetic experiments,” Chemometrics and Intelligent Laboratory Systems 44 (1998) 331–340. DOI. ↩︎ ↩︎

  5. A. Kassidas, J. F. MacGregor and P. A. Taylor, “Synchronization of batch trajectories using dynamic time warping,” AIChE Journal 44(4) (1998) 864–875. DOI. ↩︎

  6. US Food and Drug Administration (FDA), Process Validation: General Principles and Practices (guidance, 2011). Stage 3, continued process verification. Guidance. ↩︎

6 - Cells as Data: Flow Cytometry for CAR-T Release

A spectral flow panel gives every cell in a CAR-T product a 25-dimensional measurement. Manual gating, FlowSOM clustering and UMAP each see the data differently, batch effects masquerade as biology, and one patient per lot makes small-n honesty essential. The week’s chemometric discipline, applied to cells.

The one idea

A flow cytometry file is a data matrix: rows are cells, columns are markers. Everything this week, about observational units, preprocessing, unsupervised exploration, batch effects and small-n validation, applies to it.

Week 9’s flow cytometry readings treated the instrument and the gate as an analytical method: controls, compensation, template gating, counting and dose. This reading takes the next step. When a panel measures 25 markers on every cell, drawing gates by hand on two-dimensional plots stops scaling, and the analysis becomes a multivariate modeling problem.

The case: an autologous CAR-T lot

A chimeric antigen receptor T-cell (CAR-T) product is made from the patient’s own T cells. They are collected, engineered with a chimeric antigen receptor against CD19, expanded and returned to the same patient. Each lot is one patient.

Lot 0420 has two flow datasets.

PanelMarkersPurposeAnalysis
Release panelViability, CD45, CD3, CAR detection reagentIdentity, purity, CAR+ %, input to doseValidated template gating, as in Week 9
Characterization panel (spectral, 25 colours)CD3, CD4, CD8, CAR, memory markers (CD45RA, CCR7, CD27, CD62L), exhaustion markers (PD-1, TIM-3, LAG-3), CD19, CD14, CD56 and othersPhenotype for process understanding and comparabilityExploratory, multivariate
Slide titled 'When the Product Is a Cell'. Top row: a patient connected to an apheresis machine (blood draw to apheresis, return to patient), then T-cell collection from apheresis, CAR engineering by gene transfer, expansion to the therapeutic dose, and infusion back into the same patient. Bottom row: a spectral cytometer produces a cell-by-marker data matrix of roughly 10^5 to 10^6 cells by 25 markers, with columns CD3, CD4, CD8, CAR, CD19 through M25. Two panels are contrasted: a focused, validated release panel (critical identity such as CD3+ CAR+, key attributes such as viability, predefined methods and criteria) and a broad, exploratory characterization panel (about 25 markers, explores population structure and potential risks, supports investigation and method development). Key idea: every cell has a multidimensional analytical fingerprint.
The cell is both the product and the measured object. A focused release method and a broader characterization panel answer different questions.

Lot 0420 passes release. The characterization panel shows something the release gates never looked at.

Why gating by hand stops scaling

With n markers there are n(n − 1)/2 two-dimensional plots. Four markers give 6. Twenty-five give 300. Manual gating follows a hierarchy the analyst chooses in advance: live, then single cells, then CD3+, then CAR+. Every cell outside that path is never examined in the other dimensions. Gating is also a source of operator variability, which is why Week 9 insisted on templates.

Slide titled 'When Manual Gating Stops Scaling'. Left: four markers give six pairwise plots, 25 markers give 300, by the formula n(n − 1)/2; not every combination can be reviewed manually. Centre: a CD3 versus CAR plot of all live singlets with a large CD3+ CAR+ population, CD3+ CAR− and CD3− CAR− populations, and a small orange population in the CAR+ CD3− quadrant labelled 'CD3− (unexamined branch)'. Right: the sequential release path, step 1 gate CD3+ to define the T-cell population, step 2 assess CAR within CD3+ only as percent CAR+ among CD3+. Takeaway: a focused release gate answers a defined question; it does not examine every population.
A predefined gate is efficient for a defined analytical question; high-dimensional exploration can investigate populations outside that path.

Automated methods ask a different question: what populations exist in these 25 dimensions, without assuming the hierarchy? An international comparison of automated methods against expert manual gating (FlowCAP) found that the best algorithms reproduced manual results well. Combining several algorithms did better than any single one, the ensemble lesson from reading 2 again1.

Preprocessing a cytometry file

The steps map onto reading 1 and reading 4.

StepWhyChemometric analogue
Unmixing (or compensation)Separate fluorophore signalsClassical least squares, reading 4
Quality gates: time, single cells, live cellsRemove acquisition artefacts, doublets and dead cellsRemoving bad spectra
Arcsinh transformFluorescence spans orders of magnitude, and unmixing gives values near and below zero. Arcsinh is log-like for bright signals and linear near zeroA transformation chosen for the measurement, like Yeo-Johnson
Per-marker scalingMarkers have different dynamic rangesstep_normalize
Batch normalizationStaining day, reagent lot and instrument shift intensitiesCalibration transfer
library(flowCore)
library(FlowSOM)

ff <- read.FCS("lot_0420_unmixed_live_singlets.fcs")

cols <- c("CD3", "CD4", "CD8", "CAR", "CD45RA", "CCR7", "CD27",
          "PD-1", "TIM-3", "LAG-3", "CD19", "CD14", "CD56")   # marker channels

ff <- transform(ff, transformList(cols, arcsinhTransform(b = 1/150)))  # cofactor 150

fsom <- FlowSOM(ff, colsToUse = cols, scale = TRUE,
                xdim = 10, ydim = 10,    # 100 small clusters on a self-organizing map
                nClus = 15,              # merged into 15 metaclusters
                seed = 2026)             # clustering is stochastic, so fix the seed

table(GetMetaclusters(fsom))             # cells per metacluster
PlotStars(fsom)                          # marker profile of each cluster

flowCore reads the FCS file and applies the transform2; FlowSOM does the clustering3. In practice the column names are the file’s channel names, mapped to markers. The reading here is what matters: transform, cluster, inspect.

FlowSOM and UMAP

Slide titled 'From Fluorescence to Biological Populations', four panels. 1, spectral unmixing: four overlapping fluorophore emission curves against wavelength, separating overlapping signals. 2, preprocessing: live singlets then transform; an arcsinh(x/cofactor) curve over negative and positive background-corrected values, linear near zero and log-like when bright; then scale and assess batch effects. 3, FlowSOM: 100 nodes merged into 15 coloured metaclusters. 4, UMAP: a two-dimensional scatterplot with five clusters and one tiny cluster; the layout depends on seed and settings. Takeaway: UMAP is exploratory visualization, not a quantitative measurement.
Preprocessing determines the input to the model. FlowSOM groups cells by marker profiles; UMAP provides an exploratory view rather than a validated quantitative readout.

FlowSOM first assigns every cell to one of about 100 nodes on a self-organizing map, then merges those nodes into a chosen number of metaclusters3. It is fast enough for millions of cells and performed well in a benchmark of clustering methods for cytometry4. Each metacluster has a median marker profile that a biologist names: “CD8+ CAR+ effector memory”, “CD4+ CAR− naive”, and so on.

UMAP (and the older t-SNE) squeezes the 25 dimensions into a two-dimensional picture where similar cells sit near each other. It is excellent for seeing populations. It is not a measurement:

  • Distances between clusters, and cluster sizes, on a UMAP plot are not quantitatively meaningful.
  • The layout changes with random seed and settings.
  • Gating on a UMAP plot puts a validated decision on top of an unvalidated picture. Count events in the original marker space, using a defined procedure.

The rule is the same as for PCA score plots in Week 11: an exploration tool suggests where to look, and a defined, tested procedure makes the decision.

What the clustering found in lot 0420

One small metacluster, 0.3% of live cells, is CAR+ but CD3−. The release gating path (CD3+, then CAR+) never looks at CD3− cells for CAR expression, so these cells were invisible to it. They also stain dim for CD19.

Slide titled 'The Population We Almost Missed'. Left: teaching lot 0420 passes release, with the release gate CD3+ first, then CAR+. A CD3 versus CAR plot highlights a small orange population, 0.3% of live cells, that is CAR+ CD3− with dim CD19. Right: investigation actions still to do, shown as empty checkboxes: repeat clustering with a different seed or cluster number; re-stain to confirm phenotype and check doublets and viability; orthogonal identity testing with B-cell markers not masked by CAR (for example CD20, CD22, CD79a) and molecular evidence; assess product and patient risk and document findings. Callout: no automatic lot failure; escalate through the quality system before disposition. Takeaway: passing a predefined release gate does not rule out every possible risk.
An unexpected exploratory signal initiates investigation. It is neither proof of a malignant cell nor, by itself, a validated lot disposition criterion.

This is not an abstract worry. In one published case, a patient’s CAR-T product contained a single leukemic B cell that had been transduced with the CAR. The CAR bound CD19 on that same cell’s surface, masking it both from detection and from the patient’s CAR-T cells, and the clone expanded into a CAR-expressing, therapy-resistant relapse5. A marker that is supposed to identify a cell can be hidden by the product itself.

For lot 0420 the honest interim position is the one from Week 11’s capstone: separate what is known, what is inferred and what is unresolved. The cluster is real if it survives a different seed, a different number of metaclusters and a re-stain. Next come doublet and viability checks on those events. Its identity needs orthogonal evidence: B-cell markers not masked by CAR binding, and molecular methods. A 0.3% cluster in an exploratory panel does not by itself fail a lot. It does start an investigation, escalated through the quality system, and passing the routine specification does not remove the need to assess a credible new risk before disposition.

Batch effects masquerade as biology

Cluster products stained on different days, and you may find a cluster that is really a staining day: slightly brighter CD8 across every cell from one run. This is the column-lot problem from reading 4 in cytometry form. The defences are the same:

  • Run a shared reference sample (an aliquot of one control product, or beads) with every batch, as Week 9’s instrument trending did for single markers.
  • Normalize each batch to the reference before clustering. CytoNorm does this using the shared control6.
  • Randomize sample-to-batch assignment where you can (reading 3), so that run day cannot line up with the factor you are studying.

Normalization has its own risk. Applied carelessly, it can erase a genuine biological difference or hide an instrument that is out of control, so the reference sample’s own trend should be reviewed before it is used to correct anything.

One patient per lot: small n, many features

Slide titled 'Millions of Cells, Only 40 Patients'. Left: forty patient icons labelled as the independent evidence, with 10^5 to 10^6 events acquired per sample, and a risk callout: hundreds of features, 40 patients. Right: batch effects, corrected against a shared reference. Before normalization, Day 1 and Day 2 marker-fluorescence distributions are clearly shifted; after normalization they are closely aligned but not identical. Safeguards: cross-validate by patient, independent cohort, simplest model. Takeaway: check the reference trend first; don't normalize away real biology.
Millions of cells improve characterization within a patient, but a study with 40 patients still has only 40 patient-level observational units. Reference controls help reveal technical variation before modeling.

Autologous products break the assumptions behind reading 5’s “set of good batches”. Most lot-to-lot variability comes from the starting material: the patient’s age, disease and prior chemotherapy. It does not come from the process. There is no stable population of identical inputs from which to draw a normal envelope.

The pull, then, is to correlate product phenotype with clinical response. Studies have linked memory-like CAR-T phenotypes in the product with durable response7. But a typical dataset has 40 patients and hundreds of candidate features: every metacluster’s frequency, every marker’s intensity. With that ratio, some feature will correlate with response by chance alone. The safeguards are this week’s:

  • The patient is the observational unit. Cells are not; there are millions of them, and they are not independent evidence (reading 1).
  • Cross-validate by patient, and confirm in an independent cohort before believing a biomarker.
  • Prefer the simplest model that the evidence supports (reading 2).
  • A correlation between phenotype and response is a hypothesis about cause, to be tested by changing the process (reading 3).

Where release sits, and where this sits

Release decisions for cell therapy use validated, template-gated methods with defined controls. Clustering is itself a model, with a seed, a cluster count and a training set, so it would need its own validation before it could make a release call. Today high-dimensional analysis mainly supports characterization, process development, investigations and comparability after a process change, where ICH Q5E asks whether quality attributes are highly similar before and after. Panels and analyses that prove their worth there are how future release methods get designed. Moving one into release means fixing its intended purpose, locking the preprocessing and model settings, validating it and managing it over its lifecycle, the path ICH Q14 describes for any analytical procedure.

A sequence connects cells and instrument, data matrix, exploratory model, hypothesis, orthogonal evidence, validated method, quality decision and patient. A teal characterization and investigation pathway is distinguished from the orange validated release pathway. A scientist callout emphasizes integration of data, context and evidence.
Exploration generates questions; scientific evidence and fit-for-purpose methods support decisions. The analyst remains responsible for connecting measurements, models and patient-relevant quality risks.

Where the analyst sits

The analyst decides what counts as an observation (cell, sample or patient), checks that a cluster survives reasonable changes to the analysis, and recognizes a batch effect before it is named as biology. They keep exploratory pictures out of release decisions and report a surprising population as an open question with a plan.

For discussion

  1. Why could the release gating path never detect the CAR+ CD3− population?
  2. Give two ways to tell a real rare population from a clustering artefact.
  3. A study finds that 3 of 200 phenotype features predict response in 40 patients. What would you need before using any of them in a specification?
  4. How is a staining-day batch effect like a column-lot effect in HPLC, and how is each corrected?

Bridge back to the week

This is the last reading. Return to Week 12 for the M7 case, the capstone and the presentations.

Sources

Lot 0420, its panels and the CAR+ CD3− cluster are constructed for teaching. The transduced-leukemic-cell case5 is real. The figures are schematic teaching illustrations, not experimental data.


  1. N. Aghaeepour et al., “Critical assessment of automated flow cytometry data analysis techniques,” Nature Methods 10(3) (2013) 228–238. DOI. ↩︎

  2. F. Hahne et al., “flowCore: a Bioconductor package for high throughput flow cytometry,” BMC Bioinformatics 10 (2009) 106. DOI. ↩︎

  3. S. Van Gassen et al., “FlowSOM: Using self-organizing maps for visualization and interpretation of cytometry data,” Cytometry Part A 87(7) (2015) 636–645. DOI. R package on Bioconductor. ↩︎ ↩︎

  4. L. M. Weber and M. D. Robinson, “Comparison of clustering methods for high-dimensional single-cell flow and mass cytometry data,” Cytometry Part A 89(12) (2016) 1084–1096. DOI. ↩︎

  5. M. Ruella et al., “Induction of resistance to chimeric antigen receptor T cell therapy by transduction of a single leukemic B cell,” Nature Medicine 24 (2018) 1499–1503. DOI. ↩︎ ↩︎

  6. S. Van Gassen et al., “CytoNorm: A Normalization Algorithm for Cytometry Data,” Cytometry Part A 97(3) (2020) 268–278. DOI. ↩︎

  7. J. A. Fraietta et al., “Determinants of response and resistance to CD19 chimeric antigen receptor (CAR) T cell therapy of chronic lymphocytic leukemia,” Nature Medicine 24 (2018) 563–571. DOI. ↩︎