{'fraction_non_alphanumeric': 0.04195408797919258, 'fraction_numerical': 0.009725206377926043, 'mean_word_length': 4.65111821086262, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Antigenic Diversity, Transmission Mechanisms, and the Evolution of Pathogens

Pathogens have evolved diverse strategies to maximize their transmission fitness. Here we investigate these strategies for directly transmitted pathogens using mathematical models of disease pathogenesis and transmission, modeling fitness as a function of within- and between-host pathogen dynamics. The within-host model includes realistic constraints on pathogen replication via resource depletion and cross-immunity between pathogen strains. We find three distinct types of infection emerge as maxima in the fitness landscape, each characterized by particular within-host dynamics, host population contact network structure, and transmission mode. These three infection types are associated with distinct non-overlapping ranges of levels of antigenic diversity, and well-defined patterns of within-host dynamics and between-host transmissibility. Fitness, quantified by the basic reproduction number, also falls within distinct ranges for each infection type. Every type is optimal for certain contact structures over a range of contact rates. Sexually transmitted infections and childhood diseases are identified as exemplar types for low and high contact rates, respectively. This work generates a plausible mechanistic hypothesis for the observed tradeoff between pathogen transmissibility and antigenic diversity, and shows how different classes of pathogens arise evolutionarily as fitness optima for different contact network structures and host contact rates.


A Extended within-host model
We extend our original within-host model by including the acquisition of immunity from antigenically similar strains. This is done by modifying Eqn. (2), where we incorporate cross-weights z(̺) over the involved antigenic distances ̺, defined analogously to y(̺). All the other equations and parameters are kept unchanged.

A.1 Definition
For the pathogen strain i ≥ 0, the new version of (2) reads where z i • X sat i (V ) = k≤n z(̺ ik )h(η, V k )X i models the acquisition of immunity depending on the pathogen load vector V = (V k ) k≤n , weighted according to the corresponding antigenic distances z(̺ ik ). Saturation is taken account of, again through the Hill function h(a, b) = 1/(1 + a/b), and for each strain k ≤ n separately.
The inclusion of immune acquisition, incorporated into the extended model via the cross-weight function z, leads to an increased presence of immunity. This requires us to reduce the immune reaction by adjusting the cross-weight function y. In numerical simulations (cf. Figs. S1-1-S1-4), we let where y orig denotes the cross-weight function of our original model in the text. There is no particular requirement to utilize a symmetric-looking definition here; other forms produce similar outcomes. Except for y, all quantities are assumed to be as in the original model.

A.2 Results
The individual and average curves of the extended within-host dynamical model are shown in Fig. S1-1. The subfigures correspond to the ones of the original model in Fig. 2 -each of the 6 pairs capturing obvious similarities. One also confirms that the three characteristic surfaces Figs. 3A,B,C (copied to Figs. S1-2D,E,F) of the original model are similar to the corresponding surfaces of the extended model (Figs. S1-2A,B,C)both in shape and with respect to the locations of the maxima. As expected from the original model, type A has the highest pathogen load and shows widely varying individual durations (Figs. S1-1A,B) -leading to characteristic average load curves of very small tails and moderate average durations ( Fig. S1-1C). Regions nearby the load maximum in pathogen space lead to shorter individual durations (Figs. S1-2A,B), possibly important for real-world realizations of this type -such as influenza. However, type A is more universal than only representing flu -for infectiousness thresholds above the critical value, v T > v crit T , this type is expected to emerge at any contact rate (cf. Figs. 4 and 5). All these results have also been obtained with our original within-host model -the only difference is the location of the load maxima in pathogen parameter space. The maxima of the extended model are shifted towards lower antigenic variation (of about one or two orders of magnitude, cf. Figs. S1-2A,D).
Also for the two other infection types, B and C, the within-host surfaces of the extended model are very similar to the ones of the original model. Again, only the scale of the antigenic variation changes a bitfor both types one observes shifts from intermediate towards lower values (cf. Figs. S1-2B,E and C,F, resp.).

B Tradeoff between initial peak load and antigenic variation
The within-host dynamics imply a tradeoff between initial peak load and antigenic diversity. The relation was discussed and visualized for the original model ( Fig. S1-2F), but it is easily recognized for the extended model ( Fig. S1-2C). The necessary requirement, as argued in the Methods section, is the implementation of cross-immunity.

B.1 Cross-immunity -requirement for the emergence of ChDs
The characteristic within-host surfaces without cross-immunity are shown in Figs. S1-2G,H,I. Besides huge load values (type A) and extended durations (type B), one observes a flat initial peak surface with respect to the diversity parameter δ. That means that there is no preferred value of antigenic variation and, in particular, diseases with low variation are not favored (selected through the highest R 0 value) by evolution. In other words, without the possibility of cross-immunity ChD-like type C infections are not expected to emerge. 2) and also the locations of the maxima coincide, corresponding to our infection-type classification. Only the bottom row, which shows the characteristic surfaces without implementation of cross-immunity (i.e., z(̺ ik ) = y(̺ ik ) = δ ik ), is different from the upper two rows -in particular, Fig. S1-2I. The surface in (I) is flat with respect to the parameter δ -ChD-like type C infections cannot be identified (at low antigenic diversity).  Figure S1-3. Relation between infectiousness and within-host replication. Between-host dynamics, R 0 , for different infectiousness values: (A) v T = 10 9 , (B) v T = 10 10 , (C) v T = 10 11 , illustrated for type C infections (i.e., contact rate α = 1) with parameter values as in Fig. 3. Within-host replication (represented by maximal R 0 ) is monotonically increasing with respect to infectiousness: (A) ρ = 3, (B) ρ = 3.5, (C) ρ = 5.

B.2 Relation between infectiousness and within-host replication
Infectiousness v T and the favored within-host replication rate ρ are directly correlated. This is obvious when comparing type A and B infections -the former showing high rates ρ (> 8) while representing the limit v T → ∞ and the latter showing low rates ρ (< 3) while representing the limit v T → 0. The statement is less obvious when including type C infections, which occur at high infectiousness values but show rather low replication rates (in Figs. 3F and 5D). The apparent contradiction is resolved by noticing that type C infections occur within the v T -range of type A. In Fig. S1-3, we calculate Fig. 3F again for various infectiousness values v T > 10 8 , which also leads to replication rates ρ > 3. This confirms our statement also within type C infections.

C Robustness of the type classification
After altering the implementation of cross-immunity, we also demonstrate that limitations concerning the way we model antigenic variation are not important for our infection-type classification result.
The choice of 5 loci with 3 alleles was imposed by the computational complications of solving models with larger numbers of strains. This choice allows for a maximum of 243 different antigenic strains to be generated by random mutations, which -even if back-mutations are possible -is relatively small for high mutation rates. The cumulative numbers of strains generated during an infection are shown in Fig. S1-4; one observes saturation effects for high mutation rates (which characterize type B), especially for high replication rates (cf. Figs. S1-4C,D). Exhaustion of strains resulting in an early end of infection is therefore a potential limitation of our model -possibly affecting type B infections. However, such truncation of the duration has not been seen for this type of infections, which are also characterized by long durations even with limited number of strains modeled. Therefore, even if model limitations are artificially truncating the duration of those infections, this is not affecting the overall self-organization of pathogen types generated by the model. The types A and C are characterized by low average numbers of strains, which means, these types are unaffected by limits on strain numbers.