From Reads to Count Tables
How sequencing reads become a table of counts, for bacteria and for human genes, and what that table does and does not tell you.
There are no laptops this afternoon. The first ninety minutes are a lecture, and for the second ninety minutes you are on your feet, building count tables out of paper and objects.
Slides
Analog activities (90 minutes, no computers)
The session acts out one story: pick a bag, then draw balls. A bag might be a vaginal community or a patch of forest; a ball might be a 16S read or a bird someone spotted. Any study that fits that story produces a count table, and everything this week works on count tables.
People are on their feet for the first forty-five minutes and at tables with pen and paper for the rest. The slides for every step are at the end of this afternoon’s deck.
Materials
| item | how many | used for |
|---|---|---|
| Opaque cloth or paper bags | 4 | demo |
| Pom-poms in 8 colours | about 50 per bag | demo |
| Felt-tip markers in the same 8 colours | 2 sets | demo cards |
Blank cards, D____ |
12 | demo |
Printed sample cards, S01 to S80 |
1 per participant | rounds 1 and 2, worksheet |
| Worksheet, printed double-sided | 1 per participant, plus spares | build the table |
| Masking tape | 1 roll | floor axes |
| Flip chart and marker | 1 | report to the room |
| Whiteboard and marker | 1 | dendrogram in round 1 |
Print files
- Worksheet (PDF), one per participant, printed double-sided with flip on short edge.
- All 80 cards by bag (PDF, spoilers): every card’s bar grouped by the bag it came from, with the PCoA, the floor plot and the dendrogram. For instructors.
Before the session
Fill the four bags with about 50 pom-poms each, and tag each bag with its inflammation status.
| bag | orange | green | blue | pink | red | sky blue | yellow | grey | tag |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 42 | 4 | 1 | 1 | 1 | 1 | low | ||
| 2 | 4 | 38 | 4 | 1 | 1 | 2 | low | ||
| 3 | 1 | 4 | 35 | 4 | 2 | 2 | 2 | high | |
| 4 | 1 | 9 | 23 | 5 | 5 | 5 | 2 | high |
Tape the floor axes in an open part of the room: one long line left to right (more blue toward the right), and one line front to back crossing it at the left end (more orange toward the back, more green toward the front).
Sort the printed cards in order, S01 first. The deck is interleaved, so handing out the first 61 cards still gives a balanced room. Keep the rest as spares.
Run sheet
| time | block |
|---|---|
| 0:00 | Bags and balls, live demo |
| 0:12 | Hand out cards |
| 0:15 | Round 1: closest partner, then pairs of pairs |
| 0:27 | Round 2: the floor is a plot |
| 0:37 | Reveal and debrief |
| 0:45 | Build the table, worksheet |
| 1:20 | Report to the room |
| 1:25 | Close |
Bags and balls (12 min)
Put the four bags on a table at the front and ask for eight volunteers, two per bag. Without looking, the first person at each bag draws 5 pom-poms and the second draws 20. Each tallies their colours on the back of a blank card, colours the bar on the front, and copies the bag’s inflammation tag. Hold the pairs of cards up side by side.
Ask the room:
- Did the two people at the same bag make the same card?
- Which of the two cards do you trust more? Why?
- If the 5-ball card were all you had, what would you conclude about that bag?
Which bag you pick is biological variation, and which balls you draw is measurement variation. Every sample this week carries both, and sequencing deeper only reduces the second.
Hand out cards (3 min)
Give everyone one printed card. The eight volunteers keep their hand-made card. Explain the card on the slide: the front shows proportions, so every bar is the same length, and the small n is how many balls were drawn. The back has the counts and the inflammation tag. The printed cards came from the same kind of bags.
Round 1: closest partner, then pairs of pairs (12 min)
- Everyone finds the one card most like theirs and stands together, judging by the bars and ignoring the card numbers. A group of three is fine.
- Each pair finds its closest pair.
- Each group of four finds its closest group.
While they move, draw the merges on the whiteboard as a tree: two names joined, then two pairs joined. That drawing is a dendrogram.
Ask the room:
- How did you decide two cards were similar? That rule is a distance.
- When two groups both wanted the same pair, how did you settle it? That choice is the linkage rule, and software makes it for you.
- Who had trouble finding a partner? Look at the n on their card.
This is hierarchical clustering. Tomorrow afternoon the distance gets a name, Bray-Curtis, and the tree gets drawn by a computer.
Round 2: the floor is a plot (10 min)
Everyone stands where their card belongs on the taped axes: left to right by how much of the bar is blue, back to front by orange share minus green share. Take a photo from as high as you can, a chair is enough. The slides have a precomputed version of the plot if the photo does not work out.
Ask the room:
- The blue and pink cards are standing close together. Are their bars alike?
- We chose these two axes. What would you need to separate everyone properly?
A PCoA is the computer choosing the axes for you. It finds the directions along which the cards differ most, and it reports how much of the difference each axis captures.
Reveal and debrief (8 min)
Go past the spoiler slide. Show which bag each card came from, then the computer versions of both rounds: the floor plot, the PCoA, and the dendrogram.
Points to pull out:
- Cards with 5 to 10 balls end up in the wrong place more often. Too few reads turn into ordination error.
- Blends stand between groups. Real communities shift, and a clustering forces each one into a single group anyway.
- Two axes squash the blue and pink bags together. A third axis separates them.
Build the table (35 min)
People sit with whoever is near them. Groups will be different sizes, and that is fine. Each person gets a worksheet, and the group pools its cards.
On side 1, everyone copies the group’s cards into the columns, one card per column. The feature metadata is printed on the sheet. Point out the layout: sample information sits above the columns it describes, feature information sits beside the rows it describes. That alignment is what R has to keep in sync.
Side 2 has the questions. Walk round and push on these:
- Collapsing the rows: “makes lactic acid” plus “encodes lysin” does not equal the column total, because green is in both groups. Taxonomy is a hierarchy, so every row has one parent and adding up is safe. Gene sets overlap, so one gene counts in many sets, which matters for enrichment on Thursday.
- Keeping only high inflammation: crossing out columns in the counts means crossing out the same entries in the sample metadata, and the feature metadata stays as it is.
Report to the room (5 min)
Each group copies its two-by-two table (mostly lactic acid or not, high or low inflammation) onto the flip chart with its n. Add up the columns for the room total.
Ask the room:
- Did your table show the pattern the room shows?
- Was any group wrong, or just small?
On Wednesday afternoon you will put a p-value on this question and see how it changes with n.
Close (5 min)
Leave the flip chart up. Tomorrow morning the table has 220 rows of bacteria or 14,226 rows of human genes, and 471 columns, and the column totals and proportions from the worksheet are the first things you compute in R.