Introduction

A central principle from the theory of host-pathogen interactions states that host and pathogen evolution should have strong effects on host and pathogen ecology1,2. The many host-pathogen systems that show high levels of pathogen polymorphism3,4,5,6,7,8,9,10,11,12 suggest that evolutionary dynamics are indeed likely to affect host-pathogen ecology, and have motivated efforts to incorporate evolutionary theory into wildlife disease management13. The theory also states that ecological dynamics should, in turn, have strong effects on host and pathogen evolutionary dynamics, but empirical evidence for such effects is extremely rare. As a result, our understanding of the interacting effects of host-pathogen ecology and host-pathogen evolution is based largely on theory rather than on data.

Another basic principle of host-pathogen theory is that pathogens can easily regulate populations of their hosts, either by maintaining the host’s population at a stable point equilibrium14, or by causing the host’s population to undergo cycles15 or chaotic fluctuations16. Field studies of spillover events and emerging diseases have indeed shown that pathogens often suppress their host’s population17,18,19, while longer-term field studies have shown that some parasites and pathogens do indeed cause fluctuations in their host’s population20,21,22. Addressing the knowledge gap between evolutionary and ecological studies of hosts and pathogens thus requires a consideration of the complex fluctuations in density that may result from interactions between hosts and their pathogens.

A lack of consideration of ecological dynamics is particularly a problem in studies of pathogen coexistence. Although some pathogen coexistence theory considers ecological mechanisms23, by far the most widely cited theory invokes genotype-by-genotype (G × G) interactions24,25. In G × G interactions, pathogens are specialized to attack particular host strains, while hosts are specialized to defend against particular pathogen strains. A key extension of this work allows for environmental variation across landscapes26,27, thus yielding G × G × E theory. G × G × E theory has shown that pathogen coexistence can result from spatially heterogeneous selection pressure28,29, a type of spatial structure known as a “selection mosaic” 30.

Although selection mosaics have been documented in many different organisms (Supplementary Note 1), to the best of our knowledge, the empirical evidence for effects of selection mosaics and G × G × E interactions on host-pathogen systems has come entirely from studies of plant pathogens12 and not animal pathogens. The immobility of plants suggests that spatial structure is indeed likely to affect plant-pathogen interactions, whereas the high mobility of many animals suggests that dispersal may eliminate the effects of spatial structure on animal-pathogen interactions, so that G × G × E theory may be irrelevant for animal-pathogen interactions. Moreover, G × G × E theory almost invariably assumes that host and pathogen densities are constant31,32. The intense spatial competition that plants experience supports this assumption (but see Papaïx et al.33), but as we have described, animal hosts of many infectious pathogens undergo fluctuations in density.

Whether selection mosaics and G × G × E interactions play a role in animal-pathogen interactions is therefore unclear. To understand how ecological dynamics affect pathogen polymorphisms, and to test the relevance of selection mosaics for hosts with pathogen-driven population cycles, we studied a widespread polymorphism in a fatal, specialist baculovirus of a forest pest insect, the Douglas-fir tussock moth (Orgyia pseudotsugata). Populations of the Douglas-fir tussock moth periodically increase from densities at which the insect is practically undetectable to densities at which forest damage is widespread and severe. Because peak insect populations are regularly decimated by baculovirus epizootics (Mihaljevic et al.34, epizootics are epidemics in animals), and because host-pathogen models16,35 can reproduce the 7–10 year period and 3–5 order of magnitude amplitude of the insect’s population cycle36, the baculovirus appears to be causing predator-prey type cycles in the insect.

The Douglas-fir tussock moth’s population cycles may also be affected by genetic variation in the baculovirus. The Douglas-fir tussock moth baculovirus consists of two morphotypes, a multi-capsid morphotype in which the virions or “nucleocapsids” are arranged in bundles within infectious particles or “occlusion bodies”, and a single-capsid morphotype, in which the nucleocapsids are arranged singly within occlusion bodies37. The two morphotypes are more closely related to other Lepidopteran baculoviruses than to each other38, and have long co-occurred across much of the range of the Douglas-fir tussock moth in North America, including the province of British Columbia, Canada, and the states of Washington, Oregon, Idaho, Montana, Colorado, California, Nevada, Arizona, and New Mexico in the USA37,39,40. This long-term record of co-occurrence suggests that the two morphotypes coexist, but the mechanisms that allow for this coexistence are unknown.

Because many host-pathogen models predict that pathogen coexistence is unlikely23, it is not immediately obvious why the morphotypes are able to coexist, but G × G × E theory may provide the answer. Like most insect baculoviruses41, the Douglas-fir tussock moth baculovirus is transmitted when host larvae consume foliage contaminated with occlusion bodies released from infectious cadavers of other larvae. This is important because larvae feed on both Douglas-fir and Abies firs, and because an insect’s risk of baculovirus infection can be affected by variation in foliage quality, structure, nutrient content, and secondary metabolites41,42, or by effects of foliage variation on an insect’s mobility, health, and feeding rate, any one of which can affect infection risk43. The complex differences in foliage chemistry between Douglas-fir and Abies firs44, therefore, suggest that a tussock moth’s infection risk, and thus the fitness of the two morphotypes, might differ between Douglas-fir and Abies firs.

Here, we ask, can population cycles and selection mosaics explain the pattern of coexistence of the two morphotypes of the Douglas-fir tussock moth baculovirus? Our approach to answering this question combines methods from studies of plant pathogens with methods from studies of animal pathogens. We follow studies of plant pathogens12 in using a field experiment to quantify the fitness of the two morphotypes on two important Douglas-fir tussock moth host trees, Douglas-fir, Pseudotsuga menziesii, and grand fir, Abies grandis. Our field experiment allows us to directly test whether a selection mosaic driven by variation in host diet has the potential to affect morphotype coexistence. We follow studies of animal pathogens45 in using observational field data to choose between host-pathogen models with and without population cycles and with and without selection mosaics. Our model allows us to test whether morphotype coexistence can be explained by a combination of population cycles and a selection mosaic (Fig. 1).

Fig. 1: Conceptual description of methods.
Fig. 1: Conceptual description of methods.The alternative text for this image may have been generated using AI.
Full size image

Field experiments deployed susceptible larvae in mesh bags on branches of Douglas-fir and grand fir, which were contaminated with varying densities of one of five isolates of each morphotype, along with no-virus controls. The Transmission model quantified the fraction infected in each treatment, \(\frac{I(T)}{S(0)}\). Bayesian hierarchical models that differed in whether transmission parameters \(\overline{\nu }\) and C depended on morphotype, tree species, or both were compared using Leave-One-Out Cross-Validation. Transmission parameters were estimated using initial pathogen density (P0), exposure time (T), and the ratio of occlusion bodies produced by first instars (larval stage) to fourth instars (α). The Douglas-fir tussock moth has one generation per year. The Life cycle begins as flightless adult females lay egg masses on their cocoons; because the virus overwinters on the eggs, some larvae become infected during hatch. Host reproduction and viral overwintering are represented with difference equations. Uninfected and infected first instar larvae disperse between trees by ballooning on silk strands, modeled using a discretized dispersal kernel. After larval movement, each grid point has an independent epizootic, described by a modified “SEIR” framework (Supplementary Note 4). Spatial structure was represented as a hexagonal grid with varying forest composition, where each cell is composed of either Douglas-fir or another tree species. Eco-evolutionary models were fit to observed morphotype and Douglas-fir frequencies using a line search Fitting routine. Maximum likelihood scores \(\widehat{L}\) were averaged across realizations. The top 30 parameter sets for each model from the line search were rerun with increased replicates and varying stochasticity before selecting the best model with Akaike information criterion (AIC). Bold terms indicate sections in the figure. Illustrations were created by the first author using Adobe Photoshop v27.1. Source data are provided as a Source Data file.

Our model also allows us to consider how Douglas-fir tussock moth populations are affected by the use of the baculovirus in pest control. Because the Douglas-fir tussock moth damages valuable timber, and because its baculovirus infects only a few insect species, between 1975 and 1992 the U.S. Forest Service produced large quantities of the baculovirus for use as a microbial biopesticide to control Douglas-fir tussock moth populations46. This biopesticide, known as “Tussock Moth BioControl-1” (TMB-1), consists only of the multi-capsid morphotype, which preliminary research suggested is slightly more virulent than the single-capsid morphotype47. Given that the two morphotypes coexist in nature, an unanswered question is, how are tussock moth population dynamics affected by the use of a biopesticide that consists only of a single baculovirus morphotype?

Our models track competition between morphotypes across forests with varying relative abundance of Douglas-fir versus other tree species. The models include genetic variation in both the host and the pathogen, and allow the level of host variation to differ between pathogen strains, thereby incorporating a G × G interaction. Because the models allow the G × G interaction to depend on forest composition, and because forest composition varies spatially, the models incorporate G × G × E interactions.

Host and pathogen variation across morphotypes and across forests of different tree species composition is incorporated in terms of differences in average pathogen infectiousness, represented by the average per-capita transmission rate \(\overline{\nu }\), and in terms of differences in variation in pathogen infectiousness, represented by the coefficient of variation of the transmission rate C. The average transmission rate \(\overline{\nu }\) can equivalently represent either pathogen infectiousness or host infection risk, averaged across hosts, while variation in infectiousness C can equivalently represent either variation in pathogen infectiousness or variation in host infection risk. Higher \(\overline{\nu }\) always leads to higher host infection risk and thus higher pathogen fitness, but higher C leads to lower pathogen fitness. This is because increasing C while holding \(\overline{\nu }\) constant is equivalent to adding more-susceptible hosts and more-resistant hosts in such a way that the mean is unaffected even though the C.V. increases; more-resistant hosts have a disproportionate impact on infection risk35, however, and so pathogen strains with higher values of C have lower fitness48.

Although here we do not decompose our estimates of host variation into genetic and environmental components, insect resistance to baculoviruses has long been known to be heritable49, and in the baculovirus of the closely related spongy moth, Lymantria dispar, variation in infectiousness C has been shown to be heritable50. We therefore allow for heritable variation in our models.

Importantly, variation in infectiousness plays a key role not just in the selection mosaic in our models, but also in the host-pathogen population cycles generated by the models. When variation in host infection risk C > 1, as it is known to be in this34 and other insect-baculovirus systems41, and when this variation is entirely due to environmental causes and is thus not heritable, then host and pathogen densities reach a stable point equilibrium35. Even in the presence of high environmental stochasticity, models producing a stable point equilibrium produce only short-period, small-amplitude cycles, which fail to capture the long-period, large-amplitude cycles seen in the Douglas-fir tussock moth and other forest defoliators16. In contrast, eco-evolutionary models that assume that host variation is at least partly heritable produce realistic population cycles even for realistically high values of variation in host infection risk C 41.

This effect is important partly because it means that the heritable host variation that is fundamental to host-pathogen selection mosaics is also fundamental to host-pathogen population cycles. In host-pathogen population cycles, when host variation in infection risk is high, a significant fraction of the host population will always be relatively resistant to infection. If host variation is not heritable, the ability of resistant hosts to avoid infection will prevent the pathogen from imposing the high levels of density-dependent mortality that drive population cycles41. If host variation is heritable, and if there is a fitness tradeoff between host infection risk and host fecundity, then high pathogen densities will drive the evolution of both higher host resistance and lower host fecundity, strengthening the effects of density-dependence and allowing for population cycles even when host variation is high. As we will show, this effect interacts with selection mosaics in complex ways.

To synthesize selection-mosaic theory and host-pathogen theory, we construct a novel two-pathogen eco-evolutionary model that incorporates natural selection on host resistance and pathogen-driven population cycles. To evaluate the usefulness of the model, we first use field experiments to show that two key transmission parameters differ between the two morphotypes of the Douglas-fir tussock moth baculovirus and that the extent of these differences depends on the host tree species consumed during infection. We then test the model’s ability to explain variation in morphotype coexistence, as quantified by a combination of published data and our own extensive dataset of morphotype frequencies. This model explains the morphotype frequency data better than models without selection on host resistance or without population cycles, demonstrating that there is a selection mosaic determined by geographic variation in forest composition and that this mosaic is modulated by pathogen-driven population cycles. Our model further shows that the morphotype composition of viral biopesticides can influence host-pathogen evolution, such that mixtures containing equal proportions of the two morphotypes provide the most effective insect population control.

Results

Geographic variation in morphotype frequency

To assess the usefulness of G × G × E theory for explaining the long-term polymorphism of the two baculovirus morphotypes, we first quantified their relative frequencies across the range of the Douglas-fir tussock moth. Published data on morphotype frequencies included mostly small sample sizes, and so we collected a large number of new samples. Sampling from the entire range was beyond what we could accomplish, and insects can only be found during outbreaks, so most of our samples were collected during a period of widespread outbreaks in Washington, Oregon, Idaho, and Montana USA (Supplementary Table 3). The combined dataset reveals that the two morphotypes co-occur at high frequencies across much of the insect’s range (Fig. 2). In 61% of populations in which only one morphotype was recorded, most had small sample sizes, such that only 14% (11 total) had a sample size greater than 5 larvae, with an average of 4.27 larvae. In contrast, among the 39% of populations in which both morphotypes were recorded, 46% had a sample size greater than 5 larvae, with an average of 36 larvae. This pattern in the data is consistent with the widespread co-occurrence of the two morphotypes at high frequency. A comparison of morphotype frequencies across years shows that the polymorphism has persisted in roughly its current form for at least 50 years (Supplementary Table 4). The data thus imply that the two morphotypes have coexisted for many decades.

Fig. 2: The distribution of baculovirus morphotypes over the range of the Douglas-fir tussock moth across Western North America.
Fig. 2: The distribution of baculovirus morphotypes over the range of the Douglas-fir tussock moth across Western North America.The alternative text for this image may have been generated using AI.
Full size image

Each pie chart represents the frequency of the two morphotypes aggregated over space from 128 sampled locations using the hclust hierarchical clustering function in the stats v4.3.2 R package. Orange pie slices represent the fraction of insects infected with the single-capsid morphotype, while blue pie slices represent the fraction of insects infected with the multi-capsid morphotype. The size of each pie chart indicates the number of larvae used to calculate the frequencies in that pie chart, with the sample size given to the right of each pie chart. The shading shows the distributions of the preferred host tree species, Douglas-fir (beige), and Abies firs (dark green). The Abies spp. distribution represents multiple Abies species, including grand fir (A. grandis), white fir (A. concolor), subalpine fir (A. lasiocarpa), Pacific silver fir (A. amabilis), and red fir (A. magnifica). Distributions of individual tree species are given in Supplementary Fig. 4. State and Province administrative boundaries for the United States and Canada were downloaded using the gadm function in the geodata v0.5.9 R package. Source data are provided as a Source Data file.

To test for effects of forest tree species composition on morphotype frequencies, we fit generalized linear models (GLMs) to the data, and we used Akaike information criterion (AIC) to compare the fit of models with and without effects of Douglas-fir frequency. This analysis showed that the model with an effect of Douglas-fir frequency provided a much better explanation for the data, such that ΔAIC = 134.9 (Supplementary Note 2). We thus conclude that variation in the frequency of the multi-capsid morphotype across sites is strongly related to variation in the relative percent Douglas-fir across sites. This statistical result does not identify the biological mechanism that allows for coexistence or for dynamical changes in the relative frequency of the morphotypes. It nevertheless suggests an experimentally testable hypothesis, namely that the fitness of the two morphotypes varies across the range of the Douglas-fir tussock moth because of variation in the frequency of Douglas-fir relative to other tree species.

Variation in morphotype fitness

To estimate fitness differences between the two morphotypes on different host trees, we carried out a field experiment in which we allowed uninfected Douglas-fir tussock moth larvae to feed on branches of either Douglas-fir or grand fir that were contaminated with infectious cadavers. The cadavers were infected with one of five multi-capsid (MNPV) baculovirus isolates or one of five single-capsid (SNPV) baculovirus isolates (Fig. 1). We defined an isolate to be a sample of virus from one infected insect collected in the field. This experiment allowed us to quantify the two key components of pathogen fitness described above, average infectiousness \(\overline{\nu }\) and variation in infectiousness C48.

To analyze our transmission data, we embedded our mechanistic transmission model (Fig. 1) in a Bayesian hierarchical model that we fit to the experimental data. This approach showed that our estimates of pathogen fitness components varied by viral morphotype and host tree species. When insects were exposed to the virus while feeding on Douglas-fir branches, the multi-capsid morphotype had slightly lower average infectiousness \(\overline{\nu }\) than the single-capsid morphotype, but much lower variation in infectiousness C (Fig. 3A). When insects were feeding on grand fir, the multi-capsid morphotype instead had substantially higher \(\overline{\nu }\) and slightly lower C than the single-capsid morphotype. To explain the implications of these experimental parameter estimates for morphotype fitness, ultimately, we will use long-term models of morphotype fitness in forests of varying composition. As a simple preliminary indicator of fitness, first, we use the cumulative fraction of hosts infected by each morphotype in a single epizootic in forests composed of a single tree species.

Fig. 3: Experimental estimates of key fitness components for the best model, and the consequences of these estimates for pathogen infection rates for both morphotypes across Douglas-fir and grand fir.
Fig. 3: Experimental estimates of key fitness components for the best model, and the consequences of these estimates for pathogen infection rates for both morphotypes across Douglas-fir and grand fir.The alternative text for this image may have been generated using AI.
Full size image

Estimates for the multi-capsid morphotype are in blue and the single-capsid morphotype are in orange. A Estimates of the average infectiousness \(\overline{\nu }\) and the variation in infectiousness C for each morphotype on each tree species from the best Bayesian hierarchical model fit to the transmission field experiment data (N = 92). Data are shown as the mean of the posterior distribution (points) and error bars represent the 25th and 75th percentiles of the posterior distribution as calculated using the summary R function on the stanfit object. B Differences in morphotype infection rates as a function of initial host density (insects/m2) when only one morphotype is present in a single-season epizootic in a forest consisting of a single tree species; solid lines show the resulting fraction infected from simulations using the mean values for \(\overline{\nu }\) and C from A, while the shaded ribbon represents the 25th to 75th percentiles of the resulting fraction infected from simulations using the thinned posterior distribution of parameter sets (N = 225). Source data are provided as a Source Data file.

When pathogen transmission is strongly density-dependent, as it is in the case of baculoviruses22,34, pathogen fitness increases sharply with initial host density, and with increases in a pathogen’s average infectiousness35. The theory of pathogen variation has further shown that pathogen fitness is sharply reduced by increases in a pathogen’s variation in infectiousness48; these negative effects, however, are stronger at higher densities than at lower densities, whereas the positive effects of increases in the mean are similar across densities35. If two pathogen strains differ with respect to both their mean infectiousness and their variation in infectiousness, then one pathogen strain may have an advantage at low host densities, while the other has an advantage at high pathogen densities.

These effects are important because our two morphotypes differ in both their mean infectiousness and in their variation in infectiousness, and the direction of these differences in turn differs between host trees. To understand the importance of such effects for our system, we incorporated our experimental parameter estimates into an SEIR model, and we used the model to project changes in morphotype fitness with density. Here we (temporarily) define fitness as the cumulative fraction infected at the end of an epizootic, and we (also temporarily) assume single-pathogen epizootics in single-host-tree forests. Because the multi-capsid morphotype has slightly lower average infectiousness but much lower variation in infectiousness on Douglas-fir, in Douglas-fir-only forests our model projects that the fitness of the multi-capsid morphotype will be slightly lower than the fitness of the single-capsid morphotype at low densities, but slightly higher at high densities (Fig. 3B). Because the multi-capsid morphotype has moderately higher average infectiousness but slightly lower variation in infectiousness on grand fir, in grand fir-only forests the model projects that the fitness of the multi-capsid morphotype will be higher than the fitness of the single-capsid morphotype at all densities, but the difference will be substantially less than in Douglas-fir-only forests.

Our experiments thus provided initial evidence that the fitnesses of the two morphotypes of the Douglas-fir tussock moth baculovirus differ between the two host tree species, suggesting that a selection mosaic may indeed explain variation in morphotype frequency across forests of different tree species composition. The interacting effects of host tree species and insect density on morphotype fitness meant that we could not easily intuit how morphotype frequency would vary with the frequency of Douglas-fir. Our next step was to construct long-term models of pathogen competition to understand the implications of our experiment for variation in morphotype frequency across forest types. Because of the complex effects of host density in Fig. 3B, it was at least possible that allowing for host-pathogen population cycles would alter morphotype fitness, and so our models allowed for the possibility of population cycles.

To test whether variation in morphotype frequency across forests could be explained by variation in morphotype fitness across tree species, we implemented our two-pathogen, eco-evolutionary models on a spatial grid representing a forest. On the grid, the tree species at each point was either Douglas-fir or grand fir (Fig. 1). We used grand fir as a proxy for species other than Douglas-fir because grand fir was the most prevalent Abies host in our tree species dataset, and was thus the most prevalent tussock moth host tree species besides Douglas-fir. We assumed that the model forest encompassed a scale of 8076.6 m2. Because hatching larvae can disperse on the wind for distances of 400 m or more51, this scale allowed larvae to easily disperse to any location in the forest. This assumption ensured that pathogen fitness would not be unduly influenced by the clumping of cadavers within a forest; given that our ultimate interest is in whether G × G × E theory is useful for understanding polymorphism in animal pathogens, this was a conservative assumption. As we explain in Supplementary Note 8, the scale of our model forest is appropriate to the scale at which tree species vary across the range of the Douglas-fir tussock moth.

We then tested whether our morphotype frequency data are best explained by models that include selection mosaics or by models that do not include selection mosaics. To test whether host population cycles are necessary to explain the data, we also included a non-evolutionary model without heritable variation. We chose the best model using AIC.

Host-pathogen population cycles and a selection mosaic together explain variation in morphotype frequency

To test whether models with selection mosaics explained the morphotype frequency data better than models without selection mosaics, we compared models in which morphotype variation in infectiousness C differed between the two host tree species to models in which variation in infectiousness did not differ between host tree species. Because variation in host plant foliage quality can have complex effects on insect fecundity52, we also allowed for a mosaic in the host’s resistance-fecundity tradeoff by assuming that the tradeoff parameter s varied between tree species and morphotype. Because the tradeoff parameter modulates average morphotype infectiousness \(\overline{\nu }\), allowing the value of s for each morphotype to vary between tree species leads to a selection mosaic in average morphotype infectiousness.

Model selection confirmed that the best-fitting model includes selection mosaics driven by variation in tree species with respect to both variation in morphotype infectiousness and with respect to the resistance-fecundity tradeoff parameter, and thus in average morphotype infectiousness (Table 1). Models that did not include both selection mosaics provided a much worse fit to the data. The model without either selection mosaic attempted to explain the morphotype frequency data by invoking high levels of stochasticity, leading to a much worse fit to the data (Fig. 4).

Fig. 4: Comparison of the fit of two host-pathogen models with and without selection mosaics to our observed morphotype frequency data.
Fig. 4: Comparison of the fit of two host-pathogen models with and without selection mosaics to our observed morphotype frequency data.The alternative text for this image may have been generated using AI.
Full size image

Left: model without a selection mosaic. Right: the best-fit model with selection mosaics for both variation in infectiousness C and the fecundity-resistance tradeoff parameter s. The black line represents the average mean frequency of the multi-capsid morphotype calculated for each percent Douglas-fir grid over the 2000 stochastic realizations from our model-fitting procedure, while the blue shaded ribbon with dashed black lines represents the 2.5th and 97.5th percentiles of the mean frequency for the 2000 realizations. Black points and error bars are the mean ± SEM of the morphotype frequency data from the 128 sampled locations from Fig. 2 binned into 10 groups by percent Douglas-fir. Relative point sizes indicate relative sample sizes. Source data are provided as a Source Data file.

Table 1 AIC analysis of the fit of different models to the morphotype frequency data (Fig. 4)

Notably, a model that included a selection mosaic in the resistance-fecundity tradeoff parameter s but not in variation in infectiousness C provided a much better explanation for the data, emphasizing the importance of a selection mosaic in average morphotype infectiousness. This effect occurs because the tradeoff parameter s can have a strong effect on the ability of the insect to develop high pathogen resistance, and thus low infection risk \(\overline{\nu }\). In comparison, variation in infection risk C has the more complex effect of modulating how infection risk rises with insect density. Model comparison, however, shows that both selection mosaics are necessary to explain the data.

Because the morphotype frequency data do not include any information about host population density, it was not obvious in advance that models with heritable host variation, and thus population cycles, would do a better job of explaining the morphotype frequency data than a model without heritable host variation (Remember that the level of host variation differs between pathogen morphotypes, and therefore depends on both the host and the pathogen). Indeed, like the evolutionary models, the non-evolutionary model includes a selection mosaic in terms of variation in infectiousness C. Because our experimental estimate of variation C > 1 for each morphotype on each tree species, the non-evolutionary model, Model 7 in Table 1, projects that the host population will undergo short-period, small-amplitude fluctuations around the equilibrium of the corresponding deterministic model. These fluctuations do not resemble the long-period, large-amplitude cycles observed in Douglas-fir tussock moth populations36 (Supplementary Fig. 12). For the model that instead assumes that host variation is (partly) heritable, host and pathogen populations fluctuate with a realistically long period and large amplitude. The extremely poor fit of Model 7 thus suggests that explaining the data requires models that allow for realistic host-pathogen population cycles. In Supplementary Fig. 14, we confirm this point by showing that versions of our eco-evolutionary model that show only short-period, short-amplitude cycles also provide a poor fit to the data.

Understanding the interacting effects of selection mosaics and population cycles

To explain why we need both a selection mosaic and population cycles to reproduce our morphotype frequency data, in Fig. 5 we show how the model dynamics change with changes in forest tree species composition. As Fig. 5B shows, the two pathogens together drive predator-prey type cycles in the density of the host, with a period and an amplitude that match the 8–10 year period and 3–5 order of magnitude fluctuations typical of Douglas-fir tussock moth populations in nature36.

Fig. 5: Effects of variation in forest composition on the host-pathogen dynamics of the best-fitting eco-evolutionary model.
Fig. 5: Effects of variation in forest composition on the host-pathogen dynamics of the best-fitting eco-evolutionary model.The alternative text for this image may have been generated using AI.
Full size image

A Example hexagonal lattice in our model with Douglas-fir (light green) and grand fir cells (dark green), with percent Douglas-fir increasing from left to right. B Simulated population cycles for years 150 to 190 for the host population (green), the multi-capsid morphotype (MNPV, blue), and single-capsid morphotype (SNPV, orange). C Magnitude of the average infectiousness for each morphotype over time, showing cyclic behavior that is partly driven by fluctuating selection on the pathogen. Horizontal bars on the left side of each time series show our field-experimental estimates of average infectiousness from either Douglas-fir (solid) or grand fir (dashed) from Fig. 3A. D Relative frequency of each morphotype, showing how the population cycles affect morphotype competition. E Fraction infected over time. Brighter colors identify years for which the fraction infected is ≥0.3, which are included in the calculation of the fraction infected with each morphotype. F Box-and-whisker plots show the distribution of the relative frequency of each morphotype for years in which the fraction infected was ≥0.3 for years 50 to 1000; the central line denotes the median frequency, with the box edges representing the 25th and 75th percentiles (Interquartile range or IQR), and whiskers extend to the most extreme data points within 1.5 × IQR. The number of years included is shown above each box-and-whisker plot. The output of graphs B-F is based on the same simulation. Source data are provided as a Source Data file.

In the model, host infection risk \(\overline{\nu }\), which is equivalent to pathogen infectiousness, changes along with host and pathogen densities, due to the balancing (but fluctuating) selection that results from the tradeoff between host infection risk and host fecundity. (Note that host fecundity depends on host infection risk through the risk-fecundity tradeoff, and therefore changes with changes in host infection risk/pathogen infectiousness.) Reassuringly, the average infectiousness of each morphotype in the model fluctuates around values that are close to our experimental estimate of the infectiousness of each morphotype (Fig. 5C), even though we did not fit the model to the experimental data. This latter result suggests that the infectiousness of each morphotype in our model was close to the infectiousness of each morphotype in nature. As the figure further shows, these fluctuations are strongly affected by the frequency of Douglas-fir relative to other tree species.

Crucially, as the relative frequency of Douglas-fir increases, the higher average infectiousness of the multi-capsid morphotype on Douglas-fir causes its relative frequency to change from being high only some of the time to being high most of the time (Fig. 5C, D). Meanwhile, because the morphotype frequency data were collected in populations with at least moderately high infection rates, in comparing the model to the data, we only included model generations in which the overall fraction of infected hosts was above 0.3, which usually only occurs just after peaks in the host population. This is important because the strong density-dependence of the transmission process causes epizootics near population peaks to be dominated by one pathogen morphotype or the other (Fig. 5D, E, F). Increases in the relative frequency of Douglas-fir therefore lead to sharp increases in the frequency of the multi-capsid morphotype, which is why the model provides a good fit to our data (Fig. 4). Notably, the fit of the best model to the data is almost exactly the same if we follow Dwyer et al.16 in allowing for a generalist predator or parasitoid (Supplementary Note 9). Also, the scales at which forest patches differ in tree species composition are typically far more than 10 km; at such scales, dispersal between dissimilar forest patches has no effect on our results (Supplementary Fig. 18). Our focus on single forest patches is therefore appropriate to our data.

In Supplementary Fig. 15, we show that when the effect of density-dependent transmission is stronger, so that the amplitude of the population cycles is larger, then as the frequency of Douglas-fir increases, the transition between domination by the single-capsid morphotype and domination by the multi-capsid morphotype is much sharper than it is in the data. Conversely, when the effects of density-dependent transmission are weaker, so that the amplitude of the population cycles is smaller, then as the frequency of Douglas-fir increases, the transition between domination by the single-capsid morphotype and domination by the multi-capsid morphotype is much more gradual than it is in the data. Reproducing the data thus requires that the effects of density-dependent transmission and population cycles be in rough balance with the effects of the selection mosaic, so that the transition between single-capsid domination and multi-capsid domination is neither too steep nor too gradual compared to the data. Explaining the relationship between forest composition and our morphotype frequency data thus requires a combination of host-pathogen population cycles and a G × G × E interaction. The lack of this effect in the non-evolutionary model helps to explain why that model provides a poor fit to the data. Also, we note that the cycles in our data are driven both by the pathogen and by environmental stochasticity, demonstrating that stochasticity plays a key role in the host-pathogen population cycles.

Projecting the effects of biopesticide use on Douglas-fir tussock moth populations

The interacting effects of host population fluctuations and a selection mosaic in our model together suggest that the long-term use of a single morphotype in the TMB-1 baculovirus biopesticide product may alter the population dynamics of the Douglas-fir tussock moth. To understand such effects, we modified our best-fit model to include the use of the baculovirus as a biopesticide under three different scenarios: (1) a multi-capsid-only formulation like TMB-1; (2) a hypothetical single-capsid-only formulation; (3) a hypothetical 50:50 morphotype mixture formulation. In the model, we applied the biopesticide as an input of baculovirus at the beginning of the epizootic period (summer), such that the biopesticide was applied when the insect density Nn in generation n increased from the previous generation (Nn > Nn−1) and crossed a defined threshold NT, such that Nn > NT. To consider different levels of population control, we varied both the density threshold and the amount of biopesticide being applied. Because the biopesticide was expensive to produce and because supplies are limited, in practice, the biopesticide is not applied every time the insect density reaches a high level, so we also varied the likelihood of deploying the biopesticide in high-density years. We then projected the average insect population over 100 years of biopesticide application, and we used our projections to calculate the percent reduction in Douglas-fir tussock moth densities compared to the baseline no-biopesticide case. We focus on the effect of varying the morphotype composition of the biopesticide and the probability of biopesticide application by fixing the density threshold NT at 0.5 insects/m2 and by fixing the amount of biopesticide applied at the equivalent of 150 cadavers/m2, which were values that yielded low insect densities in a previous model of biopesticide use in a similar insect-virus system53, and that yielded low tussock moth densities in our model. Varying these parameters showed that lowering the threshold for biopesticide use and increasing the amount of biopesticide applied produced better control, as one might expect (Supplementary Note 10).

As one might further expect, more frequent biopesticide applications due to a higher probability of application also produced better population control, but the extent of this latter effect varied strongly with forest tree species composition and with the morphotype composition of the biopesticide. In forests with ≤80% Douglas-fir, all biopesticide formulations and all levels of biopesticide application reduced the host population, with the extent of the reduction becoming more severe as the probability of biopesticide application increased (Fig. 6).

Fig. 6: Effects of baculovirus biopesticide use on reductions in Douglas-fir tussock moth densities.
Fig. 6: Effects of baculovirus biopesticide use on reductions in Douglas-fir tussock moth densities.The alternative text for this image may have been generated using AI.
Full size image

Varying forest compositions show an increasing percentage of Douglas-fir from left to right. Grey points and horizontal dashed line correspond to the no-treatment baseline. The colored points and lines correspond to different compositions of the baculovirus biopesticide: 100% multi-capsid morphotype composition (blue), 50% multi-capsid morphotype and 50% single-capsid morphotype composition (green), and 100% single-capsid morphotype composition (orange). Each point shows the mean ± SEM percent change in the host population calculated relative to the no-treatment baseline for 20 stochastic realizations. Source data are provided as a Source Data file.

Beyond this broad trend, however, there were also interesting differences between biopesticides of different compositions. In general, the hypothetical single-capsid-only biopesticide and the hypothetical 50:50 mixture biopesticide produced the best control, in that increasing the probability of applying these formulations produced ever-lower population densities, from a reduction of 30% to a reduction of more than 80% (Fig. 6). The current multi-capsid-only biopesticide in contrast produced only a modest improvement in control as the probability of application increased, with the population reduction only increasing with the probability of application from about 20% to about 30%. As we show in Supplementary Fig. 22, the multi-capsid-only biopesticide has lower efficacy because the host is able to evolve high resistance to the multi-capsid morphotype. More surprisingly, in forests with 95% Douglas-fir, a low probability of biopesticide application produced a worse outcome than no biopesticide at all. This counterintuitive result arises because infrequent biopesticide use sharply increases insect resistance without killing enough insects to significantly lower the insect’s density.

Discussion

By collecting a large number of additional samples of the Douglas-fir tussock moth baculovirus, we have helped to produce one of the most extensive data sets on a long-standing polymorphism for an animal pathogen. This dataset allowed us to demonstrate that the polymorphism in the tussock moth baculovirus is strongly affected by forest tree species composition, thus providing what is to the best of our knowledge, the first case of a selection mosaic in an animal pathogen. Explaining that spatial polymorphism, however, requires that we allow not just for a selection mosaic, but also for the effects of host and pathogen population cycles. Our results thus represent a first step towards a unification of theories of host-pathogen population cycles and theories of G × G × E interactions.

Part of the reason why selection mosaics and G × G × E interactions have not been considered as factors affecting the dynamics of animal pathogens is that studies of polymorphism in animal pathogens have focused on pathogen invasions and spillover3,4,5,6,7,8,9,10,11 to the exclusion of pathogen-driven cycles and eco-evolutionary dynamics. This focus is understandable, but it means that the effects of pathogen competition on the dynamics of animal host-pathogen interactions are poorly understood. We therefore emphasize that the structure of our model is not specific to the Douglas-fir tussock moth-baculovirus system, and so our work is likely to provide useful insights into other animal host-pathogen systems.

Indeed, the variation in host infection risk/pathogen infectiousness that is central to our model has been shown to be important for rapid host evolution in fungal epizootics in Daphnia54, in the coexistence of pathogen strains in the spongy moth48, in modulating the transmission of the baculovirus of the fall armyworm, Spodoptera frugiperda, by plant defenses41, in determining rates of reinfection in tuberculosis in humans55, and in the evolution of virulence in myxomatosis of European rabbits, Oryctolagus cuniculus56. Our model’s assumption that periods of pathogen transmission alternate with periods of host reproduction holds for a very large number of host-pathogen systems, including systems in which the hosts are mammals, birds, amphibians, insects, and plants, and in which the pathogens are viruses, fungi, protozoa, and bacteria23. We therefore argue that selection mosaics likely affect other animal host-pathogen interactions as well.

A key part of our argument is that, unlike our simple statistical model, our eco-evolutionary host-pathogen model provides a mechanistic explanation for our morphotype frequency data. Our mechanistic model, like all models, is a simplification of nature, and it is therefore only an approximation of the dynamics of the Douglas-fir tussock moth-baculovirus interaction. Indeed, insect population cycles can be driven by other mechanisms, including specialist parasitoids57 and food limitation58. Evidence that such mechanisms affect Douglas-fir tussock moth population cycles, however, is weak, whereas evidence that the baculovirus drives the population cycles is strong16,59. More concretely, given that our morphotype frequency data provide only limited information about the population density of the Douglas-fir tussock moth, it is unlikely that a more complex model would have provided a better explanation for the data. The observation that our results are almost completely unchanged if we allow for generalist predators or parasitoids supports this argument. A more difficult question is how our results are affected by latitudinal variation in weather, and so allowing for weather effects is a key future direction.

It is nevertheless true that the ability of our experiment-based parameter estimates to explain our observational data suggests that weather does not play a key role in determining spatial variation in morphotype frequencies. While the positive correlation between the frequency of the multi-capsid morphotype and the frequency of Douglas-fir could, in theory, result from weather variables that independently affect the two tree species and the two morphotypes, our experimental results provide support for the model independently of the morphotype frequency data. Our experiments thus support our hypothesis that the pattern of morphotype frequency variation across forest compositions arises from a selection mosaic and not broad-scale climatic gradients. It is therefore unlikely that latitudinal variation in weather is the correct explanation for the data: understanding the potential role of weather is nevertheless an important direction for future research.

Although our experiment provided useful insights into the mechanisms determining the outcome of pathogen competition, it focused on transmission at the scale of small larval populations. Our experimental data, therefore, reflect a composite of behavioral, genetic, and random effects, as do the parameters that we estimated from the experiment. In recent work, we used lab experiments to disentangle some of these components43. These lab experiments showed that the higher levels of variation in infectiousness of the single-capsid morphotype relative to the multi-capsid morphotype are due to higher heterogeneity in the probability of transmission given virus consumption. The lab experiments further showed, however, that larvae have much more difficulty detecting and avoiding the single-capsid morphotype than the multi-capsid morphotype. These fitness differences between the two pathogens in the lab experiment varied between tree species in much the same way as they did in our field experiment, supporting our argument that variation in morphotype frequency is due to a selection mosaic in forest tree species composition.

Our best-fit model shows that outbreaks are more severe at sites with low to intermediate frequencies of Douglas-fir. This result is supported by recent work in which we showed that outbreak severity in nature also tends to be highest at low to intermediate frequencies of Douglas-fir60. Our recent work further demonstrated, however, that outbreak severity is affected by many different factors. Here, we focus on the effects of population cycles on morphotype coexistence, rather than on the effects of morphotype coexistence on population cycles.

Our model projects that a hypothetical biopesticide composed of only the single-capsid morphotype would provide better pest control than the current biopesticide that is composed of only the multi-capsid morphotype, and shows that a biopesticide composed of both morphotypes would provide even better control than biopesticides composed of either morphotype alone. These effects occur because the biopesticide imposes strong selection pressure for the insect to evolve resistance to the baculovirus (Supplementary Fig. 22). The evolution of resistance, however, is constrained by the resistance-fecundity tradeoff, which varies with both morphotype and tree species. The reason why the single-capsid-only biopesticide would be able to control the host population better than the multi-capsid-only biopesticide is because when the insect is feeding on grand fir, it experiences a very high benefit of having a higher risk of infection with respect to the single-capsid morphotype, limiting the insect’s ability to evolve high resistance to that morphotype. This is true even though when the insect is feeding on Douglas-fir, it experiences a much lower benefit of having a high risk of infection with respect to the single-capsid morphotype, because even one or two grand fir patches in the forest can serve as a refuge for insects with low resistance. Conversely, when the insect is feeding on either tree species, it experiences a relatively modest benefit to having a higher infection risk with respect to the multi-capsid morphotype. This allows the insect to evolve comparatively high resistance to the multi-capsid morphotype, preventing the multi-capsid-only biopesticide from being as effective as the other two biopesticide formulations. Notably, when a biopesticide consists of only the single-capsid morphotype, our model projects that the average infectiousness of the multi-capsid morphotype increases to above pre-biopesticide levels. This effect likely occurs because the application of the single-capsid-only biopesticide leads to a lower frequency of the multi-capsid morphotype. This lower frequency, in turn, means that increases in the host’s risk of infection with the multi-capsid morphotype yield substantial increases in fecundity, which are accompanied by only modest increases in deaths due to infection with the multi-capsid morphotype.

Stocks of the biopesticide are sufficiently low that it is unlikely that biopesticide use will ever reach high levels. Accordingly, the most interesting feature of our biopesticide results may be that our model projects that infrequent biopesticide use may have slightly negative effects in predominantly Douglas-fir forests because of increased host resistance without much population control. Biopesticide use may thus have unexpected effects on Douglas-fir tussock moth populations.

Although heritability in baculovirus resistance has not been quantified in the Douglas-fir tussock moth, heritable resistance to pathogens has been documented in multiple species of insects. Baculovirus resistance is heritable in the closely related spongy moth50, partly because of heritability in the ability of a spongy moth larva to detect and avoid the baculovirus. Antibacterial and antiviral enzymes in the Egyptian cotton leafworm (Spodoptera littoralis) have also been shown to be heritable61, as has resistance to the bacterial pathogen Bacillus thuringiensis in the diamondback moth (Plutella xylostella) and tobacco budworm (Helicoverpa virescens, Tabashnik62), and immune gene expression in the Western honey bee (Apis mellifera, Decanini et al.63).

Theoreticians have often focused on coinfections as a mechanism allowing for the coexistence of pathogen strains64, but coinfections occurred at a low rate in our data, and the pattern of coinfections suggests that infection with one strain has little effect on infection with the other strain (Supplementary Fig. 1). It therefore seems likely that coinfections play no more than a minor role in competition between the two morphotypes of the Douglas-fir tussock moth baculovirus. Similarly, the speed-of-kill differs slightly between the two morphotypes, but our recent work showed that these differences are small enough that they have only modest effects on morphotype competition43.

Our results show that pathogen-driven population cycles can modulate the effects of selection mosaics on pathogen competition, thus providing a clear illustration of the importance of considering both host-pathogen ecology and host-pathogen evolution. Because the baculovirus plays a key role in the control of Douglas-fir tussock moth populations34,59, our work also shows that an understanding of the ecology and evolution of infectious disease can be useful for guiding microbial pest control. Our work may therefore provide general insights into applied ecology.

Methods

Geographic morphotype frequency data

Our morphotype frequency dataset combines published data sources and our own field collections (Supplementary Table 4), which together include 1914 samples across 128 locations. The first published source is Hughes37, who sampled 65 locations across the range of the Douglas-fir tussock moth, with most locations in Washington, Oregon, and Idaho. To locate the sampled sites from the map included in Hughes, we used ArcGIS to determine the approximate latitudes and longitudes of the locations on the map. Because the Hughes data do not provide sample sizes, we assumed that the sample size at each location was one larva when one morphotype was present and two larvae when both morphotypes were present. This approach allowed us to take into account this dataset without allowing it to strongly influence our estimates of morphotype frequencies.

The second published source in our morphotype frequency dataset is Williams and Otvos65, who collected 185 baculovirus samples in five geographic regions of southern British Columbia, Canada, by rearing larvae from field-collected egg masses. Their samples consisted only of the multi-capsid morphotype. The third published source is Williams et al.40, who collected 165 virus samples from 29 locations across the range of the Douglas-fir tussock moth. These samples came from both field-collected egg masses and larval cadavers.

Our addition to the data came from 6091 larvae that we collected at 22 locations in Washington, Oregon, Idaho, and Montana in the summers of 2019 and 2020. The larvae we collected were reared in the lab until death or pupation, yielding 1715 virus-infected cadavers. The overall fraction infected was 28%, although the fraction infected ranged from 0 to 60% across sites. Four locations did not have any virus infections, so they could not be used in our analyses of morphotype frequencies. The multi-capsid-only biopesticide (TMB-1) is sufficiently expensive and is in sufficiently limited supply that it is only ever applied to very small areas, and there are no records that it was ever used at any of our sample sites. All fieldwork and data collection in this study were carried out with the appropriate permits in coordination with the USDA Forest Service.

To identify the morphotype in each infected larva, we carried out PCR amplification of the polyhedrin gene polh, a conserved protein that occludes virions during environmental transmission38 (see Supplementary Table 2). We were able to successfully classify 1316 (76.7%) virus-infected cadavers as being infected with either the single-capsid morphotype, the multi-capsid morphotype, or both. Of these, 41.8% were infected with only the multi-capsid morphotype, 47.2% cadavers were infected with only the single-capsid morphotype, and 11.2% were infected with both morphotypes. Multiple lines of evidence indicate that infection with one morphotype did not affect an insect’s chance of subsequent infection with the other morphotype (Supplementary Fig. 1). We therefore recorded each coinfected insect as both a single-capsid and a multi-capsid isolate, so that our data consisted of 1463 morphotype samples.

Prior to the development of our PCR protocol, the corresponding author and colleagues used electron microscopy to morphotype 12 samples that had been collected by forest managers from across the insect’s range34. Electron microscopy is much more expensive than PCR, but it makes it possible to directly visualize whether a virus-killed insect has occlusion bodies with virions arranged singly, as in the single-capsid morphotype, or arranged in bundles, as in the multi-capsid morphotype39.

For each of our 123 sample sites in the United States, we estimated the relative frequency of Douglas-fir using the National Forest Type Dataset provided by the USDA Forest Service Forest Inventory and Analysis Program & Remote Sensing Applications Center66. The dataset was downloaded on August 22, 2022. We used the extract function in the raster v3.6.26 R package to quantify relative Douglas-fir frequency within a 5 km radius around each site. For each of the Canadian sites, we used the Canadian Forest Monitoring MODIS kNN map on Canada’s National Forest Inventory website (https://nfi.nfis.org/en/maps) to confirm that the site was dominated by Douglas-fir67. See Supplementary Note 2 for details on the tree species dataset.

Quantifying morphotype fitness with a field experiment

Overall infection risk depends on natural feeding behavior, which cannot be easily mimicked using laboratory experiments41. We therefore used a field experiment to estimate average pathogen infectiousness \(\overline{\nu }\) and variation in pathogen infectiousness C for each morphotype on each host tree. We carried out this field experiment in the Okanogan-Wenatchee National Forest in Washington State, USA (47.315N, 120.425W) in 2021. Our experimental protocol was refined in two initial pilot experiments. Because the first of these pilot experiments had very low infection rates, while the second had high contamination levels in controls, we did not use the data from either pilot experiment.

In the first step in our experiment, we reared uninfected Douglas-fir tussock moth larvae in the laboratory from field-collected egg masses. The egg masses were collected in the spring of 2021 from a natural population in the Caribou-Targhee National Forest in Idaho, USA (43.75N, 111.29W). To ensure that the larvae in the experiment were not infected at hatch, we surface-sterilized all egg masses in 10% formalin, which has been shown to effectively eliminate viruses on insect eggs without killing the eggs34.

In the second step in the experiment, we produced infected larvae by feeding neonates an artificial diet inoculated with a virus dose that we had determined using an initial dose-response experiment (Supplementary Note 3). We reared the neonates in the lab for 5 days at 25.5 C to ensure that they were near death. We then deployed the infected neonates on branches in the field.

In the third step in the experiment, we placed the infected neonates on small branches of the host trees, and we encased the branches in mesh bags to keep the neonates from escaping. The mesh bags were made of spun-bonded polyester, a translucent material that blocks UV, thereby eliminating the breakdown of the virus while permitting the passage of air and water48. The larvae were thus allowed to feed under natural conditions. This type of experiment provides estimates of transmission rates that are close to estimates from naturally occurring epizootics34. Because using multiple pathogen densities allows for more accurate estimation of variation in pathogen infectiousness, we used densities of 0, 5, and 20 infected neonates on each branch.

After 5 days, a period long enough to ensure that the infected neonates died naturally on the foliage, we added ten fourth instars to each bag. To ensure that the fourth instars were uninfected, we reared them in the lab before deployment in the field. The resulting larval densities were within the range of larval densities observed in nature34. We then allowed the uninfected fourth instars to feed on the contaminated foliage for 7 days, a period long enough to ensure that infection rates would reach at least moderate levels, but short enough to ensure that none of the initially uninfected fourth instars would become infected and die of the virus while in a bag. Our experiment thus included only a single round of transmission.

The branches in our experiment were on Douglas-fir and grand fir trees. We used five viral isolates of each morphotype, 9 of which were taken from our morphotype collections (see Supplementary Table 5 for the location from which each isolate was collected). The tenth isolate was the biopesticide TMB-1 that consists only of the multi-capsid morphotype46.

After 7 days, we removed the branches to the lab, where we placed the fourth instars in individual 2-ounce cups containing cubes of uncontaminated artificial diet. We reared the larvae for 21 days, a period long enough to ensure that infected larvae would die of the virus34. Baculovirus occlusion bodies can be seen at 400X under a light microscope, so all dead larvae were autopsied to determine if they were virus-killed. We estimated total branch area by photographing each branch at the end of the experiment and then by using the open-source image-analysis software ImageJ v1.53a to estimate the area. We then used the area of each branch and the number of infected larvae added to each branch to estimate initial pathogen density in terms of cadavers/m2.

Our field experiment included 92 experimental branches, 48 for the multi-capsid morphotype and 44 for the single-capsid morphotype, and 8 control branches with no infectious cadavers. Our goal in including control branches was to test whether there was any baculovirus on the branches besides the virus that we added, and to test whether any of our uninfected insects had accidentally become infected in the lab. To ensure that the control branches differed from the experimental branches only in having no added infectious cadavers, we enclosed the control branches in mesh bags at the same time that we enclosed the experimental branches (plus infected larvae) in mesh bags. Out of the 73 control larvae, only one became infected after being deployed in the field. This low rate (1.3%) indicates a lack of systematic contamination in either the lab or the field, and we therefore did not include the infected control larva in our analyses. A modest number of the initially uninfected fourth instars were dead when we opened the bags, but we confirmed via autopsy that none were infected with the baculovirus. We used the fraction infected from each experimental branch to fit the transmission parameters \(\overline{\nu }\) and C.

To determine the extent to which baculovirus fitness is determined by tree species and/or viral morphotype, we used model selection to compare the ability of different models to explain our experimental data, such that different models made different assumptions about whether transmission in the experiment depended on morphotype, morphotype and tree species, or neither morphotype nor tree species. Our models were based on a simplified version of our Susceptible-Exposed-Infectious-Recovered (SEIR) model. To produce this model, we adapted the SEIR model to our experiments by assuming that there is only one round of virus transmission and that the mesh bags eliminate the breakdown of the virus, as in our experiments. The density of infectious cadavers, therefore, did not change during the experiment, so we can set the rate of change of the pathogen density in our SEIR model to zero48. The fraction of hosts that became infected during the experiment is then:

$$\frac{I(T)}{S(0)}=1-{(1+\alpha {C}^{2}\overline{\nu }{P}_{\!\!0}T)}^{-\frac{1}{{C}^{2}}}$$
(1)

Here, I(T) represents the number of infected insects that become infected over T days, the number of days for which the susceptible insects in the experiment were exposed to the baculovirus (in practice T = 7). The symbols S(0) and P(0) represent the initial density of susceptible insects and infectious cadavers, respectively. The fraction infected during the experiment is therefore \(\frac{I(T)}{S(0)}\). The average pathogen infectiousness/host infection risk is \(\overline{\nu }\), and the variation in infectiousness/risk is C. Because first instar larvae are much smaller than fourth instar larvae, we include the parameter α to represent the ratio of the number of occlusion bodies produced by first instars to the number produced by fourth instars. Here we use an estimate α = 0.032 from previous work34.

Because of genetic similarities, it is reasonable to assume that virus isolates within a morphotype are not independent. One rigorous way to account for this dependence is by using a Bayesian hierarchical model in which isolate is nested within morphotype. When we estimated the morphotype fitness parameters \(\overline{\nu }\) and C, we thus assumed that each isolate consisted of a random draw from a morphotype-specific distribution of each parameter.

To test whether baculovirus fitness is determined by tree species and/or viral morphotype, we compared the fit of models in which the fraction infected in the experiment depended on morphotype, morphotype and tree species, or neither morphotype nor tree species. In addition to models in which each isolate consisted of a random draw from a morphotype-specific distribution of parameters, we also considered a model in which each isolate consisted of a random draw from a single distribution that represented both morphotypes at once and that therefore did not include effects of morphotype on pathogen fitness. To choose between models, we used the leave-one-out cross-validation (LOO-CV) model-selection criterion; because the best models had very similar LOO-CV scores, we chose the overall best model using the minimum sum of squared errors (SSE, Supplementary Table 6). We implemented our Bayesian hierarchical models using the Stan statistical computing language v2.32.2, and we analyzed the output using the rstan v2.32.6, loo v2.7.0, bayesplot v1.11.1, and tidyverse v2.0.0 R packages (see Supplementary Note 3 for the fit of the models to the data and other model details). For purposes of comparison, we also considered a model that allowed for fitness differences between morphotypes but not tree species, and a model that included no fitness differences between morphotypes. We then parameterized our mechanistic models of morphotype competition using the parameter estimates from the best model of our experimental data.

To understand how our field estimates of the transmission parameters affect individual morphotype fitness over the course of a single epizootic, we used our SEIR model to quantify the fraction infected at the end of a season over a range of host densities. To show the range of the dynamics, we used 225 draws from the thinned posterior distribution of parameter values for the best model, which were subsetted using the as_draws_matrix and subset_draws functions in the posterior v1.5.0 R package. We simulated the SEIR model in an all Douglas-fir forest and in an all grand fir forest for each morphotype independently and calculated the cumulative fraction infected at the end of the epizootic.

Modeling the effects of variation in forest tree species on morphotype frequency

To test the extent to which our experimental transmission data could help explain patterns in our morphotype frequency data, we fit spatial, long-term models to the morphotype frequency data. In these models, we used an SEIR-type model to describe combined epizootics of the two viral morphotypes (Supplementary Note 4). At the end of the epizootic in the model, surviving hosts reproduce, and the two viral morphotypes experience over-winter mortality. Because we allow for a resistance-fecundity tradeoff, the average infectiousness of each morphotype changes after the epizootic due to host reproduction and the (incomplete) heritability of infection risk. The eco-evolutionary model thus describes changes in the density of the host, in the density of cadavers infected with each morphotype, and in the average infectiousness of each morphotype:

$$\overbrace{{N}_{n+1}}^{{\rm{Host}}\,{\rm{density}}}=\overbrace{{e}^{{\epsilon }_{n}}}^{{\rm{Stochasticity}}}{N}_{n}\overbrace{(1-{i}_{1}-{i}_{2})}^{{\rm{Fraction}}\,{\rm{infected}}}\underbrace{[r+r({s}_{1}{\nu }^{*}_{1,n}+{s}_{2}{\nu }^{*}_{2,n})]}_{{\rm{Effect}}\,{\rm{of}}\,{\rm{trade}}\,{\rm{off}}\,{\rm{on}}\,{\rm{host}}\,{\rm{fecundity}}}$$
(2)
$$\overbrace{{Z}_{1,n+1}}^{{\rm{Morphotype}}\,1}=\overbrace{{\phi }_{1}{N}_{n}{i}_{1}}^{{\rm{Short}}{\mbox{-}}{\rm{term}}\,{\rm{overwintering}}}+\overbrace{\gamma {Z}_{1,n}}^{{\rm{Long}}{\mbox{-}}{\rm{term}}\,{\rm{overwintering}}}$$
(3)
$$\overbrace{{Z}_{2,n+1}}^{{\rm{Morphotype}}\,2}={\phi }_{2}{N}_{n}{i}_{2}+\gamma {Z}_{2,n}$$
(4)
$$\overbrace{{\overline{\nu }}_{1,n+1}}^{{\rm{Infectiousness}}/{\rm{risk}},{\rm{Morph}}\,1}={\nu }_{1,n}^{*}\frac{\overbrace{1+{s}_{1}{\nu }_{1,n}^{*}({b}_{1}^{2}{C}_{1}^{2}+1)+{s}_{2}{\nu }_{2,n}^{*}(\rho {b}_{1}{C}_{1}{b}_{2}{C}_{2}+1)}^{{\rm{Effect}}\,{\rm{of}}\,{\rm{trade}}\,{\rm{off}}\,{\rm{on}}\,{\rm{pathogen}}\,{1}^{{\prime}}s\,{\rm{average}}\,{\rm{infectiousness}}}}{\underbrace{1+{s}_{1}{\nu }_{1,n}^{*}+{s}_{2}{\nu }_{2,n}^{*}}_{{\rm{Normalization}}\,{\rm{Factor}}}}$$
(5)
$$\overbrace{\overline{\nu }_{2,n+1}}^{{\rm{Infectiousness}}/{\rm{risk}},{\rm{Morph}}\,2}={\nu }_{2,n}^{*}\frac{1+{s}_{2}{\nu }_{2,n}^{*}({b}_{2}^{2}{C}_{2}^{2}+1)+{s}_{1}{\nu }_{1,n}^{*}(\rho {b}_{2}{C}_{2}{b}_{1}{C}_{1}+1)}{1+{s}_{2}{\nu }_{2,n}^{*}+{s}_{1}{\nu }_{1,n}^{*}}$$
(6)

Here, host density Nn+1 in generation n + 1 depends on the host density in the preceding generation Nn, the baseline fecundity r, a stochastic term \({e}^{{\epsilon }_{n}}\), the fraction surviving the epizootic 1 − i1 − i2, and the resistance-fecundity tradeoff parameters s1 and s2 for pathogens 1 and 2, respectively. The symbols i1 and i2 represent the respective fraction of hosts infected with each pathogen. The variable ϵn is a normal random variate with mean 0 and standard deviation σ, representing “environmental stochasticity”, the randomness due to fluctuations in environmental variables such as weather. To allow for a cost of resistance in the host, we assume that fecundity increases with increasing average infectiousness, such that s1 and s2, the tradeoff parameters, are the respective rates at which fecundity increases with infection risk with respect to each morphotype. The symbols \({\nu }_{1}^{*}\) and \({\nu }_{2}^{*}\) represent the respective average infectiousness of each morphotype at the end of the previous epizootic, which may equivalently be interpreted as the infection risk of the host with respect to each morphotype. Note that pathogen-induced mortality always causes host infection risk at the end of an epizootic to be lower, and often much lower, than it was at the beginning of the epizootic. We therefore have \({\nu }_{1,n}^{*} < {\overline{\nu }}_{1,n}\) and \({\nu }_{2,n}^{*} < {\overline{\nu }}_{2,n}\). Changes in host density are therefore partially driven by balancing selection, such that higher mean infection risks \({\overline{\nu }}_{1}\) and \({\overline{\nu }}_{2}\) lead to increased mortality from each morphotype but also to increased fecundity.

The state variables Z1,n and Z2,n represent the densities of the two pathogens in generation n. The symbol ϕ represents the effective overwintering rate of the pathogen, which incorporates both the survival of the pathogen from one generation to the next and the higher susceptibility of neonates to later instars. It is often true that ϕ > 1 because neonates have much higher susceptibility35. Longer-term pathogen survival is represented by the survival rate γ.

The average infectiousness \({\overline{\nu }}_{1,n+1}\) for pathogen 1 in generation n + 1 is modulated by the heritability of infectiousness b1 for pathogen 1 and the correlation in the host’s susceptibility to each pathogen ρ. Although theory has shown that a negative correlation ρ < 0, corresponding to negative frequency-dependent selection, can strongly promote pathogen coexistence32, in practice, correlations in an insect’s susceptibility to different baculovirus strains are almost invariably positive48, and so negative frequency-dependent selection is unlikely to play a role in our system.

The parameter combinations \({b}_{1}^{2}{C}_{1}^{2}\) and \({b}_{2}^{2}{C}_{2}^{2}\) represent the fraction of overall variation that is due to additive genetic factors, so that higher values of b1 and b2 strengthen the effects of selection. Changes in infection risk are thus determined by balancing selection, as in the case of host density, except that, in contrast to host density, the change in infection risk does not depend on the baseline fecundity r. The equation for the host’s average risk of infection with pathogen 2, \({\overline{\nu }}_{2,n+1}\), in generation n + 1 has an analogous structure.

To represent spatial variation in tree species within the forest in the model, we implemented equations (2)–(6) on a hexagonal spatial grid. A key consideration in spatial modeling is how the grid structure interacts with the spatial domain, particularly at the edges. Hexagonal grids offer advantages over square grids because they have a symmetric, orthogonal coordinate system, a low perimeter-to-area ratio, and because the center of each hexagon is equidistant from the centers of its six nearest neighbors68. These properties help reduce bias from edge effects. In contrast, square grids often have stronger edge effects because of their higher perimeter-to-area ratio and because they have two different kinds of nearest neighbors; four orthogonal neighbors that share an edge, and four diagonal neighbors that share only a corner. This difference creates asymmetries in local interactions.

We incorporated variation in the fraction of Douglas-firs in the hexagonal grids in our models by varying the fraction of hexagons that represented Douglas-fir versus grand fir. Our sample sites spanned a wide range of Douglas-fir frequencies, so in the model, we varied the number of Douglas-fir cells in the 37-cell grid from 1 (≈2.7%) to 36 (≈97.3%). Although our forest composition dataset includes sites with 0 and 100% Douglas-fir, we excluded these extreme cases from model fitting because including them led the model fitting routine into regions of parameter space in which the host and pathogen populations would frequently go extinct. Moreover, the extreme cases are probably not ecologically realistic, because forests defoliated by the Douglas-fir tussock moth are not likely to contain exactly 0% or 100% Douglas-fir. This limitation stems from the forest-types dataset, which records only the dominant tree species at a location; because not all species were recorded at each location, values of 0% or 100% Douglas-fir likely reflect sampling error.

Because it was possible that Douglas-fir tussock moth dispersal could eliminate the effects of the spatially varying selection that is fundamental to selection mosaics, it was important to allow for dispersal in our model. The only meaningful dispersal of larvae within a forest occurs when first instar larvae balloon on silk strands, which rarely leads to dispersal distances of more than a few hundred meters51. Also, the vast majority of ballooning takes place before larvae begin feeding, so we do not expect host tree effects on ballooning. Ballooning distances in our model therefore follow an exponential distribution, so that most larvae disperse to their nearest neighbors, but some larvae disperse much farther, and dispersal is identical on the two host-tree species (Supplementary Note 5). We set the dispersal parameter in our model so that the average distance that larvae dispersed was 2.69 grid units. If we assume that the average distance that larvae disperse in the field is approximately 50 m, then the distance between the centers of two adjacent grid cells is approximately 18.59 m and the distance between two grid points at opposite edges is approximately 111.5 m. Given the geometry of our spatial grid, the total area of our forest is 8076.6 m2.

To test whether our morphotype frequency data can be best explained by variation in host tree species and/or population cycles, we constructed models that allowed for selection mosaics in the variation in infectiousness C and the fecundity-resistance tradeoff parameter s, and we compared them to models that had no selection mosaic in either C or s. For models that allowed for a selection mosaic in C (Models 1 and 5 in Table 1), we used estimates of C from the best transmission model that allowed for host tree differences. For the models that did not allow for a selection mosaic in C or s (Model 4 in Table 1), we used parameter estimates from the best transmission model that did not allow for host tree species. For the model that allowed a selection mosaic for s but not C (Model 3 in Table 1), we used estimates of C from the transmission model that did not allow for effects of tree species on C. For the model that included a selection mosaic for s, but no selection mosaic or morphotype effects on C (Model 2 in Table 1), we used estimates from the transmission model that did not allow for either host tree or morphotype effect on C. For the model that did not include host evolution, but did allow C and \(\overline{\nu }\) to vary spatially (Model 7 in Table 1), we used estimates of C and \(\overline{\nu }\) from the transmission model in which C and \(\overline{\nu }\) both varied between morphotypes and between host tree species.

To simplify the fitting process, we used estimates of the remaining parameters of the SEIR model from previous work with colleagues in which SEIR models were fit to data from baculovirus epizootics in insect populations (see Supplementary Table 9)34,48. We then estimated five parameters from the morphotype frequency data: the virus overwintering parameter ϕ, the correlation between host infection risk to the two pathogens ρ, the fecundity-resistance tradeoff parameter s, and the stochasticity parameter σ, which is the standard deviation in the stochasticity term ϵn in equations (2). We used maximum likelihood to estimate these parameters from our morphotype frequency data.

Our model fitting approach involved generating stochastic realizations of the model and using the model output to calculate the average fraction of larvae that were infected by the multi-capsid morphotype in years in which the overall fraction infected was greater than or equal to 0.3. We then computed the likelihood of observing the morphotype frequency data given the average fraction infected in the model. To align the morphotype frequency data with the model’s spatial representation of forest structure, each field site was assigned to the hexagonal grid with the most similar forest composition. Because the morphotype frequency data consist of the proportion of each morphotype observed at each location, the data are fundamentally binomial, and so we used a binomial likelihood function. To account for model stochasticity, we averaged the likelihoods across many model realizations, yielding an integrated likelihood estimate69.

Because generating model realizations is highly computationally intensive, we used a simple likelihood maximization approach known as “line search” 70. The line search algorithm works by iteratively optimizing one parameter at a time across a predetermined range of values. The target parameter is then set to its optimal value across its range, and the process is repeated for the next parameter. The algorithm cycles through the parameters until each parameter has been varied a specified number of times.

We first implemented our line search algorithm by averaging likelihoods across 96 model realizations, while fixing the stochasticity parameter σ = 0.5. Each parameter was sampled independently in the line search routine with no nesting for tree species or morphotype. We then optimized σ for each of the 30 best parameter sets from the line search step. In this second optimization step, we improved the accuracy of our likelihood estimates by averaging likelihoods across 2000 realizations. We then chose the best model using the AIC model-selection criterion. All model output in the figures is based on the best-fitting parameter set from each model (Supplementary Note 6).

To understand how the eco-evolutionary dynamics change as a function of forest composition, we simulated the model over 2000 generations using the best-fit parameters. To consider the effects of more complex ecological interactions, we also considered a model with a generalist predator (Supplementary Note 9). To understand the extent to which our results are affected by dispersal, we extended our best model to allow for two hexagonal grids with dispersal between grids (Supplementary Note 8).

Projecting the effects of long-term biopesticide use

To implement the biopesticide in our model, we followed the general approach of Reilly and Elderd53, who tested the effects of a baculovirus biopesticide on outbreak cycles in the spongy moth. Reilly and Elderd found that the threshold density at which the biopesticide is applied and the amount applied have important effects on long-term pest dynamics, but that the timing of the biopesticide application within a season has little effect. We therefore applied biopesticides after the dispersal of first instars, which is typically when forest managers apply biopesticides in forest insect populations. The biopesticide was then applied in the model as an input of the baculovirus when the insect density Nn in generation n increased from the previous year Nn > Nn−1 and when the population crossed a threshold insect density NT, so that Nn > NT.

We varied four parameters that affect biopesticide use. First, we varied the threshold insect density that triggers an application, using values between 0.2 and 2.0 insects/m2. Second, we varied the amount of biopesticide applied, using values between 1 and 200 cadavers/m2. Third, we varied the relative morphotype compositions that make up the biopesticide, using either only the multicapsid morphotype, only the single-capsid morphotype, or a mixture of the two. Fourth, we varied the probability of applying the biopesticide when the threshold and density criteria were met, using values between 0 and 1. For this, we fixed the threshold at 0.5 insects/m2 and the biopesticide amount at 150 cadavers/m2.

We simulated each scenario for 350 years/tussock moth generations, such that the biopesticide was only ever applied between years 150–250 and thus not before year 150 or after year 250. Eliminating biopesticide application before year 150 and after year 250 allowed us to compare the effects on the host population and average infectiousness before, during, and after consistent biopesticide treatment. We then calculated average host population densities across 20 model realizations.

All simulations and morphotype frequency model fitting routines were performed using the DifferentialEquations v7.4.0, Distributions v0.25.73, and MPI v0.20.8 packages in the Julia programming language v1.7.3 and OpenMPI v4.1.0 library project for the message passing implementation.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.