WHY MATHEMATICS?
Why Mathematics? | iSC.MEB for Multiple Tissue Slides: Batch Effects, Aligned Embeddings, Hidden Markov Fields and Joint Clustering
How iSC.MEB estimates technical shifts and spatial domains together across several tissue sections while preserving each section’s own neighbourhood structure.
Why mathematics is important becomes easier to see when a real decision depends on it. This guide follows the mechanism from definitions and dimensions to a worked calculation, validation, practical learning and responsible use. It keeps factual evidence separate from interpretation and treats every illustrative scenario as an example rather than a promise of results.
Choose a reading route
- Represent several slides in a shared low-dimensional coordinate system
- Estimate slide-level batch effects inside the model
- Apply spatial label dependence within each section
- Validate shared domains without erasing real heterogeneity
Chapter map
- 1. Multi-section inputs
- 2. Shared latent scale
- 3. Batch-effect term
- 4. Common cluster parameters
- 5. Section labels
- 6. Separate spatial graphs
- 7. Spatial field
- 8. Joint objective
- 9. EM-ICM fitting
- 10. Identifiability
- 11. Integration metric
- 12. Domain metric
- 13. Missing domains
- 14. Held-out transfer
- 15. Interpretation boundary
- 16. Governance and learning
Visit the How Mathematics Works hub for the wider series and its connections to education, reasoning, science, computing, design and careers.
1. Multi-section inputs
Here the geometry becomes operational. Each slide supplies expression features and coordinates.
A concrete situation
Twelve cortex sections enter one analysis.
What the mathematics does not license
Different preprocessing creates artificial shifts. The habit of checking assumptions is one of the practical benefits of learning mathematics.
Try it, check it, transfer it
Use one documented pipeline. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
2. Shared latent scale
This step deserves a careful pause. Features are represented in comparable low-dimensional coordinates.
A concrete situation
Component one has the same unit across slides.
What the mathematics does not license
Rotations and scaling can differ. The same reasoning helps students move from an exercise to a real dataset.
Try it, check it, transfer it
Verify alignment diagnostics. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
3. Batch-effect term
The useful question is not only how to calculate, but what the calculation assumes. A section-specific shift captures systematic technical variation.
A concrete situation
Slide two is offset along one component.
What the mathematics does not license
A true biological shift may be absorbed. That distinction matters because a correct formula can still answer the wrong operational question.
Try it, check it, transfer it
Use balanced design. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
4. Common cluster parameters
A small example makes the mechanism visible. Repeated domains borrow means or covariance information across slides.
A concrete situation
Layer-like regions support the same component centre.
What the mathematics does not license
Rare sample-specific states may be lost. The habit of checking assumptions is one of the practical benefits of learning mathematics.
Try it, check it, transfer it
Inspect per-slide fit. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.
5. Section labels
This is where modelling choices begin to affect evidence. Every location receives a hidden domain label.
A concrete situation
One section contains only four of five domains.
What the mathematics does not license
Forcing all groups can invent a region. The same reasoning helps students move from an exercise to a real dataset.
Try it, check it, transfer it
Allow and report absence. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
6. Separate spatial graphs
The central mathematical idea is concrete. Neighbour edges are built inside each tissue section.
A concrete situation
No edge crosses between physical slides.
What the mathematics does not license
Registration quality does not create physical adjacency. That distinction matters because a correct formula can still answer the wrong operational question.
Try it, check it, transfer it
Audit every graph separately. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
7. Spatial field
Here the geometry becomes operational. Neighbouring labels within a section receive a continuity reward.
A concrete situation
A thin layer survives when expression is strong.
What the mathematics does not license
One smoothness may not suit all slides. The habit of checking assumptions is one of the practical benefits of learning mathematics.
Try it, check it, transfer it
Compare shared and section-specific sensitivity. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
8. Joint objective
This step deserves a careful pause. Expression fit, batch adjustment and spatial coherence are optimized together.
A concrete situation
A candidate partition improves all three terms.
What the mathematics does not license
One term can dominate numerically. The same reasoning helps students move from an exercise to a real dataset.
Try it, check it, transfer it
Publish component objectives. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.
9. EM-ICM fitting
The useful question is not only how to calculate, but what the calculation assumes. Parameter updates alternate with local spatial label updates.
A concrete situation
Batch shift changes before a boundary label moves.
What the mathematics does not license
Local optima remain possible. That distinction matters because a correct formula can still answer the wrong operational question.
Try it, check it, transfer it
Repeat starts and slide orders. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
10. Identifiability
A small example makes the mechanism visible. Batch and biology are separable only with informative overlap.
A concrete situation
Both conditions appear in several batches.
What the mathematics does not license
Perfect confounding has no unique correction. The habit of checking assumptions is one of the practical benefits of learning mathematics.
Try it, check it, transfer it
Draw the design matrix first. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
11. Integration metric
This is where modelling choices begin to affect evidence. Mixing across samples can quantify alignment in the embedding.
A concrete situation
Equivalent domains contain cells from several slides.
What the mathematics does not license
High mixing can erase real sample structure. The same reasoning helps students move from an exercise to a real dataset.
Try it, check it, transfer it
Pair mixing with biological conservation. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
12. Domain metric
The central mathematical idea is concrete. Adjusted Rand index can compare labels with an external annotation.
A concrete situation
Layer calls agree beyond chance.
What the mathematics does not license
Annotation is itself uncertain. That distinction matters because a correct formula can still answer the wrong operational question.
Try it, check it, transfer it
Report several validators. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.
13. Missing domains
Here the geometry becomes operational. The model must distinguish absence from weak evidence.
A concrete situation
A section lacks a damaged region.
What the mathematics does not license
Small regions can be smoothed away. The habit of checking assumptions is one of the practical benefits of learning mathematics.
Try it, check it, transfer it
Use posterior and marker checks. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
14. Held-out transfer
This step deserves a careful pause. Whole slides test whether fitted structure generalizes.
A concrete situation
One donor is excluded until final evaluation.
What the mathematics does not license
Random spot splits leak spatial information. The same reasoning helps students move from an exercise to a real dataset.
Try it, check it, transfer it
Hold out donors or sections. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
15. Interpretation boundary
The useful question is not only how to calculate, but what the calculation assumes. An integrated cluster is a statistical correspondence claim.
A concrete situation
Domain three recurs across cortex slides.
What the mathematics does not license
It does not prove identical function. That distinction matters because a correct formula can still answer the wrong operational question.
Try it, check it, transfer it
Use orthogonal biology. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
16. Governance and learning
A small example makes the mechanism visible. Version features, batch labels, design balance, graphs, K and starts.
A concrete situation
A student estimates one offset and label update.
What the mathematics does not license
Alignment is a model decision. The habit of checking assumptions is one of the practical benefits of learning mathematics.
Try it, check it, transfer it
Write an iSC.MEB integration card. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.
Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.
A seven-day practice lab
- Day 1: define the decision, observation unit, X variables and Y or reference condition.
- Day 2: reproduce the smallest worked example and check every dimension, unit and sign.
- Day 3: build a transparent baseline and write what it assumes.
- Day 4: fit the main method inside a training-only pipeline; record every parameter.
- Day 5: challenge one assumption with a deliberately difficult dataset or operating regime.
- Day 6: compare validation metrics with the practical workload created by errors.
- Day 7: present one supported conclusion, one unresolved uncertainty and one safe next experiment.
Questions for a student, parent or mentor
- Which part of the model is a mathematical definition, and which part is a choice?
- What small calculation would catch a sign, scale or dimension error?
- What evidence comes from training, validation and the untouched test?
- What benign condition could look like a fault or prediction failure?
- How would the answer change for another response, asset, school project or time period?
- What should a human review before acting on the score?
A method-specific audit before deployment
iSC.MEB extends the SC-MEB idea from one tissue section to several. Each section retains its own spatial-neighbour graph, while an integrated low-dimensional representation lets the model estimate batch effects and common spatial clusters together. The central mathematical question is how to share repeatable biology without forcing genuinely different sections into artificial agreement.
A batch term shifts the representation for a section, and hidden cluster labels are coupled through a section-specific Markov random field. Joint estimation matters because correcting batches first and clustering second can treat an uncertain correction as fixed. The integrated likelihood lets both parts inform one another.
Multi-sample evidence can stabilize weak domains, yet design confounding remains decisive. If every control belongs to one batch and every case to another, no formula can cleanly identify which shift is technical. Balanced designs, donor-level holdouts and per-section residual maps are therefore mathematical requirements, not administrative extras.
A classroom example uses two four-spot sections with the same two domains and a constant offset in one measured component. Estimate the offset, centre the sections, calculate Gaussian cluster scores and apply a spatial label update separately on each graph. Then replace one true domain difference with the offset to see why batch and biology can be non-identifiable.
Frequently asked questions
What is iSC.MEB?
iSC.MEB is an integrated extension of SC-MEB that jointly estimates batch effects and spatial clusters from low-dimensional representations of multiple spatial-transcriptomics datasets.
Why fit batches and clusters together?
Joint estimation allows uncertainty in alignment and clustering to interact rather than treating a preprocessing correction as perfectly known.
Does every slide share one spatial graph?
No. Each tissue section has its own coordinates and neighbour graph, while cluster-related parameters can be estimated across samples.
What makes a batch effect identifiable?
The design needs comparable biology across batches; complete confounding between condition and batch cannot be repaired by computation alone.
Can a shared cluster mean identical anatomy?
No. Shared statistical structure can support comparison, but markers, morphology, donor replication and section-specific residuals remain necessary.
How should transfer be checked?
Hold out whole sections or donors, refit key settings and test whether domains and markers recur without using the holdout during tuning.
Primary source and fact-check note
Yi Yang, Wei Liu and Jin Liu, “iSC.MEB: an R package for multi-sample spatial clustering analysis of spatial transcriptomics data,” Bioinformatics Advances 3 (2023), vbad019, DOI 10.1093/bioadv/vbad019. Definitions and core claims in this article were checked against this primary publication. Calculations shown here were independently recomputed. Examples are educational illustrations; they are not reported industrial performance results.
Useful next reading
- SC-MEB single-section model
- PRECAST multi-slide embeddings
- BASS multi-sample hierarchy
- How Mathematics Works
Keep the options open. Mathematics education supports clearer questions, transferable problem-solving skills and informed choices across science, engineering, computing, AI, statistics, design and many other careers. It does not guarantee intelligence, income, admission or employment; those outcomes depend on far more than one subject or model.
Extended laboratory: topic-specific validation and responsible use
Design audit
Draw condition, donor and batch overlap.
Batch audit
Plot raw and corrected section shifts.
Graph audit
Inspect each section separately.
Integration audit
Pair mixing with biological conservation.
Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.
Heterogeneity audit
Allow section-specific absence and effects.
Transfer audit
Hold out whole donors or slides.
Optimization audit
Repeat starts and parameter sensitivity.
Final claim
Joint alignment does not solve complete confounding.
Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.
Mechanism workshop: calculate, challenge and transfer
Workshop 1: Multi-section inputs
Begin with this mechanism: Each slide supplies expression features and coordinates. Work through the concrete case: Twelve cortex sections enter one analysis. Make the limitation visible: Different preprocessing creates artificial shifts. Complete the evidence step: Use one documented pipeline. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 2: Shared latent scale
Begin with this mechanism: Features are represented in comparable low-dimensional coordinates. Work through the concrete case: Component one has the same unit across slides. Make the limitation visible: Rotations and scaling can differ. Complete the evidence step: Verify alignment diagnostics. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 3: Batch-effect term
Begin with this mechanism: A section-specific shift captures systematic technical variation. Work through the concrete case: Slide two is offset along one component. Make the limitation visible: A true biological shift may be absorbed. Complete the evidence step: Use balanced design. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 4: Common cluster parameters
Begin with this mechanism: Repeated domains borrow means or covariance information across slides. Work through the concrete case: Layer-like regions support the same component centre. Make the limitation visible: Rare sample-specific states may be lost. Complete the evidence step: Inspect per-slide fit. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.
Workshop 5: Section labels
Begin with this mechanism: Every location receives a hidden domain label. Work through the concrete case: One section contains only four of five domains. Make the limitation visible: Forcing all groups can invent a region. Complete the evidence step: Allow and report absence. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 6: Separate spatial graphs
Begin with this mechanism: Neighbour edges are built inside each tissue section. Work through the concrete case: No edge crosses between physical slides. Make the limitation visible: Registration quality does not create physical adjacency. Complete the evidence step: Audit every graph separately. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 7: Spatial field
Begin with this mechanism: Neighbouring labels within a section receive a continuity reward. Work through the concrete case: A thin layer survives when expression is strong. Make the limitation visible: One smoothness may not suit all slides. Complete the evidence step: Compare shared and section-specific sensitivity. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 8: Joint objective
Begin with this mechanism: Expression fit, batch adjustment and spatial coherence are optimized together. Work through the concrete case: A candidate partition improves all three terms. Make the limitation visible: One term can dominate numerically. Complete the evidence step: Publish component objectives. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.
Workshop 9: EM-ICM fitting
Begin with this mechanism: Parameter updates alternate with local spatial label updates. Work through the concrete case: Batch shift changes before a boundary label moves. Make the limitation visible: Local optima remain possible. Complete the evidence step: Repeat starts and slide orders. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 10: Identifiability
Begin with this mechanism: Batch and biology are separable only with informative overlap. Work through the concrete case: Both conditions appear in several batches. Make the limitation visible: Perfect confounding has no unique correction. Complete the evidence step: Draw the design matrix first. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 11: Integration metric
Begin with this mechanism: Mixing across samples can quantify alignment in the embedding. Work through the concrete case: Equivalent domains contain cells from several slides. Make the limitation visible: High mixing can erase real sample structure. Complete the evidence step: Pair mixing with biological conservation. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 12: Domain metric
Begin with this mechanism: Adjusted Rand index can compare labels with an external annotation. Work through the concrete case: Layer calls agree beyond chance. Make the limitation visible: Annotation is itself uncertain. Complete the evidence step: Report several validators. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.
Workshop 13: Missing domains
Begin with this mechanism: The model must distinguish absence from weak evidence. Work through the concrete case: A section lacks a damaged region. Make the limitation visible: Small regions can be smoothed away. Complete the evidence step: Use posterior and marker checks. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 14: Held-out transfer
Begin with this mechanism: Whole slides test whether fitted structure generalizes. Work through the concrete case: One donor is excluded until final evaluation. Make the limitation visible: Random spot splits leak spatial information. Complete the evidence step: Hold out donors or sections. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 15: Interpretation boundary
Begin with this mechanism: An integrated cluster is a statistical correspondence claim. Work through the concrete case: Domain three recurs across cortex slides. Make the limitation visible: It does not prove identical function. Complete the evidence step: Use orthogonal biology. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
Workshop 16: Governance and learning
Begin with this mechanism: Version features, batch labels, design balance, graphs, K and starts. Work through the concrete case: A student estimates one offset and label update. Make the limitation visible: Alignment is a model decision. Complete the evidence step: Write an iSC.MEB integration card. Write the dimensions, counts, coordinates, mixture parameters, graph edges, priors, losses, dispersions, topic proportions or update rules with named units. Calculate one small example by hand, then vary one assumption and explain which result moves and why. Reserve complete sections, donors, tissue regions, genes or image sets outside tuning when testing transfer. Keep measurement, fitted representation, statistical evidence, biological interpretation and decision on separate notebook lines so a student, parent or reviewer can audit the mathematics.
