Skip to main content

Thank you for visiting You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

The network structure and eco-evolutionary dynamics of CRISPR-induced immune diversification


As a heritable sequence-specific adaptive immune system, CRISPR–Cas is a powerful force shaping strain diversity in host–virus systems. While the diversity of CRISPR alleles has been explored, the associated structure and dynamics of host–virus interactions have not. We explore the role of CRISPR in mediating the interplay between host–virus interaction structure and eco-evolutionary dynamics in a computational model and compare the results with three empirical datasets from natural systems. We show that the structure of the networks describing who infects whom and the degree to which strains are immune, are respectively modular (containing groups of hosts and viruses that interact strongly) and weighted-nested (specialist hosts are more susceptible to subsets of viruses that in turn also infect the more generalist hosts with many spacers matching many viruses). The dynamic interplay between these networks influences transitions between dynamical regimes of virus diversification and host control. The three empirical systems exhibit weighted-nested immunity networks, a pattern our theory shows is indicative of hosts able to suppress virus diversification. Previously missing from studies of microbial host–pathogen systems, the immunity network plays a key role in the coevolutionary dynamics.

This is a preview of subscription content, access via your institution

Relevant articles

Open Access articles citing this article.

Access options

Rent or buy this article

Prices vary by article type



Prices may be subject to local taxes which are calculated during checkout

Fig. 1: An example of typical dynamics with regime shifts.
Fig. 2: Structures of diversity.
Fig. 3: Snapshots of network structure during the two regimes.
Fig. 4: Processes leading to regime shifts.
Fig. 5: Weighted nestedness of empirical immunity networks.

Data availability

Simulated and empirical network data are available in the dedicated GitHub repository associated with this paper at:

Code availability

The code for the simulations and their analysis is available in the dedicated GitHub repository associated with this paper at:


  1. Labrie, S. J., Samson, J. E. & Moineau, S. Bacteriophage resistance mechanisms. Nat. Rev. Microbiol. 8, 317–327 (2010).

    CAS  PubMed  Google Scholar 

  2. van Houte, S., Buckling, A. & Westra, E. R. Evolutionary ecology of prokaryotic immune mechanisms. Microbiol. Mol. Biol. Rev. 80, 745–763 (2016).

    CAS  PubMed  PubMed Central  Google Scholar 

  3. Mayer, A., Mora, T., Rivoire, O. & Walczak, A. M. Diversity of immune strategies explained by adaptation to pathogen statistics. Proc. Natl Acad. Sci. USA 113, 8630–8635 (2016).

    CAS  PubMed  Google Scholar 

  4. Chevallereau, A., Meaden, S., van Houte, S., Westra, E. R. & Rollie, C. The effect of bacterial mutation rate on the evolution of CRISPR–Cas adaptive immunity. Philos. Trans. R. Soc. Lond. B 374, 20180094 (2019).

    CAS  Google Scholar 

  5. Gurney, J., Pleška, M. & Levin, B. R. Why put up with immunity when there is resistance: an excursion into the population and evolutionary dynamics of restriction–modification and CRISPR–Cas. Philos. Trans. R. Soc. Lond. B 374, 20180096 (2019).

    CAS  Google Scholar 

  6. Weitz, J. S. et al. Phage–bacteria infection networks. Trends Microbiol. 21, 82–91 (2013).

    CAS  PubMed  Google Scholar 

  7. Gurney, J. et al. Network structure and local adaptation in co-evolving bacteria-phage interactions. Mol. Ecol. 26, 1764–1777 (2017).

    CAS  PubMed  Google Scholar 

  8. Fortuna, M. A. et al. Coevolutionary dynamics shape the structure of bacteria-phage infection networks. Evolution 73, 1001–1011 (2019).

    PubMed  Google Scholar 

  9. Krasnov, B. R. et al. Phylogenetic signal in module composition and species connectivity in compartmentalized host-parasite networks. Am. Nat. 179, 501–511 (2012).

    PubMed  Google Scholar 

  10. Pilosof, S. et al. Host–parasite network structure is associated with community-level immunogenetic diversity. Nat. Commun. 5, 5172 (2014).

    CAS  PubMed  Google Scholar 

  11. Dallas, T. & Cornelius, E. Co-extinction in a host-parasite network: identifying key hosts for network stability. Sci. Rep. 5, 13185 (2015).

    CAS  PubMed  PubMed Central  Google Scholar 

  12. Pilosof, S., Morand, S., Krasnov, B. R. & Nunn, C. L. Potential parasite transmission in multi-host networks based on parasite sharing. PLoS ONE 10, e0117909 (2015).

    PubMed  PubMed Central  Google Scholar 

  13. Vázquez, D. P., Poulin, R., Krasnov, B. R. & Shenbrot, G. I. Species abundance and the distribution of specialization in host–parasite interaction networks. J. Anim. Ecol. 74, 946–955 (2005).

    Google Scholar 

  14. Fortuna, M. A. et al. Nestedness versus modularity in ecological networks: two sides of the same coin? J. Anim. Ecol. 79, 811–817 (2010).

    PubMed  Google Scholar 

  15. Flores, C. O., Meyer, J. R., Valverde, S., Farr, L. & Weitz, J. S. Statistical structure of host–phage interactions. Proc. Natl Acad. Sci. USA 108, E288–E297 (2011).

    CAS  PubMed  Google Scholar 

  16. Beckett, S. J. & Williams, H. T. P. Coevolutionary diversification creates nested-modular structure in phage–bacteria interaction networks. Interface Focus 3, 20130033 (2013).

    PubMed  PubMed Central  Google Scholar 

  17. He, Q. et al. Networks of genetic similarity reveal non-neutral processes shape strain structure in Plasmodium falciparum. Nat. Commun. 9, 1817 (2018).

    PubMed  PubMed Central  Google Scholar 

  18. Pilosof, S. et al. Competition for hosts modulates vast antigenic diversity to generate persistent strain structure in plasmodium falciparum. PLoS Biol. 17, e3000336 (2019).

    PubMed  PubMed Central  Google Scholar 

  19. van der Oost, J., Westra, E. R., Jackson, R. N. & Wiedenheft, B. Unravelling the structural and mechanistic basis of CRISPR–Cas systems. Nat. Rev. Microbiol. 12, 479–492 (2014).

    CAS  PubMed  PubMed Central  Google Scholar 

  20. Childs, L. M., Held, N. L., Young, M. J., Whitaker, R. J. & Weitz, J. S. Multiscale model of CRISPR-induced coevolutionary dynamics: diversification at the interface of Lamarck and Darwin. Evolution 66, 2015–2029 (2012).

    PubMed  PubMed Central  Google Scholar 

  21. Paez-Espino, D. et al. CRISPR immunity drives rapid phage genome evolution in Streptococcus thermophilus. mBio 6, e00262-15 (2015).

    PubMed  PubMed Central  Google Scholar 

  22. van Houte, S. et al. The diversity-generating benefits of a prokaryotic adaptive immune system. Nature 532, 385–388 (2016).

    CAS  PubMed  PubMed Central  Google Scholar 

  23. Daly, R. A. et al. Viruses control dominant bacteria colonizing the terrestrial deep biosphere after hydraulic fracturing. Nat. Microbiol. 4, 352–361 (2019).

    CAS  PubMed  Google Scholar 

  24. Pauly, M. D., Bautista, M. A., Black, J. A. & Whitaker, R. J. Diversified local CRISPR–Cas immunity to viruses of Sulfolobus islandicus. Philos. Trans. R. Soc. Lond. B 374, 20180093 (2019).

    CAS  Google Scholar 

  25. Childs, L. M., England, W. E., Young, M. J., Weitz, J. S. & Whitaker, R. J. CRISPR-induced distributed immunity in microbial populations. PLoS ONE 9, e101710 (2014).

    PubMed  PubMed Central  Google Scholar 

  26. Almeida-Neto, M. & Ulrich, W. A straightforward computational approach for measuring nestedness using quantitative matrices. Environ. Model. Softw. 26, 173–178 (2011).

    Google Scholar 

  27. Held, N. L., Herrera, A., Cadillo-Quiroz, H. & Whitaker, R. J. CRISPR associated diversity within a population of Sulfolobus islandicus. PLoS ONE 5, e12988 (2010).

    PubMed  PubMed Central  Google Scholar 

  28. England, W. E., Kim, T. & Whitaker, R. J. Metapopulation structure of CRISPR–Cas immunity in Pseudomonas aeruginosa and its viruses. mSystems 3, e00075-18 (2018).

    PubMed  PubMed Central  Google Scholar 

  29. Marvig, R. L., Sommer, L. M., Molin, S. & Johansen, H. K. Convergent evolution and adaptation of Pseudomonas aeruginosa within patients with cystic fibrosis. Nat. Genet. 47, 57–64 (2015).

    CAS  PubMed  Google Scholar 

  30. Pirnay, J.-P. et al. Pseudomonas aeruginosa population structure revisited. PLoS ONE 4, e7740 (2009).

    PubMed  PubMed Central  Google Scholar 

  31. Hall, A. R., Scanlan, P. D., Morgan, A. D. & Buckling, A. Host–parasite coevolutionary arms races give way to fluctuating selection. Ecol. Lett. 14, 635–642 (2011).

    PubMed  Google Scholar 

  32. Levin, B. R., Moineau, S., Bushman, M. & Barrangou, R. The population and evolutionary dynamics of phage and bacteria with CRISPR-mediated immunity. PLoS Genet. 9, e1003312 (2013).

    CAS  PubMed  PubMed Central  Google Scholar 

  33. Koskella, B. & Brockhurst, M. A. Bacteria–phage coevolution as a driver of ecological and evolutionary processes in microbial communities. FEMS Microbiol. Rev. 38, 916–931 (2014).

    CAS  PubMed  PubMed Central  Google Scholar 

  34. Weissman, J. L. et al. Immune loss as a driver of coexistence during host-phage coevolution. ISME J. 12, 585–597 (2018).

    PubMed  PubMed Central  Google Scholar 

  35. Braga, L. P. P., Soucy, S. M., Amgarten, D. E., da Silva, A. M. & Setubal, J. C. Bacterial diversification in the light of the interactions with phages: the genetic symbionts and their role in ecological speciation. Front. Ecol. Evol. 6, 6 (2018).

    Google Scholar 

  36. Fontaine, C. et al. The ecological and evolutionary implications of merging different types of networks. Ecol. Lett. 14, 1170–1181 (2011).

    PubMed  Google Scholar 

  37. Gupta, S. & Day, K. P. A strain theory of malaria transmission. Parasitol. Today 10, 476–481 (1994).

    CAS  PubMed  Google Scholar 

  38. Buckee, C. O., Recker, M., Watkins, E. R. & Gupta, S. Role of stochastic processes in maintaining discrete strain structure in antigenically diverse pathogen populations. Proc. Natl Acad. Sci. USA 108, 15504–15509 (2011).

    CAS  PubMed  Google Scholar 

  39. Artzy-Randrup, Y. et al. Population structuring of multi-copy, antigen-encoding genes in Plasmodium falciparum. eLife 1, e00093 (2012).

    PubMed  PubMed Central  Google Scholar 

  40. Zinder, D., Bedford, T., Gupta, S. & Pascual, M. The roles of competition and mutation in shaping antigenic and genetic diversity in influenza. PLoS Pathog. 9, e1003104 (2013).

    CAS  PubMed  PubMed Central  Google Scholar 

  41. Song, C., Rohr, R. P. & Saavedra, S. Why are some plant–pollinator networks more nested than others? J. Anim. Ecol. 86, 1417–1424 (2017).

    PubMed  Google Scholar 

  42. Chabas, H. et al. Evolutionary emergence of infectious diseases in heterogeneous host populations. PLoS Biol. 16, e2006738 (2018).

    PubMed  PubMed Central  Google Scholar 

  43. Iranzo, J., Lobkovsky, A. E., Wolf, Y. I. & Koonin, E. V. Evolutionary dynamics of the prokaryotic adaptive immunity system CRISPR–Cas in an explicit ecological context. J. Bacteriol. 195, 3834–3844 (2013).

    CAS  PubMed  PubMed Central  Google Scholar 

  44. Staniczenko, P. P. A., Kopp, J. C. & Allesina, S. The ghost of nestedness in ecological networks. Nat. Commun. 4, 1391 (2013).

    PubMed  Google Scholar 

  45. Rosvall, M. & Bergstrom, C. T. Maps of random walks on complex networks reveal community structure. Proc. Natl Acad. Sci. USA 105, 1118–1123 (2008).

    CAS  PubMed  Google Scholar 

  46. Rosvall, M., Axelsson, D. & Bergstrom, C. T. The map equation. Eur. Phys. J. Spec. Top. 178, 13–23 (2010).

    Google Scholar 

  47. Farage, C., Edler, D., Eklöf, A., Rosvall, M. & Pilosof, S. A dynamical perspective to community detection in ecological networks. Preprint at bioRxiv (2020).

  48. Newman, M. E. J. & Girvan, M. Finding and evaluating community structure in networks. Phys. Rev. E 69, 026113 (2004).

    CAS  Google Scholar 

  49. Lancichinetti, A. & Fortunato, S. Community detection algorithms: a comparative analysis. Phys. Rev. E 80, 056117 (2009).

    Google Scholar 

  50. Campbell, K. M. et al. Sulfolobus islandicus meta-populations in Yellowstone National Park hot springs. Environ. Microbiol. 19, 2334–2347 (2017).

    PubMed  Google Scholar 

  51. Bautista, M. A., Black, J. A., Youngblut, N. D. & Whitaker, R. J. Differentiation and structure in Sulfolobus islandicus rod-shaped virus populations. Viruses 9, 120 (2017).

    PubMed Central  Google Scholar 

Download references


We thank W. England and M. Pauly for data processing and collection and Q. He for guidance on the construction of the phylogenetic trees from the model outputs. R.W. acknowledges the support of the Cystic Fibrosis Foundation (no. CFF C2480) and an Allen Distinguished Investigator Award from the Allen Frontiers Institute. M.P. acknowledges the support of the University of Chicago. We are grateful for the access to the computer cluster of the Research Computing Center of the University of Chicago.

Author information

Authors and Affiliations



S.P. conceptualized the study, carried out the formal analysis (networks and data analysis, model dynamics, visualizations) and wrote the original manuscript draft. S.A.A.-C. carried out the formal analysis (networks analysis, model simulation) and reviewed and edited the manuscript. T.W. was involved with the software, methodology and formal analysis (model dynamics). T.K. curated and analysed the data and reviewed and edited the manuscript. S.M. was involved with the software, methodology and funding acquisition, and reviewed and edited the manuscript. R.W. conceptualized the study, curated and analysed the data, acquired the funding, supervised the study and reviewed and edited the manuscript. M.P. conceptualized the study, carried out the formal analysis (model dynamics), acquired the funding and prepared the original manuscript draft.

Corresponding authors

Correspondence to Rachel Whitaker or Mercedes Pascual.

Ethics declarations

Competing interests

The authors declare no competing interests.

Additional information

Peer review information Peer reviewer reports are available.

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Extended data

Extended Data Fig. 1 Viral and host abundance and richness.

a, Host abundance. The 100 most abundant strains are colored, the rest are aggregated and shown in gray. b, Richness (i.e., number of unique strains) of hosts (blue) and viruses (red). The number of unique spacers (spacer richness) is depicted in brown. During VDRs the abundance of both hosts and viruses fluctuates. As a response to virus diversification, host richness eventually increases despite possible declines at the beginning of the VDR resulting from the initial viral attack.

Extended Data Fig. 2 Host phylogenetic tree.

The tree is not inferred, but rather drawn based on exact genealogical data (which strain descends from which) collected during the simulation. Branch length indicates the lifetime of any given host strain. Hosts diversify and go extinct primarily during VDRs, resulting in strain replacement, but strains can also persist from one VDR to the next.

Extended Data Fig. 3 Host and virus diversification and extinction.

Each host (panel a) or viral (panel b) strain is plotted with a line, starting at the time when the strain was generated and ending when the strain went extinct. During VDRs the rate of diversification of both viruses and hosts is higher than during HCRs. While viruses have relatively short persistence (shorter line lengths), hosts have long persistence and can persist during an entire VDR.

Extended Data Fig. 4 Modules in the infection network.

A time series of the number of modules in the infection network for a single simulation. Modularity enables diversification since it allows the temporary coexistence of different groups of viruses.

Extended Data Fig. 5 Host and virus rankings in the weighted nested immunity matrix as a function of age.

The plots show node strength (sum of the corresponding number of matches in the immunity network) of hosts (top) and viruses (bottom) against their age measured from the time of their birth, for two selected times before the start of an HCR (leY, t=231 and right, t=1720). Each data point represents a host (top) or virus (bottom) strain. On the different plots, selected groups of youngest and oldest strains are indicated. The oldest host strains occupy the lower rows (low node strength), and their rankings tend to decrease with age. This is because descendants of a given host inherit all of its spacers and add a new one, which always results in an increase in total matches (host node strength). Because they have acquired additional protection, they can grow in abundance and through resulting enhanced encounters and infections, the failure of existing spacers can add redundancy (more than one spacer to the same virus), further contributing to their ranking. The oldest viruses occupy the leftmost columns, with the highest column sums of matches to hosts, since longer lifetimes provide the opportunity for many encounters, and therefore for both the failure of existing spacers (which adds redundancy to a given entry) and the addition of new spacers (which distributes immunity throughout entries). A successful offspring will have mutated a protospacer that confers escape from a given match of the parent; thus, successful descendants exhibit one less match and are placed to the right. It is worth noting that there is considerable variation around the general trends with age, reflecting the complex interplay of the stochastic acquisition of spacers and protospacers with the abundance dynamics which affect both encounter and mutation rates.

Extended Data Fig. 6 Order of extinctions.

We tested for ‘orderly’ extinctions in which extinction preferentially happens from the viruses to which hosts have most immunity to those that can infect many hosts. For any virus that went extinct we calculated an ‘immunity rank’. Specifically, for a given time step, we calculated the strength of all n virus nodes in the immunity network, s=(s1,s2, …,sj,…,sn), where sj is the node strength of virus j (i.e., the sum of the columns in Fig. 2g in the main text). Viruses with higher values of sj are those that are more to the left in Fig. 2g, and to which hosts have high immunity. We removed duplicate values in s (to avoid ties) and ordered it in ascending order to obtain s’. We then calculated the relative position of sj in s’. A rank of 1 means that the virus that went extinct was highly ranked (e.g., position 5 out of 5 values will render a rank of 1). 50% of viruses (median indicated by a vertical dashed line) had an extinction rank of 0.5.

Extended Data Fig. 7 Viral escape via 1-matches.

A tripartite virus-protospacer-host network depicting escape routes for a single virus. Each host is connected to a single protospacer (colored boxes). The spacer composition of strains is shown. Escape occurs through matching colors.

Extended Data Fig. 8 Reproductive numbers R0 and R1.

At the entrance into an HCR, the average of reproductive numbers \({{\rm{R}}}_{{\rm{j}}}^{0}\) over all virus strains j (weighted by their respective abundances) (light blue line) is considerably below 1. After this initial stage, this mean measure hovers around 1 (horizontal dashed line) and exhibits considerably larger values towards the end of this period before the transition to a VDR. Growth based purely on hosts made available by a single escape mutation is shown here as the weighted-mean of \({{\rm{R}}}_{{\rm{j}}}^{1}\) across viruses j (in pink). This quantity exhibits an increasing trend during the HCR, which also raises the potential \({{\rm{R}}}_{{\rm{pot}}}^{{\rm{j}}}\), defined as the sum of \({{\rm{R}}}_{0}^{{\rm{j}}}\) and \({{\rm{R}}}_{1}^{{\rm{j}}}\) (not shown, for clarity).

Extended Data Fig. 9 Modularity of empirical host-spacer networks.

Each row represents a different data set: Sulfolobus islandicus hosts from Yellowstone (Top). Pseudomonas aeruginosa hosts from Copenhagen (middle). S. islandicus hosts from the Mutnovsky Volcano in Russia, 2010 (bottom). Panels a, c and e, are host-spacer networks in which interactions within host-spacer modules are colored. Panels b, d and f, are distributions of the map equation (L) obtained from networks shuffled by randomly distributing interactions. Value of the observed L is depicted with a vertical dashed line.

Extended Data Fig. 10 Regime definition.

Each point in the virus abundance time series in panel a is first converted to relative abundance (panel b) and then classified into a HCR (green) or VDR (purple). This classification is based on the second difference (panel d) (for comparison we also show the first difference in panel c). Momentary virus growth periods (marked with an arrow) are not classified as VDR. The final classification is shown using vertical lines. HCRs start with a purple line and VDRs with a green line.

Supplementary information

Supplementary Information

Supplementary Tables 1–4, Methods and Notes.

Reporting Summary

Peer Review Information

Rights and permissions

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Pilosof, S., Alcalá-Corona, S.A., Wang, T. et al. The network structure and eco-evolutionary dynamics of CRISPR-induced immune diversification. Nat Ecol Evol 4, 1650–1660 (2020).

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:

This article is cited by


Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing