VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

Why Mathematics? | SpaGE Spatial Gene Prediction: Separate PCAs, Cosine Similarity, SVD Principal Vectors and k-Nearest Neighbours

WHY MATHEMATICS?

Why Mathematics? | SpaGE Spatial Gene Prediction: Separate PCAs, Cosine Similarity, SVD Principal Vectors and k-Nearest Neighbours

How SpaGE aligns single-cell and spatial datasets geometrically, keeps shared principal directions and predicts unmeasured genes from weighted neighbours.

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

  • Run PCA independently in reference and query data
  • Align PC bases through cosine similarity and SVD
  • Keep principal-vector pairs with adequate similarity
  • Predict held-out genes with weighted k-nearest neighbours

Chapter map

  1. 1. Reference matrix
  2. 2. Spatial query matrix
  3. 3. Shared-gene intersection
  4. 4. Separate centring and scaling
  5. 5. Reference PCA
  6. 6. Query PCA
  7. 7. Cosine-similarity matrix
  8. 8. Singular value decomposition
  9. 9. Principal vectors
  10. 10. Similarity threshold
  11. 11. Common projection
  12. 12. Cosine distance
  13. 13. k-nearest neighbours
  14. 14. Positive-similarity filter
  15. 15. Normalized prediction weights
  16. 16. Held-out gene validation

Visit the How Mathematics Works hub for the wider series and its connections to education, reasoning, science, computing, design and careers.


1. Reference matrix

The central mathematical idea is concrete. Single-cell rows contain shared and unmeasured genes.

A concrete situation

R has 20,000 cells by 18,000 genes.

What the mathematics does not license

Reference states may not exist in the tissue section. Keeping this boundary clear makes the result easier to audit and transfer.

Try it, check it, transfer it

Audit donors and states. 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. Spatial query matrix

Here the geometry becomes operational. Spatial cells or locations contain measured genes and coordinates.

A concrete situation

Q has 5,000 cells by 500 genes.

What the mathematics does not license

Assay sensitivity differs from scRNA-seq. A trustworthy workflow records the choice before seeing the final test result.

Try it, check it, transfer it

Preserve platform metadata. 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. Shared-gene intersection

This step deserves a careful pause. Only genes in both datasets align domains.

A concrete situation

p equals 420 genes.

What the mathematics does not license

A small panel may underdefine biology. Evidence becomes stronger when the limitation is tested instead of hidden.

Try it, check it, transfer it

Test alternative shared sets. 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. Separate centring and scaling

The useful question is not only how to calculate, but what the calculation assumes. Each domain is transformed before PCA.

A concrete situation

Every shared gene is standardized within its dataset.

What the mathematics does not license

Scaling changes covariance and distances. Keeping this boundary clear makes the result easier to audit and transfer.

Try it, check it, transfer it

Publish the transform. 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. Reference PCA

A small example makes the mechanism visible. Orthogonal directions summarize R.

A concrete situation

The first 30 PCs are retained.

What the mathematics does not license

High variance can be technical. A trustworthy workflow records the choice before seeing the final test result.

Try it, check it, transfer it

Inspect loadings and batches. 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. Query PCA

This is where modelling choices begin to affect evidence. A second orthogonal basis summarizes Q.

A concrete situation

The first 30 query PCs are retained.

What the mathematics does not license

PC numbers need not have matching meaning. Evidence becomes stronger when the limitation is tested instead of hidden.

Try it, check it, transfer it

Do not pair by index alone. 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. Cosine-similarity matrix

The central mathematical idea is concrete. Dot products compare unit PC directions.

A concrete situation

Similarity between PC-r2 and PC-q5 is 0.81.

What the mathematics does not license

Signs and noisy loadings matter. Keeping this boundary clear makes the result easier to audit and transfer.

Try it, check it, transfer it

Inspect the full matrix. 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. Singular value decomposition

Here the geometry becomes operational. C equals U Sigma V transpose.

A concrete situation

Sigma lists aligned strengths.

What the mathematics does not license

SVD always returns pairs even for weak overlap. A trustworthy workflow records the choice before seeing the final test result.

Try it, check it, transfer it

Use similarity thresholds. 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. Principal vectors

This step deserves a careful pause. U and V rotate PCs into one-to-one paired directions.

A concrete situation

PV-r1 aligns with PV-q1.

What the mathematics does not license

A paired vector may explain little variance. Evidence becomes stronger when the limitation is tested instead of hidden.

Try it, check it, transfer it

Report both similarity and variance. 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. Similarity threshold

The useful question is not only how to calculate, but what the calculation assumes. Only reliable pairs define the shared space.

A concrete situation

Pairs above 0.3 are kept.

What the mathematics does not license

A hard cutoff can change neighbourhoods. Keeping this boundary clear makes the result easier to audit and transfer.

Try it, check it, transfer it

Sweep the threshold. 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. Common projection

A small example makes the mechanism visible. Both datasets are projected on aligned reference PVs.

A concrete situation

Each cell receives d-prime coordinates.

What the mathematics does not license

Projection can compress query-specific biology. A trustworthy workflow records the choice before seeing the final test result.

Try it, check it, transfer it

Check reconstruction and separation. 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. Cosine distance

This is where modelling choices begin to affect evidence. Angular difference ranks reference neighbours.

A concrete situation

Distance is one minus similarity 0.86, or 0.14.

What the mathematics does not license

Magnitude information is discarded. Evidence becomes stronger when the limitation is tested instead of hidden.

Try it, check it, transfer it

Compare Euclidean distance. 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. k-nearest neighbours

The central mathematical idea is concrete. Each spatial cell selects nearby reference cells.

A concrete situation

k equals 50.

What the mathematics does not license

Large k smooths; small k is noisy. Keeping this boundary clear makes the result easier to audit and transfer.

Try it, check it, transfer it

Tune on held-out genes. 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. Positive-similarity filter

Here the geometry becomes operational. Neighbours with cosine distance below one remain.

A concrete situation

Thirty-eight of fifty are retained.

What the mathematics does not license

Some cells may have weak support. A trustworthy workflow records the choice before seeing the final test result.

Try it, check it, transfer it

Report neighbour count and distance. 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. Normalized prediction weights

This step deserves a careful pause. Closer reference cells contribute more.

A concrete situation

Weights sum to one.

What the mathematics does not license

A dominant neighbour can transfer noise. Evidence becomes stronger when the limitation is tested instead of hidden.

Try it, check it, transfer it

Inspect effective neighbour number. 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. Held-out gene validation

The useful question is not only how to calculate, but what the calculation assumes. Measured genes are hidden and predicted as a test.

A concrete situation

Correlation is computed for gene g across cells.

What the mathematics does not license

Average correlation hides failures. Keeping this boundary clear makes the result easier to audit and transfer.

Try it, check it, transfer it

Report per-gene error and independent maps. 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

  1. Day 1: define the decision, observation unit, X variables and Y or reference condition.
  2. Day 2: reproduce the smallest worked example and check every dimension, unit and sign.
  3. Day 3: build a transparent baseline and write what it assumes.
  4. Day 4: fit the main method inside a training-only pipeline; record every parameter.
  5. Day 5: challenge one assumption with a deliberately difficult dataset or operating regime.
  6. Day 6: compare validation metrics with the practical workload created by errors.
  7. 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

SpaGE predicts genes that were not measured by a spatial assay. It begins with a single-cell reference and a spatial query, restricts alignment to genes observed in both, and runs principal component analysis separately on the two datasets. Separate PCAs let each technology describe its own strongest directions instead of pretending that the covariance structures are already identical.

PRECISE compares the two PC bases using a cosine-similarity matrix and applies singular value decomposition. The left and right singular vectors rotate the PC bases into paired principal vectors. Their diagonal similarities rank how consistently a direction appears in both domains. SpaGE keeps pairs above a similarity threshold, creating a common latent space while discarding weakly matched directions.

Both datasets are projected into that aligned space. For each spatial cell, SpaGE finds nearby dissociated reference cells with cosine distance, retains neighbours with positive similarity and forms normalized weights. An unmeasured gene is predicted as a weighted average of its expression in those reference neighbours. The output is an estimate; no new molecule was measured at the spatial coordinate.

Prediction quality depends on shared genes, scaling, PCA dimension, the principal-vector threshold, neighbourhood size and reference coverage. Close neighbours can be technically rather than biologically close, and a missing state cannot be reconstructed faithfully. Held-out measured genes, whole-cell-type omissions, donor holdouts and independent in-situ maps reveal how much spatial detail is learned rather than borrowed.


Frequently asked questions

What is SpaGE?

SpaGE predicts spatially unmeasured genes by aligning a single-cell reference and spatial query with PRECISE, then applying weighted nearest-neighbour regression.

Why run PCA separately?

Each technology has its own covariance structure; separate bases preserve those structures before alignment.

What does SVD align?

It factorizes the cross-basis cosine-similarity matrix and rotates both PC sets into paired principal vectors.

Why filter principal vectors?

Low-similarity pairs likely represent noise or domain-specific variation rather than a reliable shared direction.

How is an unmeasured gene predicted?

Its expression is a weighted average across similar reference cells in the aligned space.

Is a predicted gene spatially measured?

No. It is an inference borrowed from reference neighbours and must be validated with held-out or independent measurements.


Primary source and fact-check note

Tamim Abdelaal, Soufiane Mourragui, Ahmed Mahfouz and Marcel J. T. Reinders, “SpaGE: Spatial Gene Enhancement using scRNA-seq,” Nucleic Acids Research 48(18), e107 (2020), DOI 10.1093/nar/gkaa740. 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

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

Dataset audit

Version reference, query, donors and platforms.

Scaling audit

Publish centring, scaling and shared genes.

PCA audit

Inspect component variance and loadings in both domains.

SVD audit

Store cosine matrix, singular values and rotations.

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.

Threshold audit

Test retained principal-vector cutoffs.

Neighbour audit

Publish k, distances and effective weights.

Prediction audit

Evaluate held-out genes and omitted states.

Final claim

Predicted expression is inferred, not spatially measured.

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: Reference matrix

Begin with this mechanism: Single-cell rows contain shared and unmeasured genes. Recreate the concrete case: R has 20,000 cells by 18,000 genes. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: Reference states may not exist in the tissue section. Complete the transfer step: Audit donors and states. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 2: Spatial query matrix

Begin with this mechanism: Spatial cells or locations contain measured genes and coordinates. Recreate the concrete case: Q has 5,000 cells by 500 genes. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: Assay sensitivity differs from scRNA-seq. Complete the transfer step: Preserve platform metadata. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 3: Shared-gene intersection

Begin with this mechanism: Only genes in both datasets align domains. Recreate the concrete case: p equals 420 genes. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: A small panel may underdefine biology. Complete the transfer step: Test alternative shared sets. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 4: Separate centring and scaling

Begin with this mechanism: Each domain is transformed before PCA. Recreate the concrete case: Every shared gene is standardized within its dataset. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: Scaling changes covariance and distances. Complete the transfer step: Publish the transform. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

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: Reference PCA

Begin with this mechanism: Orthogonal directions summarize R. Recreate the concrete case: The first 30 PCs are retained. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: High variance can be technical. Complete the transfer step: Inspect loadings and batches. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 6: Query PCA

Begin with this mechanism: A second orthogonal basis summarizes Q. Recreate the concrete case: The first 30 query PCs are retained. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: PC numbers need not have matching meaning. Complete the transfer step: Do not pair by index alone. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 7: Cosine-similarity matrix

Begin with this mechanism: Dot products compare unit PC directions. Recreate the concrete case: Similarity between PC-r2 and PC-q5 is 0.81. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: Signs and noisy loadings matter. Complete the transfer step: Inspect the full matrix. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 8: Singular value decomposition

Begin with this mechanism: C equals U Sigma V transpose. Recreate the concrete case: Sigma lists aligned strengths. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: SVD always returns pairs even for weak overlap. Complete the transfer step: Use similarity thresholds. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

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: Principal vectors

Begin with this mechanism: U and V rotate PCs into one-to-one paired directions. Recreate the concrete case: PV-r1 aligns with PV-q1. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: A paired vector may explain little variance. Complete the transfer step: Report both similarity and variance. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 10: Similarity threshold

Begin with this mechanism: Only reliable pairs define the shared space. Recreate the concrete case: Pairs above 0.3 are kept. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: A hard cutoff can change neighbourhoods. Complete the transfer step: Sweep the threshold. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 11: Common projection

Begin with this mechanism: Both datasets are projected on aligned reference PVs. Recreate the concrete case: Each cell receives d-prime coordinates. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: Projection can compress query-specific biology. Complete the transfer step: Check reconstruction and separation. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 12: Cosine distance

Begin with this mechanism: Angular difference ranks reference neighbours. Recreate the concrete case: Distance is one minus similarity 0.86, or 0.14. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: Magnitude information is discarded. Complete the transfer step: Compare Euclidean distance. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

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: k-nearest neighbours

Begin with this mechanism: Each spatial cell selects nearby reference cells. Recreate the concrete case: k equals 50. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: Large k smooths; small k is noisy. Complete the transfer step: Tune on held-out genes. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 14: Positive-similarity filter

Begin with this mechanism: Neighbours with cosine distance below one remain. Recreate the concrete case: Thirty-eight of fifty are retained. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: Some cells may have weak support. Complete the transfer step: Report neighbour count and distance. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 15: Normalized prediction weights

Begin with this mechanism: Closer reference cells contribute more. Recreate the concrete case: Weights sum to one. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: A dominant neighbour can transfer noise. Complete the transfer step: Inspect effective neighbour number. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.

Workshop 16: Held-out gene validation

Begin with this mechanism: Measured genes are hidden and predicted as a test. Recreate the concrete case: Correlation is computed for gene g across cells. Write shared genes, standardized values, PC loadings, cosine similarities, singular values, principal vectors, projected coordinates, neighbour distances, prediction weights and held-out errors with direction, units, denominators and assumptions. Calculate the smallest non-trivial example by hand, then reproduce it in a spreadsheet or short program. Challenge this limitation: Average correlation hides failures. Complete the transfer step: Report per-gene error and independent maps. Change exactly one reference donor, feature filter, normalization, mixture size, weight distribution, latent dimension, divergence convention, domain-loss weight, learning rate, gene-frequency cutoff, overdispersion threshold, topic number, Dirichlet prior, PCA dimension, principal-vector threshold, neighbourhood size, distance metric, section holdout or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep measurement, transformation, latent assumption, objective, optimization, prediction, interpretation and validation on separate notebook lines. Reserve whole donors, sections, tissues or platforms outside tuning when testing transfer.