Space-time maps & tracking colony size with OpenCV in Python

One of the things that the Department of Integrated Mathematical Oncology at the Moffitt Cancer Center is doing very well, is creating an atmosphere that combines mathematics and experiment in cancer. Fellow TheEGG blogger, Robert Vander Velde is one of the new generation of cancer researchers who are combining mathematics and experiment. Since I left Tampa, I’ve had less opportunity to keep up with the work at the IMO, but occasionally I catch up on Slack.

A couple of years ago, Robert had a computer science question. One at the data analysis and visualization stage of the relationship between computer science and cancer. Given that I haven’t posted code on TheEGG in a long time, I thought I’d share some visualizations I wrote to address Robert’s question.

There are many ways to measure the size of populations in biology. Given that we use it in our game assay, I’ve written a lot about using time-lapse microscopy of evolving populations. But this isn’t the only — or most popular — approach. It is much more common to dillute populations heavily and then count colony forming units (CFUs). I’ve discussed this briefly in the context of measuring stag-hunting bacteria.

But you can also combine both approaches. And do time-lapse microscopy of the colonies as they form.

A couple of years ago, Robert Vander Velde Andriy Marusyk were working on experiments that use colony forming units (CFUs) as a measure of populations. However, they wanted to dig deeper into the heterogeneous dynamics of CFUs by tracking the formation process through time-lapsed microscopy. Robert asked me if I could help out with a bit of the computer vision, so I wrote a Python script for them to identify and track individual colonies through time. I thought that the code might be useful to others — or me in the future — so I wanted to write a quick post explaining my approach.

This post ended up trapped in the drafts box of TheEGG for a while, but I thought now is as good a time as any to share it. I don’t know where Robert’s work on this has gone since, or if the space-time visualizations I developed were of any use. Maybe he can fill us in in the comments or with a new guest post.
Read more of this post

Game landscapes: from fitness scalars to fitness functions

My biology writing focuses heavily on fitness landscapes and evolutionary games. On the surface, these might seem fundamentally different from each other, with their only common feature being that they are both about evolution. But there are many ways that we can interconnect these two approaches.

The most popular connection is to view these models as two different extremes in terms of time-scale.

When we are looking at evolution on short time-scales, we are primarily interested which of a limited number of extant variants will take over the population or how they’ll co-exist. We can take the effort to model the interactions of the different types with each other, and we summarize these interactions as games.

But when we zoom out to longer and longer timescales, the importance of these short term dynamics diminish. And we start to worry about how new types arise and take over the population. At this timescale, the details of the type interactions are not as important and we can just focus on the first-order: fitness. What starts to matter is how fitness of nearby mutants compares to each other, so that we can reason about long-term evolutionary trajectories. We summarize this as fitness landscapes.

From this perspective, the fitness landscapes are the more foundational concept. Games are the details that only matter in the short term.

But this isn’t the only perspective we can take. In my recent contribution with Peter Jeavons to Russell Rockne’s 2019 Mathematical Oncology Roadmap, I wanted to sketch a different perspective. In this post I want to sketch this alternative perspective and discuss how ‘game landscapes’ generalize the traditional view of fitness landscapes. In this way, the post can be viewed as my third entry on progressively more general views of fitness landscapes. The previous two were on generalizing the NK-model, and replacing scalar fitness by a probability distribution.

In this post, I will take this exploration of fitness landscapes a little further and finally connect to games. Nothing profound will be said, but maybe it will give another look at a well-known object.

Read more of this post

Fitness distributions versus fitness as a summary statistic: algorithmic Darwinism and supply-driven evolution

For simplicity, especially in the fitness landscape literature, fitness is often treated as a scalar — usually a real number. If our fitness landscape is on genotypes then each genotype has an associated scalar value of fitness. If our fitness landscape is on phenotypes then each phenotype has an associated scalar value of fitness.

But this is a little strange. After all, two organisms with the same genotype or phenotype don’t necessarily have the same number of offspring or other life outcomes. As such, we’re usually meant to interpret the value of fitness as the mean of some random variable like number of children. But is the mean the right summary statistic to use? And if it is then which mean: arithmetic or geometric or some other?

One way around this is to simply not use a summary statistic, and instead treat fitness as a random variable with a corresponding distribution. For many developmental biologists, this would still be a simplification since it ignores many other aspects of life-histories — especially related to reproductive timing. But it is certainly an interesting starting point. And one that I don’t see pursued enough in the fitness landscape literature.

The downside is that it makes an already pretty vague and unwieldy model — i.e. the fitness landscape — even less precise and even more unwieldy. As such, we should pursue this generalization only if it brings us something concrete and useful. In this post I want to discuss two aspects of this: better integration of evolution with computational learning theory and thinking about supply driven evolution (i.e. arrival of the fittest). In the process, I’ll be drawing heavily on the thoughts of Leslie Valiant and Julian Z. Xue.

Read more of this post

Abstracting evolutionary games in cancer

As you can tell from browsing the mathematical oncology posts on TheEGG, somatic evolution is now recognized as a central force in the initiation, progression, treatment, and management of cancer. This has opened a new front in the proverbial war on cancer: focusing on the ecology and evolutionary biology of cancer. On this new front, we are starting to deploy new kinds of mathematical machinery like fitness landscapes and evolutionary games.

Recently, together with Peter Jeavons, I wrote a couple of thousand words on this new machinery for Russell Rockne’s upcoming mathematical oncology roadmap. Our central argument being — to continue the war metaphor — that with new machinery, we need new tactics.

Biologist often aim for reductive explanations, and mathematical modelers have tended to encourage this tactic by searching for mechanistic models. This is important work. But we also need to consider other tactics. Most notable, we need to look at the role that abstraction — both theoretical and empirical abstraction — can play in modeling and thinking about cancer.

The easiest way to share my vision for how we should approach this new tactic would be to throw a preprint up on BioRxiv or to wait for Rockne’s road map to eventually see print. Unfortunately, BioRxiv has a policy against views-like articles — as I was surprised to discover. And I am too impatient to wait for the eventual giant roadmap article.

Hence, I want to share some central parts in this blog post. This is basically an edited and slightly more focused version of our roadmap. Since, so far, game theory models have had more direct impact in oncology than fitness landscapes, I’ve focused this post exclusively on games.
Read more of this post

Token vs type fitness and abstraction in evolutionary biology

There are only twenty-six letters in the English alphabet, and yet there are more than twenty-six letters in this sentence. How do we make sense of this?

Ever since I first started collaborating with David Basanta and Jacob Scott back in 2012/13, a certain tension about evolutionary games has been gnawing at me. A feeling that a couple of different concepts are being swept up under the rug of a single name.[1] This feeling became stronger during my time at Moffitt, especially as I pushed for operationalizing evolutionary games. The measured games that I was imagining were simply not the same sort of thing as the games implemented in agent-based models. Finally this past November, as we were actually measuring the games that cancer plays, a way to make the tension clear finally crystallized for me: the difference between reductive and effective games could be linked to two different conceptions of fitness.

This showed a new door for me: philosophers of biology have already done extensive conceptual analysis of different versions of fitness. Unfortunately, due to various time pressures, I could only peak through the keyhole before rushing out my first draft on the two conceptions of evolutionary games. In particular, I didn’t connect directly to the philosophy literature and just named the underlying views of fitness after the names I’ve been giving to the games: reductive fitness and effective fitness.

Now, after a third of a year busy teaching and revising other work, I finally had a chance to open that door and read some of the philosophy literature. This has provided me with a better vocabulary and clearer categorization of fitness concepts. Instead of defining reductive vs effective fitness, the distinction I was looking for is between token fitness and type fitness. And in this post, I want to discuss that distinction. I will synthesize some of the existing work in a way that is relevant to separating reductive vs. effective games. In the process, I will highlight some missing points in the current debates. I suspect this points have been overlooked because most of the philosophers of biology are focused more on macroscopic organisms instead of the microscopic systems that motivated me.[2]

Say what you will of birds and ornithology, but I am finding reading philosophy of biology to be extremely useful for doing ‘actual’ biology. I hope that you will, too.

Read more of this post

Ontology of player & evolutionary game in reductive vs effective theory

In my views of game theory, I largely follow Ariel Rubinstein: game theory is a set of fables. A collection of heuristic models that helps us structure how we make sense of and communicate about the world. Evolutionary game theory was born of classic game theory theory through a series of analogies. These analogies are either generalizations or restrictions of the theory depending on if you’re thinking about the stories or the mathematics. Given this heuristic genealogy of the field — and my enjoyment of heuristic models — I usually do not worry too much about what exactly certain ontic terms like strategy, player, or game really mean or refer to. I am usually happy to leave these terms ambiguous so that they can motivate different readers to have different interpretations and subsequently push for different models of different experiments. I think it is essential for heuristic theories to foster this diverse creativity. Anything goes.

However, not everyone agrees with Ariel Rubinstein and me; some people think that EGT isn’t “just” heuristics. In fact, more recently, I have also shifted some of my uses of EGT from heuristics to abductions. When this happens, it is no longer acceptable for researchers to be willy-nilly with fundamental objects of the theory: strategies, players, and games.

The biggest culprit is the player. In particular, a lot of confusion stems from saying that “cells are players”. In this post, I’d like to explore two of the possible positions on what constitutes players and evolutionary games.

Read more of this post

Multiplicative versus additive fitness and the limit of weak selection

Previously, I have discussed the importance of understanding how fitness is defined in a given model. So far, I’ve focused on how mathematically equivalent formulations can have different ontological commitments. In this post, I want to touch briefly on another concern: two different types of mathematical definitions of fitness. In particular, I will discuss additive fitness versus multiplicative fitness.[1] You often see the former in continuous time replicator dynamics and the latter in discrete time models.

In some ways, these versions are equivalent: there is a natural bijection between them through the exponential map or by taking the limit of infinitesimally small time-steps. A special case of more general Lie theory. But in practice, they are used differently in models. Implicitly changing which definition one uses throughout a model — without running back and forth through the isomorphism — can lead to silly mistakes. Thankfully, there is usually a quick fix for this in the limit of weak selection.

I suspect that this post is common knowledge. However, I didn’t have a quick reference to give to Pranav Warman, so I am writing this.
Read more of this post

Multiple realizability of replicator dynamics

Abstraction is my favorite part of mathematics. I find a certain beauty in seeing structures without their implementations, or structures that are preserved across various implementations. And although it seems possible to reason through analogy without (explicit) abstraction, I would not enjoy being restricted in such a way. In biology and medicine, however, I often find that one can get caught up in the concrete and particular. This makes it harder to remember that certain macro-dynamical properties can be abstracted and made independent of particular micro-dynamical implementations. In this post, I want to focus on a particular pet-peeve of mine: accounts of the replicator equation.

I will start with a brief philosophical detour through multiple realizability, and discuss the popular analogy of temperature. Then I will move on to the phenomenological definition of the replicator equation, and a few realizations. A particular target will be the statement I’ve been hearing too often recently: replicator dynamics are only true for a very large but fixed-size well-mixed population.

Read more of this post

Choosing units of size for populations of cells

Recently, I have been interacting more and more closely with experiment. This has put me in the fortunate position of balancing the design and analysis of both theoretical and experimental models. It is tempting to think of theorists as people that come up with ideas to explain an existing body of facts, and of mathematical modelers as people that try to explain (or represent) an existing experiment. But in healthy collaboration, theory and experiment should walk hand it hand. If experiments pose our problems and our mathematical models are our tools then my insistence on pairing tools and problems (instead of ‘picking the best tool for the problem’) means that we should be willing to deform both for better communication in the pair.

Evolutionary game theory — and many other mechanistic models in mathematical oncology and elsewhere — typically tracks population dynamics, and thus sets population size (or proportions within a population) as central variables. Most models think of the units of population as individual organisms; in this post, I’ll stick to the petri dish and focus on cells as the individual organisms. We then try to figure out properties of these individual cells and their interactions based on prior experiments or our biological intuitions. Experimentalists also often reason in terms of individual cells, making them seem like a natural communication tool. Unfortunately, experiments and measurements themselves are usually not about cells. They are either of properties that are only meaningful at the population level — like fitness — or indirect proxies for counts of individual cells — like PSA or intensity of fluorescence. This often makes counts of individual cells into an inferred theoretical quantity and not a direct observable. And if we are going to introduce an extra theoretical term then parsimony begs for a justification.

But what is so special about the number of cells? In this post, I want to question the reasons to focus on individual cells (at the expense of other choices) as the basic atoms of our ontology.

Read more of this post

Lotka-Volterra, replicator dynamics, and stag hunting bacteria

Happy year of the monkey!

Last time in the Petri dish, I considered the replicator dynamics between type-A and type-B cells abstractly. In the comments, Arne Traulsen pointed me to Li et al. (2015):

We have attempted something similar in spirit with bacteria. Looking at frequencies alone, it looked like coordination. But taking into account growth led to different conclusions […] In that case, things were more subtle than anticipated…

So following their spirit, I will get more concrete in this post and replace type-A by Curvibacter sp. AEP13 and type-B by Duganella sp. C1.2 — two bacteria that help fresh water Hydra avoid fungal infection. And I will also show how to extend our replicator dynamics with growth and changing cell density.

Although I try to follow Arne’s work very closely, I had not read Li et al. (2015) before, so I scheduled it for a reading group this past Friday. I really enjoyed the experiments that they conducted, but I don’t agree with their interpretations that taking growth into account leads to a different conclusion. In this post, I will sketch how they measured their experimental system and then provide a replicator equation representation of the Lotka-Volterra model they use to interpret their results. From this, we’ll be able to conclude that C and D are playing the Stag Hunt — or coordination, or assurance, pick your favorite terminology — game.

Read more of this post