Dr. Seok's Tumour-Infiltrating Lymphocytes, First Steps

If you count the red dots,
what can you say about a person?

A slide of cancer tissue is cut into 50 Β΅m tiles, and for each tile a CNN answers β€œis there a lymphocyte here?”. The 5,202 TIL maps made that way are publicly available.
Over these 20 lessons you count the pixels of those maps yourself to build an infiltration rate, then pass through Kaplan–Meier, the log-rank test, multiple testing and Simpson's paradox to settle what that number entitles you to say. Python runs right inside this page. There is nothing to install.

🐍 PythonπŸ”¬ digital pathology🩸 TILs πŸ“ˆ survival analysis🎲 permutation testsβš–οΈ Simpson's paradoxπŸ‡¬πŸ‡§ English
Start lesson 1 β†’

How you'll learn

πŸ’‘From a picture to a number

An infiltration rate does not fall out of the sky. What the denominator should be, where to draw the threshold, how large a tile to look at β€” you make each of those decisions yourself.

▢️With the real data

Not a stand-in dataset. The original maps from TCIA's TIL-WSI-TCGA (Saltz 2018) and the survival data from UCSC Xena, exactly as published.

🩺How to fool yourself, first

Two slides from the same patient come out differently, and mixing cancer types flips the sign. Before you trust a result you feel how you get fooled with your own hands.

πŸ› οΈLearning by handling it

Every lesson has a laboratory widget β€” the threshold slider, the tile size, where you cut, the permutation shuffle, all turned by you.

Full curriculum

01
One map β€” the red dots are lymphocytes
how an H&E slide becomes a grid
βœ“
02
Infiltration rate β€” what do you divide by what?
one denominator, and the ranking changes
βœ“
03
The threshold β€” where a probability becomes a yes or a no
where did 0.5 come from?
βœ“
04
The size of a tile β€” what 50 Β΅m decided
group the cells and the value changes
βœ“
05
5,202 slides β€” a different world per cancer type
from one map to a cohort
βœ“
06
When the mean lies β€” the long right tail
is it 8.1% or 4.9%?
βœ“
07
Does more tissue mean more infiltration? β€” hunting a confounder
finding nothing is a result too
βœ“
08
Same rate, different picture β€” scattered versus clumped
what one number erases
βœ“
09
At the door or inside β€” distance from the edge
information still left in the map
βœ“
10
From what percent does β€œthere is infiltration” start? β€” thresholds and names
who decided brisk versus non-brisk?
βœ“
11
Same patient, two slides β€” how much does this number wobble?
the value that sits under every result
βœ“
12
Against stage, age and sex
significant, and small
βœ“
13
Survival curves β€” drawing the staircase by hand
how to handle censoring
βœ“
14
The log-rank test β€” the gap between two curves as one number
observed βˆ’ expected, and z
βœ“
15
Hunting for a cut point β€” how to manufacture a p-value
a result appears where there was none
βœ“
16
Test twelve times and β€” correcting for multiplicity
0.6 expected by chance
βœ“
17
Put it all in one pot β€” Simpson's paradox
the sign flips
βœ“
18
Which hospital did the slide come from β€” batch effects
different patients, or different slides?
βœ“
19
Building a p-value by hand β€” the permutation test
if you do not trust the formula, shuffle
βœ“
20
What you can say, and what you cannot
from one map to here
βœ“