We consider resistance emergence independently at each stage of the parasitic life cycle. The probability of emergence is the combined probabilities of two events: the probability of any mutant occurring, and the probability of that mutant surviving in the population of parasites in a single host. Fixation of resistant phenotypes can occur at the bottlenecks separating the stages of the parasites’ life cycle. The genetic bottleneck for sporozoites entering a human host from a mosquito and for gametocytes in the blood stage being sampled by a mosquito is very small (the order of one to ten parasites), whereas the bottleneck experienced by hepatic merozoites emerging from the liver is less severe and highly dependent on the amount of residual drug present in the bloodstream. Note that drugs are only present in the bloodstream and thus do not affect resistance emergence and evolution during the mosquito stage or liver stage.

#### Sporozoites

It is estimated that approximately 6–10 sporozoites (and on rare occasions, >100) are injected into a human host during one mosquito bite. In this study, it is assumed that an infection derives from a single sporozoite, the other sporozoites being lost due to stochastic effects or the actions of host immunity. Resistance can emerge when a sporozoite spontaneously mutates inside a mosquito, resulting in a resistant phenotype, and is later the lone survivor of the mosquito-liver bottleneck and the sole founder of the population of parasites in the liver.

Let *μ* represent the per-parasite probability that a mutation will occur during parasite replication. The same hypothetical resistance mutation is assumed in each parasite stage (i.e. the value of *μ* is constant across different stages) and is proportional to the DNA polymerase error rate during mitotic division. Let *s* be the number of generations from the gametocyte stage taken during blood meal to the sporozoites number in the mosquito’s salivary gland (*s*∼ 10).

Because we assume that a single sporozoite founds the population of parasites in the liver, the probability that this parasite mutated during *s* generations of replication in the mosquito is:

- (1)

This is also the probability that such a mutation occurs and goes to fixation, because a single parasite founds the infection. Therefore,

- (2)

#### Hepatic merozoites

When hepatic (liver-stage) merozoites leave the liver the newly invaded blood cells may be exposed to residual drug levels from a patient’s previous treatment, and thus might be sufficient to kill either the entire parasite population (including emerging resistant mutants) or just the sensitive parasites (a patient would not be given drugs at this stage of the infection as he or she would not yet be ill). If a newly acquired infection emerges from the liver during a particular drug’s *selective window* (Watkins and Mosobo 1993; Stepniewska and White 2008), resistant parasites will survive while sensitive parasites will continue to be eliminated.

Let *h* be the number of mitotic divisions required by a single hepatic schizont (initial stage of liver infection) to produce 10^{5} parasites in the liver and to be released into the blood. Note that *h* in this section is not the number of generations of parasite replication (as was the parameter *s* in the previous section). The parameter *h* is on the order of 10^{5}–10^{6}, and

- (3)

where *μ* is again 10^{−10}; *μ*_{h} is between 10^{−5} and 10^{−4} and represents the probability that a resistance mutation occurs at some point during parasite replication in the liver, in the absence of drugs.

The survival of the emerging resistant merozoites is affected by any residual slowly eliminated drugs that are present in the blood as the parasites leave the liver for the bloodstream. Focusing on ACT treatment, we discuss the emergence of artemisinin resistance in the presence of residual artemisinin. In general, the residual drug factor can be incorporated into population-genetic equations by assuming two periods with different concentrations or levels of drug. Initially, there is a *high* level of drug, a concentration high enough to kill both resistant and sensitive parasites. Subsequently, there is a *low* level, i.e. a level that falls into the selective window killing sensitive parasites but allowing the survival of resistant parasites. When there is a *low* level of residual drugs, selection takes place.

We consider the situation where there exists some residual partner drug. Let γ be the probability that the emerged merozoites already have partner drug resistance. Let α be the probability that the hepatic merozoites encounter artemisinin drug levels in the artemisinin selective window (a *low* level of artemisinin). From a human population perspective, α is equivalent to the proportion of people with residual artemisinin within the selective window. For artemisinins, α is usually zero or if it exists is extremely small because the elimination half-life of the artemisinin is only 1 h in comparison with the ≥48 h asexual cycle of the malaria parasites (Stepniewska and White 2008).

Let *F*_{AB} be the probability of fixation of the double-resistant in the presence of both artemisinin and the partner drug. In our scenario of complete resistance, *F*_{AB} is probably close to 1. The probability of artemisinin-resistance emerging and fixing from the hepatic merozoite stage is

- (4)

where the 10^{−5} term in the right-hand side represents the probability of random fixation in a population of size 10^{5}. Note that (1−α) represents the probability that there is abundant artemisinin or no artemisinin; in the first scenario, artemisinin kills all parasites so fixation probability is zero while in the second scenario artesunate has equal killing rates for partner drug resistant and sensitive parasites so fixation probability is 10^{−5}. In equation (4), we therefore assume that the extremely short half-life of artemisinin ensures that the frequency of scenario 1 is negligible compared to scenario 2. We assume that if there is no resistance to the partner drug, an artemisinin-resistant parasite would have a negligible chance of surviving; this assumption can of course be relaxed. The probability in equation (4), assuming a 1/100 chance of being in the artemisinin selective window and a high chance of pre-existing partner-drug resistance, is on the order of 10^{−7}. If α < 10^{−6}, then the probability in equation (4) is dominated by random fixation and is of the order 10^{−10}.

In the absence of any residual drugs, there is no bottleneck and therefore the probability of resistance emerging is just the probability that a resistance mutation occurs at some point and then goes to fixation (for this example, the probability of this event would be 10^{−10}).

#### Blood-stage parasites

Here, we consider emergence of resistant parasites during blood-stage infection, assuming that these parasites did not encounter residual drug when entering the bloodstream from the liver. The parasites may encounter drugs at this stage if their population size crosses the pyrogenic threshold (10^{8}) causing the patient to be ill and to be treated with an ACT. We do not consider the case of presumptive treatment for a nonmalarial fever or intermittent presumptive treatment given to infants or pregnant women. In order to be transmitted to a mosquito feeding on a host, malaria parasites need to develop into gametocytes; gamotocytaemia in *P. falciparum* infections is delayed with respect to blood-stage parasitaemia. In this stage of the infection, we calculate the probability (*P*_{b}) that resistance emerges and the probability that resistant gametocytes are produced and sampled by a mosquito during a blood meal. Mosquito sampling can be viewed as the fixation event in the blood stage of the infection, and the bottleneck here is again quite small. *P*_{b} is calculated after 10 cycles of blood-stage replication (∼20 days)

The emergence of resistance in blood-stage parasites occurs when the genetic changes (mutation or gene duplication) which confer antimalarial drug resistance occur spontaneously and independently of antimalarial drugs. Hereafter, we use the term mutation to include any genetic change conferring resistance. For resistance to spread the resistant, mutant parasites must survive both antimalarial drug effects and host-defence mechanisms. A simple model of *de novo* resistance in the blood-stage infection was developed (see Supporting Information) which describes the stages of reproduction in the blood after hepatic merozoites are released from the liver and multiply to a density which can start gametocyte production (see Fig. 1). For the first cycle, the probability of mutation occurring among the hepatic merozoites invading the red blood cell (∼10^{5}) is calculated. For all other cycles, the probability of mutation occurring among the blood-stage parasites in each cycle is calculated. Once mutation occurs, both the sensitive and resistant parasites would multiply over the succeeding cycles, depending on the multiplication factor (*m*). The parasite multiplication rate every 48 h in the asexual life cycle is determined mainly by the efficiency of merogony or merozoite invasion (White et al. 1992); in our model, it is also affected by antimalarial drugs and host immunity. We assume that the effect of treatment on killing parasites, the effect of host immunity on suppressing parasites and the multiplication of the parasites are acting simultaneously in a single cycle. The bottleneck at the blood stage is identified as the chance of transmitting resistance through to the sexual stages.

We define *μ*_{t} as the probability that a mutant emerges from blood stage at cycle *t* when the population size is *p*_{t}. In each cycle, the probability of exactly one mutant occurring in cycle *t* is

- (5)

which is about *p*_{t} × *μ* if we assume that *μ*^{2} is small. For the blood stage, we again assume that at most one resistant mutant can emerge.

The probability of resistance first emerging at cycle *t* is

- (6)

We consider the possibility of switching to gametocytes for cycles *t *=* *1 to *t *=* *10. It is assumed that the resistant and sensitive parasites have equal chances of switching to gametocytes, independently of antimalarial treatment but dependent upon the parasite density. Although previous studies have shown that parasites can facultatively alter investment in gametocyte production in response to drugs (Buckling et al. 1997) and many other risk factors for gametocyte carriage (Price et al. 1999), we do not include such complications and only model a binary switching rate.

Letting *r*_{10,k} and *p*_{10,k} be the numbers of resistant and total parasites, respectively, at cycle 10 given that a mutant parasite emerged first at cycle *k*, we can calculate these numbers for any cycle *k* and condition on the cycle that resistance first appears. For example, if an artemisinin-resistant mutant parasite emerges first at cycle 10, the probability that one of these mutants develops into a gametocyte and is transmitted is

- (7)

The numbers of resistant (*r*_{t}) and sensitive (*s*_{t}) parasites are calculated in a standard discrete-generation population-genetic framework where *r*_{t} depends on *r*_{t−1}, *s*_{t} depends on *s*_{t−1}, and *p*_{t} = *r*_{t} + *s*_{t}, as described in the Supporting Information. The probability of any mutation occurring during the blood stage and surviving to transmit is just the sum of the probabilities of resistance emerging in any cycle, multiplied by the chance of those resistant progeny switching to gametocytes and infecting a mosquito; we write this as

- (8)

The details of the dynamic model are given in Appendix B. As an example, when *μ* = 10^{−10} and the parasite multiplication rate *m *=* *10, the chance of resistance emerging in a nonimmune person from a low-transmission setting without treatment effect (*P*_{b}) is 5.39 × 10^{−10}.

Alternatively, we derive a simple calculation of the probability of resistance emerging at the blood stage by looking at the time of treatment. Let *b* be the number of cycles required for the parasites to multiply in number from the first cycle to the parasite level (*v*) where treatment is given (*b*∼ 6). The probability that any single parasite (after *b* cycles of reproduction) contains a resistance mutation is

- (9)

so that an infection with *v* parasites has a probability *v* × *μ*_{b} (providing *v* × *μ*_{b} << 1) of containing a spontaneous resistance mutation. Let *τ* be the chance of an infection being treated and *ρ*_{R} be the chance of a resistant parasite surviving treatment, the host-immune response and reaching the density that gametocytes are sufficiently produced for transmission. Then, the probability that a given infection of biomass *v* contains a resistant mutation that survives in the blood stage is

- (10)

Further details are given in Appendix C. In the Results section, we focus on blood-stage emergence using the dynamic model only.