Competition and niche construction in a model of cancer metastasis

Niche construction theory states that not only does the environment act on populations to generate Darwinian selection, but organisms reciprocally modify the environment and the sources of natural selection. Cancer cells participate in niche construction as they alter their microenvironments and create pre-metastatic niches; in fact, metastasis is a product of niche construction. Here, we present a mathematical model of niche construction and metastasis. Our model contains producers, which pay a cost to contribute to niche construction that benefits all tumor cells, and cheaters, which reap the benefits without paying the cost. We derive expressions for the conditions necessary for metastasis, showing that the establishment of a mutant lineage that promotes metastasis depends on niche construction specificity and strength of interclonal competition. We identify a tension between the arrival and invasion of metastasis-promoting mutants, where tumors composed only of cheaters remain small but are susceptible to invasion whereas larger tumors containing producers may be unable to facilitate metastasis depending on the level of niche construction specificity. Our results indicate that even if metastatic subclones arise through mutation, metastasis may be hindered by interclonal competition, providing a potential explanation for recent surprising findings that most metastases are derived from early mutants in primary tumors.


Introduction
A cancer tumor is a population of genetically and phenotypically diverse cells that compete, propagate, and contribute (or not) to the cellular society. Tools from population biology are therefore increasingly used to study cancer dynamics. Cancer's genetic instability and high mutation rate, compounded with harsh spatial constraints, a dearth of nutrients, and immune surveillance, lead to rapid selection for the survival of the fittest tumor cells. However, the evolutionary dynamics of tumors are only fully comprehensible when the ecological context -the tumor ecosystem -is considered [1]. This entails applying ecological concepts such as predation, niches, and invasion. Accordingly, a number of ecological models have provided useful insight into cancer progression [2,3].
A recently influential idea in ecology is that not only does the environment act on a population to generate selection pressures and Darwinian evolution, but organisms reciprocally modify the environment through a process called niche construction (also known as ecological engineering) [4,5]. Via niche construction, organisms not only influence aspects of the ecosystem such as resource flow and trophic relationships, but they modify the actual sources of natural selection acting on themselves and their neighbors. For example, new selection pressures on beavers' teeth, tail, and social behavior arise due to the construction of a dam [5]. The environmental modifications resulting from niche construction may be passed down to descendants through ecological inheritance, which has been recognized as a key aspect of extra-genetic inheritance [6].
Niche construction also likely plays an important role in cancer population biology. Cancer cells greatly alter their microenvironments [7][8][9]. For example, tumor cells release angiogenic factors such as vascular endothelial growth factor and stimulate vascularization [10][11][12], reduce local pH [13], release a gamut of growth factors such as insulin-like growth factor II [14], and secrete matrix metalloproteinases that degrade extracellular matrix proteins [10]. Tumors also create a nutrient-poor ecosystem with drastically altered flow of nutrients and signaling factors that are passed down to descendant cells via ecological inheritance.
In this paper, we use niche construction theory to examine metastasis. Metastasis is not simply a result of mutation of tumor subclones into more invasive phenotypes; it requires the establishment of a pre-metastatic niche [9,15]. The pre-metastatic niche, a concept dating back to Paget's "seed and soil" hypothesis, describes the process through which primary tumors prepare distant sites for reception of future metastatic cells [16]. Successful settlement of a metastatic site requires a variety of secreted factors that are released by the primary tumor, diffuse through the bloodstream, and make the site favorable for settlement. These factors are diverse, including IL-6, TGFβ, SDF1, TNF-α, VEGF, lysyl oxidase, and exosomes [9,15,17,18]. For example, secreted factors can induce deposition of fibronectin and recruitment of myeloid cells to future metastatic sites [17][18][19].
Although multiple groups have recognized the applicability of niche construction theory to cancer [7,8], there are only a few models of the phenomenon. Among these, Bergman and Gligorijevic [9] proposed a framework to integrate experimental metastasis data with niche construction theory, with the goal of providing a predictive model that can be directly parameterized. Another model by Gerlee and Anderson [20] studied the evolution of tumor carrying capacity as a function of niche construction. They assumed that niche construction increases the tumor carrying capacity, a phenomenon commonly seen in ecological settings. They noted that tumors may include both producers, which actively contribute to niche construction, and cheaters, which reap the benefits of niche construction without paying the growth rate cost of production. They showed that the specificity of the benefits from niche construction as well as spatial structure maintains selection for producers and allows for coexistence of cheaters and producers.
Another idea that motivates our model is the recent observation that metastatic cell lineages tend to diverge from the primary tumor early on [21]. In other words, metastasis involves mutations that occur early in the tumor's lifetime. This finding contradicts the linear progression model of cancer, where metastatic tumors arise from late-stage primary tumors. This finding is somewhat paradoxical, since later-stage primary tumors are bigger and harbor more mutations from which metastatic tumors might arise, and hence one might expect more metastatic tumors to be derived from late-stage tumors. As we will see below, competition between local and pre-metastatic niche constructors may provide a potential answer to this paradox.
We present a mathematical model of niche construction and metastasis in cancer. Our model contains producers of both the primary tumor (i.e., local) niche and the premetastatic niche, as well as cheaters. We model a tumor population with a carrying capacity that increases with local niche construction. We derive expressions for the ecological conditions necessary for metastasis, showing that they depend on niche construction specificity and the interclonal competition structure. Our results reveal a robust trade-off between the arrival of metastasis-promoting mutants and their ability to invade a tumor. Tumors composed only of cheaters remain small but are susceptible to invasion by cells that construct the pre-metastatic niche, whereas larger tumors containing producers may be unable to facilitate metastasis depending on the level of niche construction specificity. In certain competition structures, tumors containing only local producers can completely preclude metastasis unless invasion of metastasis-promoting subclones occurs early on. Our results highlight the fact that metastasis requires both the necessary genetic mutations and a suitable ecological milieu: even if metastatic subclones arise through mutation, invasion may not be possible due to competitive exclusion and a lack of niche opportunities. These findings can explain the observation that metastasis involves early mutations [21].

Methods
We consider a primary tumor with N cells, which can include both producers and cheaters, and a bloodstream into which tumor cells can enter via intravasation. (An extended form of the model is shown in Supplementary Information (SI) section SI-A.) Producers participate in niche construction at a cost to their growth rate, since it takes energy and metabolic resources to secrete angiogenic factors, growth factors, and matrix metalloproteinases. Cheaters do not participate in niche construction but still benefit from it, so they have a higher growth rate than producers. We assume that a cell's type (producer or cheater) is determined genetically.
There are three subsets of producers. Local producers contribute only to niche construction in the tumor's immediate microenvironment, benefiting primary tumor cells but not circulating or metastasized cells. The extent of local niche construction is represented by the amount of resource R, a general resource that for example could represent the amount of recruited vasculature. The primary tumor also includes secondary producers, which contribute to the spatially distant pre-metastatic niche to allow circulating tumor cells to settle down to form a secondary tumor. As mentioned above, this involves secreting chemokines and growth factors into the bloodstream. These molecules are carried away from the primary tumor and provide no benefit to primary tumor cells, so construction of the pre-metastatic niche is not included in the variable R. Secondary producers pay a growth cost similar to primary producers, but they otherwise act as cheaters from the primary tumor's point of view since they benefit from R without contributing to it. Additionally, there are global producers that contribute to niche construction in both the primary microenvironment and the pre-metastatic niche and pay double the growth rate cost.
Cells are given a subscript (x, y), where x ∈ {0, 1} describes participation in local niche construction (0 for cheaters and 1 for producers) and y ∈ {0, 1} similarly denotes participation in pre-metastatic niche construction. The population of each cell type is n x,y with respective growth rates r x,y . Local and global producers increase R with rate g and R suffers independent resource depletion with rate l. Figure 1: Schematic representation of the model, which considers a primary tumor with four cell types and a distant pre-metastatic niche. Cheaters are white, local producers are blue, secondary producers are red, and global producers are both red and blue. Niche construction occurs in the primary microenvironment through production of resource R, which benefits the tumor by increasing carrying capacity, represented a as dotted line. Construction of the pre-metastatic niche by primary tumor cells is represented by the red arrow.
Primary tumor cells enter the bloodstream as a result of intravasation. Local crowding has been suggested to cause a reduction in tumor cell fitness and lead to increased mutation rate and ecological dispersal [7]. To account for this hypothesis, we introduce a function m(N, R) representing the rate primary tumor cells exit the local niche and enter the bloodstream. We assume this function has the form m(N, R) = αN k+βR(t) where α is a constant and the denominator is the carrying capacity (discussed below). Cells tend to migrate more when they receive less of the share of resources in the microenvironment.

Carrying capacity
We assume carrying capacity increases linearly with niche construction. Primary and secondary tumors possess intrinsic carrying capacity k, which can represent the number of cells that can survive without significant self-induced angiogenesis or release of growth factors. In the primary tumor, the carrying capacities of cheaters and secondary producers are both k + β 0 R(t) while those of primary and global producers are k + β 1 R(t). β 0 and β 1 are constants describing the benefit that either cheaters or producers receive from niche construction. If β 0 ̸ = β 1 , then either cheaters or producers use the resource more efficiently. This is analogous to the specificity of niche construction in Gerlee and Anderson's model [20]. If β 1 β 0 > 1, modifications of the niche are specific to the genotype that generates it and cheaters are less able to free-ride. Strong specificity refers to β 1 β 0 ≫ 1.

Competition
We assume cells grow according to Lotka-Volterra competition equations, shown in Table 1 with the parameters summarized in Table 2. We consider multiple competition structures with varying competition strength among the four cell types, summarized in Figure 2. In each, the strength of inter-type competition between the four cell types (symmetric in competition structures I and II) is denoted by Greek letters whose values are positive and less than or equal to 1. The magnitude of intraclonal competition is 1, such that interclonal competition strength is weaker than or equal to intraclonal competition. Biologically, stronger intra-type competition can stem from spatial considerations since cellular neighbors tend to be of the same cell type. Alternatively, stronger intra-type competition can arise because different cell types utilize other resources (that we do not explicitly model) differentially. For example, cheaters focus on cell division and require a significant commitment to nucleotide biosynthesis and genome duplication. Producers, on the other hand, focus on protein production.
Competition structure I is the most general symmetric case. In competition structure II, interclonal competition between producers is as strong as intraclonal competition, while cheaters compete less with all three producer types. This scenario may arise if primary and secondary niche construction require similar metabolic resources so all producers occupy the same niche, whereas cheaters focus on their own division instead of ecological engineering. Competition structure III assumes the two niches are producing and cheating The strength of competition between each cell type is shown along connections in the lattice. Intraclonal competition is 1 for all cell types. ϕ, θ, and ψ are positive and less than 1. ν, µ, and ω are positive and less than or equal to 1. In competition structure III, the two distinct niches are represented by boxes. Cells that cheat in the primary tumor experience competition of magnitude θ due to, and compete with magnitude ϕ with, cells that produce the primary resource.
in the primary tumor regardless of propensity for secondary resource production. From the primary tumor's standpoint, cheaters and secondary producers may occupy the same niche since neither cell type participates in local niche construction, while local and global producers both do and thus occupy a distinct niche. Intra-niche competition is as strong as intraclonal competition, while inter-niche competition is weaker.

Primary cheaters
dn 00 dt = r 00 n 00 ( 1 − n 00 + ϕn 01 + θn 10 Secondary producers dn 01 dt = r 01 n 01 ( 1 − ϕn 00 + n 01 + ωn 10 + νn 11 ) Primary producers dn 10 dt = r 10 n 10 Table 1: Governing equations of the model under competition structure I, and the corresponding variables whose rates of change they describe. Time dependence of n and R have been suppressed for notational simplicity. Dependence of m on N and R has also been suppressed. The equations for competition structures II and III are shown in SI section SI-B.

Separation of time-scales
Simulations of the model (shown in SI section SI-C) show that, for reasonable parameters (inferred from the literature in SI-D), cell populations equilibrate more quickly than the resource dynamics. The latter keep growing without reaching an equilibrium at timescales relevant to tumor growth (i.e. the lifespan of a human). This is biologically intuitive since niche construction processes such as microenvironment vascularization are generally slower than cell division. This allows us to make a separation of time-scales argument. In particular, we consider the cell dynamics (equations 1.1-1.4) to be fast and the resource dynamics (equation 1.5) to be slow. We first analyze the fast-changing variables while treating the slow-changing variable as constant. In other words, we find the equilibria of equations 1.1-1.4 while holding R constant (we refer to these equilibria of the fast dynamics, which are functions of R, as "quasi-equilibria"). Then, we analyze the dynamics of the slow variable R while assuming the fast variables are at a quasi-equilibrium.
Parameter/variable Description n xy , r xy number and growth rate of xy-type cells β 0 benefit from niche construction for cheaters and 2°producers β 1 benefit from niche construction for local and global producers k intrinsic carrying capacity α intravasation rate θ, ϕ, ω, ψ, µ, ν interclonal competition terms (see Figure 2) g resource production rate l independent resource depletion rate Table 2: A summary of the model parameters, some of which are estimated as described in SI section SI-D.

Results
For each competition structure, we examine a primary tumor that initially consists of only cheaters and local producers. The conditions for metastasis are equivalent to the invasion conditions of secondary or global producers into this tumor, since pre-metastatic niche construction is required for circulating tumor cells to settle into a secondary site. For invasion of secondary producers, dn 01 (t) dt must be positive if a small but nonzero number of secondary producers cells are suddenly added to the population (e.g. through mutation). For invasion of global producers, dn 11 (t) dt must be positive if a small but nonzero number of global producers are suddenly added to the population. There are three possible non-trivial quasi-equilibria of a local tumor: cheaters only, local producers only, and coexistence. We determine the stability of each quasi-equilibrium and evaluate the invasion conditions for secondary and global producers. These results for each competition structure are outlined in Table 3 and considered in detail below.
Tumors containing producers have a large amount of resource, i.e. R >> k, since the producer-only and coexistence quasi-equilibria result in rapid resource accumulation. On the other hand, tumors starting with cheaters only have low R, i.e. k >> R since there is no niche construction. Additionally, α ≈ 0 in any sum since α is several orders of magnitude smaller than any other parameter (see SI section SI-D). We use these facts in simplifying the derivation of stability and invasion conditions. The trajectories the tumor can undergo depend on niche construction specificity and inter-type competition structure. We consider each possibility in detail below.
Competition structure Invasion of global producers µ < 1 false false Cheater-only stability false false false Invasion of global producers true (ψ < 1)

Competition structure I
The invasion conditions for secondary producer and global producers are, respectively, For large R and small α, the producer-only quasi-equilibrium is stable when This inequality means that the higher the specificity of niche construction (measured by β 1 β 0 ) the less likely cheaters are able to invade the population. Secondary producers can invade the local producer-only tumor if This condition similarly means that the higher the niche construction specificity, the less likely the invasion of secondary producers. If ω < θ, there is a window of specificity where the producer-only tumor is resistant to invasion by cheaters but susceptible to invasion by secondary producers. On the other hand, global producers can invade the producer-only tumor if Thus, the stability and resistance to invasion of a tumor containing only producers depends on the strength of interclonal competition and may depend additionally on niche construction specificity.
Secondary producers can invade the coexistence quasi-equilibrium if For high niche specificity, this is satisfied when ϕθ > ω, which is unlikely given that competition between cheaters and any producer type is less than competition among producers. Global producers can invade a tumor at coexistence if Importantly, whether a metastasis-promoting subclone can invade a tumor containing both cheaters and local producers depends on both niche construction specificity and competition strength. Finally, it is easy to see from equations 2 and 3 that a cheater-only tumor (with R = 0 and α ≪ 1) can always be invaded by any producer cell type regardless of specificity, as long as ϕ and ψ < 1.
These results point to an interesting trade-off: cheater-only tumors offer no competitive obstacle to metastasis. However, they remain small due to the lack of niche construction, which constrains the number of mutations they might experience that can lead to secondary or global producer clones. In contrast, if local producers invade first the tumor grows bigger, increasing the arrival rate of mutations, yet simultaneously the invasion conditions for a secondary or global producer become more stringent so that the pre-metastatic niche may be precluded by competition. As we discuss below, this tension is even more apparent in other competition structures. Figure 4 schematically illustrates this trade-off for all competition structures.

Competition structure II
The invasion conditions for secondary and global producers are, respectively, n 00 (ψ + α r 11 ) + n 10 (1 + α Producer-only tumors can be invaded by secondary producers when i.e. when there is no niche specificity and cells that do not produce the resource must benefit from it more than cells that do. Global producers cannot invade the producer-only tumor under this competition structure.
At the coexistence quasi-equilibrium, invasion of secondary producers can occur if This condition is less likely to be true with increasing specificity. Global producers can invade when Both invasion conditions for tumors with coexistence depend on the strength of competition and niche specificity. The cheater-only tumor, on the other hand, is always vulnerable to invasion by any producer cell types, just like for competition structure I. The trade-off between mutant arrival and invasion is reproduced in this competition structure and is even more apparent since global producers cannot invade producer-only tumors. Once again, stability and invasion of tumors containing producers depend on competition strength and specificity while cheaters are generally susceptible regardless of specificity.

Competition structure III
The invasion conditions for secondary producers and global producers are, respectively, n 00 (ϕ + α r 11 ) + n 10 (1 + α r 11 The condition for stability of the local producer-only quasi-equilibrium is equation 4, just like the other two competition structures. Global producers cannot invade produceronly tumors, while invasion of secondary producers is possible when As niche construction specificity increases, this condition is less likely to be true. This invasion condition is mutually exclusive with the stability of the quasi-equilibrium. If θ > β 0 β 1 then the tumor remains at the stable producer-only quasi-equilibrium and is resistant to invasion by cheaters, global producers, and secondary producers. If θ < β 0 β 1 the quasiequilibrium is unstable and susceptible to invasion by cheaters or secondary producers. The larger the competition that secondary producers would experience from local producers, the more efficiently they must be able to use the resource in order to invade.
At the coexistence quasi-equilibrium, the invasion condition for secondary producers is This condition is never fulfilled since secondary producers pay a growth rate cost relative to cheaters. The condition for invasion of global producers is The coexistence quasi-equilibrium allows for invasion of cells that contribute to the premetastatic niche only if they also contribute to local niche construction and only under certain levels of interclonal competition and specificity. Even if the necessary mutations for genesis of secondary producers occur, ecological conditions prevent the invasion of the lineage. Coexistence of cheaters and local producers can obstruct successful metastasis through a failure of settlement into the pre-metastatic niche rather than a failure of intravasation.
On the other hand, the cheater-only quasi-equilibrium is unstable and always vulnerable to invasion by global producers. Secondary producers can invade if i.e. if primary producers grow more slowly than secondary producers, which is probable since the growth rate cost of local niche construction is likely higher than that of preparing the pre-metastatic niche, again highlighting the susceptibility of cheater-only tumors to invasion by all producers.
In short, for all competition structures we consider, tumors with cheaters only are easily invaded while tumors containing producers are more difficult to invade, with restrictions on competition strength and niche construction specificity. To confirm this tension between invasion and mutation, we simulated the tumor and resource dynamics starting with cheaters only. The mutation rate in cancer is estimated to be 2 × 10 −7 per cell division per gene [22] and the cell cycle length is approximately one day for at least some cancers [23]. We thus use a daily mutation rate of 2 × 10 −7 and assume 1 out of 1000 mutations creates (11) cells from (00) cells or (10) cells from (01) cells. We assume 1 out of 500 mutations creates (01) or (10) cells from (00) cells, or (11) or (00) cells from (10) cells, since these cellular transformations do not require as drastic a phenotypic alteration. These mutation probabilities are somewhat arbitrary but the trade-off is robust to the choice of specific mutation probabilities. Figure 3a shows a common tumor trajectory with clinically realistic tumor size. The tumor starts with cheaters and does not increase in size initially after arriving at the carrying capacity without producers. Once producers arise by mutation and successfully invade, cheaters go extinct. The tumor increases in size as resource production commences. The increasing size leads to numerous mutations, but these mutations do not lead to successful invasion since R has accumulated to a high level and we showed above that a stable producer-only quasi-equilibrium with high R is resistant to invasion. Figure 3b shows a clear trade-off between mutation rate and invasion. In tumors where producers arise from mutation and invade, size increases with time. The number of mutations increases drastically with tumor size, but these mutations all result in failed invasion. In tumors that remain cheater-only, successful invasion of secondary or global producers is possible, as shown by red triangles. There is a much smaller number of mutations for cheater-only tumors due to their small size, but once a mutation does arise, invasion is much more probable than in larger producer-only tumors. Figure 4 schematically summarizes the trajectory tumors can undergo starting from cheaters only, in light of the results presented above. After tumorigenesis, cheaters proliferate and approach the intrinsic carrying capacity. The small initial tumor is always unstable and can be invaded by any producer cell type regardless of specificity. It can promote metastasis as long as the necessary mutations occur to generate secondary or global producers. However, to continue expanding the tumor population, niche construction is necessary. Mutations can lead to the appearance of producers from the cheater-only tumor, which saves the population from stagnation. Subsequent tumors reaching either coexistence or extinction of cheaters can, however, be resistant to invasion by metastasispromoting lineages, depending on competition strength and niche construction specificity. Furthermore, under competition structure III, any tumor at the stable local produceronly quasi-equilibrium is resistant for all levels of specificity and any tumor containing coexistence is resistant to invasion by secondary producers.

Discussion
We presented a simple model of niche construction in cancer, where local niche construction benefits all primary tumor cells by increasing the carrying capacity, and secondary niche construction (construction of the pre-metastatic niche) is needed for successful metastasis. Primary tumor cells can contribute to niche construction in one or both of the sites at a cost to their growth rate. Cheaters can reap the benefits of niche construction without paying the cost. Although no definitive information exists on the relative strengths of interclonal competition and density dependence, we have analyzed three plausible competition structures of varying generality.
The primary tumor, without any distant or global producers, can arrive at one of three nontrivial quasi-equilibria: extinction of cheaters, extinction of local producers, or coexistence of local producers and cheaters. The cheater-only quasi-equilibrium is vulnerable to invasion by any producer cell type, independent of niche construction specificity, as long as interclonal competition is weaker than intraclonal. On the other hand, quasi-equilibria containing producers have different requirements for stability and varying levels of susceptibility to the invasion of secondary or global producers, dependent on the strength of interclonal competition and niche construction specificity. The invasion of primary tumor cells that contribute to the pre-metastatic niche is a necessary condition for settlement of the secondary tumor site. Importantly, susceptibility or resistance to invasion are not intrinsic to a tumor, but are crafted through an ecological pathological relationship between the tumor and its microenvironment. Metastasis requires the necessary mutations for the genesis of certain subclones and also an ecological milieu that facilitates invasion of these subclones. Even if the appropriate mutations occur, the cells could fail to invade and instead die off if the tumor is resistant to invasion. We have shown that such resistance is more likely to occur in tumors containing producers, which are larger and accumulate more mutations. Small, cheater-only tumors experience fewer mutations yet are more able to facilitate the successful proliferation of metastasis-promoting lineages.
Under all three competition structures, tumors containing only producers also demonstrate a trade-off between stability and the ability of secondary producers to invade. Regardless of interclonal competition strength, increasing niche specificity promotes stability of the producer-only tumor such that cheaters are unable to invade. This result agrees with Gerlee and Anderson's findings that selection for niche construction requires sufficient specificity, as specificity keeps cheaters from free-riding [20]. However, we find that niche construction specificity makes it less likely that secondary producers can invade a producer-only tumor. This stems from the fact that secondary producers do not produce the primary resource and therefore are also selected against due to specificity of the resource. On the other hand, the ability of global producers to invade this tumor does not depend on niche construction specificity since they also produce the local resource and benefit with the same efficiency as local producers. Instead, invasion is possible only under competition structure I and only if interclonal competition between global and secondary producers is weaker than intraclonal competition.
Our main result is identifying a trade-off between the arrival of mutations leading to metastasis and their invasion success. This trade-off may help explain the early metastasis hypothesis, which posits that metastasis is not necessarily a late event in the tumor history, but rather can occur while the tumor is still small. Many genetic and clinical studies support this view [24]. For example, evidence suggests that cells in metastases are genetically less progressed in terms of tumor progression than primary tumor cells at diagnosis [25,26] and that metastases do not necessarily not come from large tumors [27]. Studies of breast cancer metastasis suggest that it can be an early event [28][29][30][31][32]. Similarly, it has been proposed that metastatic capacity stems from mutations acquired early in a tumor history [33], an idea supported by a recent analysis of tumor phylogenies that shows early genetic divergence of metastatic lineages [21]. These observations contradict the idea that cancer follows a linear progression in which late-stage primary tumors facilitate metastasis. However, the idea that metastasis is not a late event may be paradoxical because late primary tumors are larger and harbor more mutations that can lead to the genesis of metastatic lineages. Our results indicate that this paradox and the early metastasis phenomenon may potentially operate through a tension between mutant arrival and invasion caused by competition between local and pre-metastatic niche constructors late in a tumor history. Secondary or global producers must invade while the tumor is still small, and if they do the pre-metastatic niche will begin recruiting circulating tumor cells from an early time point. Otherwise, the pre-metastatic niche may remain unprepared, since larger, late primary tumors containing producers may be resistant to invasion by pre-metastatic niche constructors. Large tumors participate in metastasis as long as invasion occurred while the tumor was still small. Accordingly, empirical evidence suggests that construction of the pre-metastatic niche is the limiting factor for establishing secondary tumors, not dissemination of circulating tumor cells which is independent of tumor size [27] and occurs starting early on [34]. Thus, our results showing a tension between mutation and invasion supports the idea that metastasis begins early and provides a potential explanation for a paradoxical aspect of nonlinear tumor progression.
One implication of our results is that if certain types of cancers may be resistant to metastasis even over long periods of time despite the accumulation of mutations. This happens if the tumor switches to a producer-only or coexistence state and with high nicheconstruction specificity and relatively high competition between different producer clones. Cancers that are not associated with metastasis are known since the work of Paget [16], who first proposed the "seed and soil" hypothesis. Our model suggests there could be an ecological, rather than genetic, explanation for the tendency of certain cancers to be less likely to metastasize. Resistance to invasion of metastatic subclones can be characteristic of particular cancers based on the typical cell types within the primary tumor cell population and the way they compete and use resources, rather than from a lack of necessary mutations.
Under competition structure III we find that in the coexistence quasi-equilibrium, reducing the growth rate of cheaters promotes the invasion of secondary producers. Chemotherapy is a method of targeting rapidly dividing cells and likely to disproportionately affect cheaters [35]. Thus, it is possible for chemotherapy to depress cheater growth rate enough such that r 00 < r 01 , which would lead to equation 17 to be satisfied and secondary producers to invade, a necessary step towards metastasis. This result is consistent with accumu-lating evidence that chemotherapy may increase the potential for metastasis by increasing pro-tumorigenic growth factors in the blood and mobilizing bone marrow-derived progenitor cells to make the secondary tumor site more receptive to circulating tumor cells [36][37][38].
The assumption that intra-type competition is stronger than inter-type competition is central to our results. This assumption, shared with other models of clonal dynamics [39,40], can be viewed as an expression of the fact that cellular neighbors tend to be of the same cell type and competition for resources occurs on a local spatial scale. A wealth of mathematical and experimental evidence shows that tumors contain spatial clustering of subclones with relatedness decreasing as distance increases between cells [20,[41][42][43][44][45][46][47]. Another biological mechanism for stronger intraclonal competition is that different producer and cheater clones might occupy different niches, due to their different metabolic needs and utilization of different cellular pathways.
Another assumption we made was that the benefit of niche construction is manifested by increasing carrying capacity of both producers and cheaters [20]. Cancer cells thrive at cellular densities considerably higher than that of normal host cells [48]. Increased carrying capacity due to niche construction can be achieved through many mechanisms; perhaps the most obvious is angiogenesis. Tumors often live in highly acidic microenvironments due to their increased glycolytic metabolism. Inducing vascularization delivers oxygen, clears metabolic waste products, provides nutrients, and provides growth factors. It has been established that tumors larger than 1-2 mm are supported by newly formed blood vessels through secretion of various angiogenic factors, including PDGF (plateletderived growth factor), AngI, AngII, and VEGF [49,50]. One model used tumor carrying capacity as a function of blood vessel density due to the importance of tumor-induced angiogenesis [49], and this is essentially carrying capacity as a function of niche construction. Another example is the release of autocrine factors by tumor cells, since this increases their ability to divide despite high cell density [20]. In vitro [51] and in vivo [52] studies have observed tumors with a subset of producers that contributed to overall population growth through the secretion of diffusable growth factors. This is evidence that a tumor can have producers and cheaters with an increasing carrying capacity.
In summary, we have created a mathematical model to study metastasis as an outcome of niche construction. Our results suggest that there exists a tension between mutant arrival and invasion. Tumors containing cheaters only are completely susceptible to invasion by all producer cell types while tumors containing producers can be resistant to invasion, dependent on competition strength and niche construction specificity. Our findings may help explain the early metastasis phenomenon and the observation that metastasis involves early mutations. We emphasize that successful metastasis requires a "double-hit" of the necessary genetic mutations and appropriate ecological conditions. Much research has focused on the genetic aspects of cancer initiation and progression, but this is insufficient if the context in which the genes exist and mutations arise is not considered [1,3]. Paget's "seed and soil" hypothesis is often invoked while studying metastasis [16]; our model shows that the analogy is more than evocative. Just as we need to consider the soil, sunlight, wind, and nearby flora and fauna to understand the germination of a seed, we also need to take the ecologist's view to understand metastasis. Only then can we hope to stop the seed from spreading in the first place.

SI-A Extended model
The model we present in the main text can be extended to include dynamics in the bloodstream and secondary tumor site. We now consider three distinct ecosystems, denoted by subscripts 1, 2, and 3, respectively: the primary tumor site, the bloodstream, and a secondary site that receives metastatic cells to form a secondary tumor. Their cell populations are respectively N 1 , N 2 , and N 3 and can include both producers and cheaters. Cells are given a subscript (i, j), where i ∈ {0, 1} describes the ability to participate in niche construction (0 for cheaters and 1 for producers) and j ∈ {1, 2, 3} denotes which ecosystem the cell is in (1 for primary tumor, 2 for bloodstream, and 3 for secondary tumor). The number of each cell type is n i,j and the growth rate is r i,j .
Figure SI-A.1: Schematic representation of the extended mathematical model. The model considers a primary tumor with four cell types, bloodstream with two cell types, and secondary tumor with two cell types. Cheaters are white and producers are blue. In the primary tumor, cells could additionally be secondary producers (red) or global producers (red and blue). Niche construction occurs in the tumor sites through production of resources R 1 and R 3 , which benefit the tumors by increasing carrying capacity, represented as dotted lines. Construction of the pre-metastatic niche by primary tumor cells is represented by accumulation of resource R 2 , which facilitates settlement in the secondary tumor site. R 1 represents niche construction in the primary site. The extent to which the premetastatic niche has been constructed is measured by the amount of resource R 2 . For the primary tumor, i = hk, where h = 1 indicates local production and k = 1 indicates distant production. Local and global producers increase R 1 with rate g 1 while secondary and global producers increase R 2 with rate g 2 . R 1 and R 2 suffer independent resource depletion rates of l 1 and l 2 , respectively. Primary tumor cells enter the bloodstream as a result of intravasation and die with rate d due to immune surveillance, anoikis, or physical stress. The intravasation function has the same form as discussed in the main text, m(N 1 , R 1 ) = αN 1 k+βR 1 (t) . Though there is no niche construction while migrating through the bloodstream, cells retain their propensity for local niche construction: local producers and global producers remain producers, while cheaters and secondary producers remain cheaters. We assume that once in the bloodstream, cells cease to engage in premetastatic niche construction, so we do not keep track of the distant producers and cheaters separately, reducing the number of cell types from four in the primary tumor to two in the bloodstream and secondary tumor: (00, 1) and (01, 1) cells become (0, 2) cells in the bloodstream while (10, 1) and (11, 1) cells become (1, 2) cells.
Cells can undergo extravasation and successfully settle the pre-metastatic niche as a function of R 2 . We assume that construction of the pre-metastatic niche is necessary for circulating tumor cells to settle down. In particular, we postulate a linear relationship between settlement rate and R 2 with slope δ. Upon settling, (0, 2) cells become (0, 3) cells while (1, 2) cells become (1, 3) cells. There is local niche construction by (1, 3) cells in this metastatic tumor which increases resource R 3 with rate g 3 . R 3 is a measure of local niche construction in the secondary tumor, which does not affect settlement but rather benefits cells that have already successfully metastasized. R 3 also has independent resource depletion with rate l 3 .

Metastasis resource
Table SI-A.1: Governing equations of the extended model and the corresponding variables whose rates of change they describe, using competition structure I. Time dependence of n and R has been suppressed for notational simplicity. Dependence of m on N 1 and R 1 has also been suppressed.

SI-B Competition structures
Primary cheaters dn 00 dt = r 00 n 00 ( 1 − n 00 + ϕn 01 + θn 10  Figure SI-C.1 shows that prior to the separation of time-scales, the model (using competition structure I) contains a clinically realistic tumor size over time but fails to reach an equilibrium even after a decade. Different reasonable parameter combinations yield the same result. Cell populations in the model equilibrate more quickly than resource dynamics. The cell density always closely tracks the carrying capacity and the resource dynamics are slow. This allows us to make a separation of time-scales argument, which is biologically expected since niche construction processes (such as microenvironment vascularization) are generally slower than cell division.

SI-D Estimation of parameters
In order to keep the model as realistic as possible, we attempted to choose parameters such that the simulated tumor reflects some behaviors observed clinically. According to one study, breast tumors grow on average 7.8 ± 3.9 years before detection, where the detection size is approximately 10 9 cells [1]. The value of k, the intrinsic carrying capacity, should reflect the fact that typical tumor population sizes can range from 10 6 to 10 11 cells [2,3]. One estimate is that the size limit of cancer cell populations prior to the initiation of angiogenesis is 10 5 [4], so this is a reasonable estimate for the intrinsic carrying capacity k. On the other hand, the size limit after angiogenesis is on the order of 10 12 [4], which is generally viewed as the lethal tumor size at which patient death occurs [5]. Other methods estimate the maximum tumor size to be 12 cm [6] which corresponds to approximately 7.23 × 10 11 cells [2], corroborating the 10 12 estimate.
The intrinsic growth rates of clones can be estimated using data from the Norwegian Breast Cancer Screening Program [6]. The study used a logistic growth model and data from a large population to estimate doubling times of breast cancer tumors. In women aged 50-69 years, a 15 mm tumor doubled in diameter on average in 100 days while a 10 mm tumor doubled in diameter on average in 1.7 years. Using the conversion that one cubic centimeter tumor corresponds to 10 8 cells [2], and assuming tumors are perfect spheres, these two doubling times can be converted to 0.0707 and 0.0113 day −1 , taking into account size-dependent growth. Thus, a reasonable estimate for the highest growth rate r 00 may be 0.07 day −1 . This agrees with growth rates obtained from other studies using clinical data [5] and is similar to assumed parameters used in another mathematical model [7].
The rate of intravasation into the bloodstream has been estimated to be on the order of 10 −9 to 10 −11 day −1 , but this seems to include the death rate of circulating cells [8]. It is often estimated that less than 1% of circulating tumor cells survive [9,10]. Another estimate of the integrated rate of leaving the primary site and successfully joining a secondary tumor in pancreatic cancer is 6 × 10 −7 per cell cycle [11]. We thus assume the parameter α describing intravasation is on the order of α = 10 −6 day −1 or less, which is several orders of magnitudes smaller than all other parameters.