In silico evolution of transferable genetic elements

Plasmids are an integral and essential factor in microbial biology and evolution, with broad implications ranging from antibiotic resistance to research tools. Much has been done to describe, quantify, and modify properties of transferable plasmids, including the extensive theoretical work using simulations and models. However, a wide gap between theory and experiments still remains, especially relating to the underlying genetic architecture of transfer as well as coevolutionary dynamics of the plasmid infectivity and susceptibility. Large-scale genomic studies and more biologically accurate models are among different approaches working towards narrowing this gap. Here we describe how Aevol, a digital evolution system, can be effectively used to study plasmid and quantify various aspects of their evolution and its outcomes. Specifically, we find that plasmid maintenance is extremely sensitive to the direct fitness cost of expressing transfer genes. In our study, the genes for donor ability and recipient immunity (which additively describe the probability of plasmid transfer) typically, but not exclusively, evolved on the plasmid itself. Additionally, we find epistatic interactions between genes on plasmids and the chromosome may evolve, a new aspect of their interaction and struggle for control over each other. There is a strong coevolutionary link between donor ability and recipient immunity, with their values tracking and being driven by one another. While plasmids seem to largely behave as selfish genetic elements, they occasionally may also carry metabolic genes and directly increase individual’s fitness. With a number of concise questions and results, this initial study of plasmids in Aevol establishes the baseline and opens possibilities for future work, while simultaneously uncovering and describing novel evolutionary trajectories taken by the transferable genetic elements. Introduction and Background Horizontal gene transfer in general, and plasmid conjugation in particular, have been identified as major mechanisms in microbial evolution (Ochman et al. 2000; Koonin and Wolf 2012). Better understanding of the movement of the genetic material between different species has fundamentally changed how we view and analyze phylogeny of life (Doolittle 1999; Koonin et al. 2001; Ragan et al. 2009). In parallel, plasmids have been the focus of extensive research due to their role in acquisition, maintenance, and transfer of antibiotic resistance (Davison 1999; Alekshun and Levy 2007; Bennett 2008). They have also been harnessed as a powerful tool in molecular biology, enabling research ranging from creation of synthetic genes and gene therapy to design of pet glow-in-thedark fish (Cohen et al. 1973; Sambrook et al. 1989; Pray 2008; Constante et al. 2011). From suicide plasmids to plasmid addiction, these transferable bits of DNA hold seemingly inexhaustible diversity of strategies for spread and survival, making them an intriguing and fascinating subject of research (Lipps 2009). Given their spread and importance in the natural world, it is no great surprise that plasmid biology has been extensively modeled over the past decades, primarily with analytical models using differential equations (Stewart and Levin 1977; Levin and Stewart 1980; Bergstrom et al. 2000). One of the main limitations of such models rests in their lack of spatial structure – organisms interact with each other at random and cannot preferentially associate with each other. More recent work has addressed these issues by simulating the spatial dynamics of plasmids on lattices (Krone et al. 2007) and cellular automaton-like graphs (Connelly et al. 2011). However, in all of these studies, the individuals were just a collection of numerical parameters such as their plasmid susceptibility, birth or death rate, but did not have a genome and were thus not well suitable for understanding potentially important consequences of the genetic architecture of plasmid conjugation. Previous models were unable to consider the location of the plasmid transfer genes, how they may move between the plasmid and the chromosome, or interact depending on their location, which we remedy here. Classically, plasmids can be placed into two distinct categories, based on their ability to transfer themselves from one individual to another: the conjugative plasmids, which carry the genes enabling the transfer themselves, and mobilizable plasmids, which require other means, such as genes located on other plasmids. Rather than focus on one or the other type, in our research system we give the transfer genes the opportunity to evolve on either the main chromosome or the plasmid, as well as to be freely exchanged between the two. Additionally, our digital plasmids can carry both metabolic and transfer genes and thus effectively control their horizontal and vertical transmission by modifying infectivity or directly changing the host’s fitness advantage in the population. In a series of experiments presented here, we evolve and analyze hundreds of populations for thousands of generations and are able to characterize the diversity of evolutionary strategies for the location and effect of genes controlling the in silico plasmid transfer. ECAL General Track


Introduction and Background
Horizontal gene transfer in general, and plasmid conjugation in particular, have been identified as major mechanisms in microbial evolution (Ochman et al. 2000;Koonin and Wolf 2012).Better understanding of the movement of the genetic material between different species has fundamentally changed how we view and analyze phylogeny of life (Doolittle 1999;Koonin et al. 2001;Ragan et al. 2009).In parallel, plasmids have been the focus of extensive research due to their role in acquisition, maintenance, and transfer of antibiotic resistance (Davison 1999;Alekshun and Levy 2007;Bennett 2008).They have also been harnessed as a powerful tool in molecular biology, enabling research ranging from creation of synthetic genes and gene therapy to design of pet glow-in-thedark fish (Cohen et al. 1973;Sambrook et al. 1989;Pray 2008;Constante et al. 2011).From suicide plasmids to plasmid addiction, these transferable bits of DNA hold seemingly inexhaustible diversity of strategies for spread and survival, making them an intriguing and fascinating subject of research (Lipps 2009).
Given their spread and importance in the natural world, it is no great surprise that plasmid biology has been extensively modeled over the past decades, primarily with analytical models using differential equations (Stewart and Levin 1977;Levin and Stewart 1980;Bergstrom et al. 2000).One of the main limitations of such models rests in their lack of spatial structure -organisms interact with each other at random and cannot preferentially associate with each other.More recent work has addressed these issues by simulating the spatial dynamics of plasmids on lattices (Krone et al. 2007) and cellular automaton-like graphs (Connelly et al. 2011).However, in all of these studies, the individuals were just a collection of numerical parameters such as their plasmid susceptibility, birth or death rate, but did not have a genome and were thus not well suitable for understanding potentially important consequences of the genetic architecture of plasmid conjugation.Previous models were unable to consider the location of the plasmid transfer genes, how they may move between the plasmid and the chromosome, or interact depending on their location, which we remedy here.
Classically, plasmids can be placed into two distinct categories, based on their ability to transfer themselves from one individual to another: the conjugative plasmids, which carry the genes enabling the transfer themselves, and mobilizable plasmids, which require other means, such as genes located on other plasmids.Rather than focus on one or the other type, in our research system we give the transfer genes the opportunity to evolve on either the main chromosome or the plasmid, as well as to be freely exchanged between the two.Additionally, our digital plasmids can carry both metabolic and transfer genes and thus effectively control their horizontal and vertical transmission by modifying infectivity or directly changing the host's fitness advantage in the population.In a series of experiments presented here, we evolve and analyze hundreds of populations for thousands of generations and are able to characterize the diversity of evolutionary strategies for the location and effect of genes controlling the in silico plasmid transfer.

Methods
To study plasmid dynamics and evolution we use Aevol, digital experimental platform that enables us to maintain, track, and manipulate large populations of digital organisms over thousands of generations.Aevol is similar to and builds on the success of the existing digital experimental systems, such as Avida (Lenski et al. 1999;Misevic et al. 2004Misevic et al. , 2006;;Goldsby et al. 2012).However, it also includes significant changes, particularly pertaining to more biologically realistic genetic encoding and genotype-phenotype mapping (Knibbe et al. 2006;Knibbe et al. 2007;Knibbe et al. 2008;Beslon et al. 2010).Aevol is freely available for download at www.aevol.fr.In all our experiments we used the default parameters unless otherwise noted.Main properties of Aevol have been described in great detail previously (Parsons et al. 2010;Misevic et al. 2012), so here we focus on the features specifically implemented and directly relevant for our study of the plasmids evolutionary dynamics.

General properties.
Aevol individuals are double stranded binary strings, typically thousands of base pairs long.An evolved organism contains multiple proteins, flanked by promoters, terminators, and start/stop codons.During its lifetime, digital genomes undergo a microbial genetic inspired transcription and translation steps to determine the their phenotype and in turn organisms' fitness.The phenotype is the collection of proteins, each an abstract entity, physically represented by a triangle located on the phenotypic axis.The phenotypic axis is the collection of all possible traits that may be a part of the organism's phenotype, each trait corresponding to a real number between 0 and 1.Two traits that are next to each other on the phenotypic axis are more likely to interact pleiotropically, as there is a higher chance that a single protein would affect them both, than two traits located further away.Two different sequences may encode for the same gene but the traits that are close to each other on the phenotypic axis are not necessarily encoded by genes with high sequence similarity.Each protein triangle has three properties: (1) the location on the phenotypic axis that signifies the trait it primarily affects, (2) the height that represents its expression level, and (3) the width that shows the range of neighboring traits it also affects.
For any specific experimental environment, there exists a single, constant target phenotype, which is a collection of trait expression levels that are most optimal for this environment and are the target for selection.The fitness of an individual is calculated as the difference between the target function and the phenotype, and intuitively represents the percentage of the area under the target phenotype function that is covered by the phenotype.The fitness can theoretically be negative, for example for individuals that express proteins with optimal levels of zero, but such individuals are rare and are quickly selected out of the population.
Population structure: The default Aevol populations do not have an explicit structure and are akin to well-mixed bacterial populations living in liquid media.However, as spatial structure is thought to play an important role in plasmid transfer (Krone et al. 2007), we are using the square grid structure originally implemented for the study of cooperation (Misevic et al. 2012).We can vary the strength of spatial structure using a migration parameter (mig), which determines the number of swaps that happen at every generation.For each swap we choose at random a pair of organisms in the population and exchange their location.High mig (on the order of population size) thus corresponds to a well-mixed population, while a low one (mig = 0) a perfectly spatially structured one.
Mutations, selection, and reproduction: The genome of a new organism may be different from its parent due to mutations, the errors made during replication.Specifically, organisms experience small mutations (point mutations and insertion/deletions of sequences up to 6 base pairs) as well as large mutations (duplications/deletions of more that 6bp, translocations and inversions).Aevol is a synchronous evolutionary model, so the fitness of all individuals is evaluated at the same time, just prior to selection.Each organism competes with neighbors from the classical 3x3 Moore neighborhood around it for a chance to place its offspring in the next generation.The offspring is chosen using roulette selection on the probabilities derived from fitness of all the individuals in the neighborhood.Each individual has a (a -1) x a 9-R / (a 9 -1) probability of reproducing into the central position of the neighborhood, where R is the organism's fitness-based rank and a is the population-level selection pressure constant.We should note that while the phenotypic target is fixed during each experiment, the effective strength of selection does not necessarily decrease or plateau.As target expression levels are real numbers and the selection we use is rank-based, even the smallest differences in fitness will be selected for, leading to continual adaptation, if not a truly open-ended evolution.Following selection, all individuals are reproduced simultaneously, with mutations, and placed into the population.

Plasmids in Aevol
The most fundamental property of Aevol plasmids is that they are treated as genetic units, equivalent to the already existing chromosome in all but one aspects of their digital biology.They mutate at the same rate as the chromosome, are transferred vertically to the offspring during reproduction, and the genes encoded on the plasmid are combined with the chromosomal genes to form the organism's phenotype.For large mutations, for example transposition, the beginning and the end of the transposed segment, as well as the location where it will be inserted, are chosen at random from the combined length of the chromosome and plasmid.As only the beginning and the end, but not the insertion location of the transposon, must be on the same genetic unit, this mutational mechanism allows for genes to freely move between the genetic units.
The exception from the equality between the chromosome and the plasmid is, of course, that plasmids are mobile genetic elements and may also transfer horizontally, between neighboring individuals in the same generation, while chromosomes cannot do so.Both plasmids and chromosomes are capable of controlling the rate of this transfer, inspired by bacterial conjugation, by evolving genes to decrease or increase the probability of sending or receiving a plasmid.

ECAL 2013
Donor ability and recipient immunity: In order for individuals to be able to control the rate of plasmid conjugation, we split the phenotypic axis into three sections: metabolism, donating, and receiving.The proteins located on the metabolism section of the axis directly affect the fitness, based on how closely they match the target phenotype, as they do on the single-section axis in classical Aevol experiments.The proteins on the donating or receiving sections determine the organism's donor and recipient ability.The donor ability corresponds to the effort that the organism will exert in order to transfer the plasmid.Inversely, the recipient ability, which we will refer to as plasmid exclusion ability or immunity, corresponds to the effort that an individual will put into not accepting the plasmid being sent to it.Both are calculated analogously to the metabolic fitness and represent the percentage of area under the target curve in the appropriate axis section that is covered by the protein triangles.Ancestral organism has no proteins associated with plasmid transfer, but they can appear via random mutations, spread due to positive, or be eliminated via negative selection.
Plasmid conjugation: Plasmid transfer in Aevol may happen only between individuals that share the same 3x3 Moore neighborhood.At every generation, all individuals have a chance to transfer their plasmid.A given, focal organism, is first queried for its donor ability.The probability of transfer to each of the neighboring individuals is equal to the difference between focal individual's donor ability and the chosen neighboring individual's recipient immunity.If the recipient immunity is greater than the plasmid sender's donor ability, the transfer will not happen.When plasmid is transferred, a copy of the plasmid from the donor is made and it replaces the plasmid that is located in the recipient.As with other population level processes in Aevol, all individuals attempt to transfer their plasmids simultaneously.However, as the conjugation algorithm is necessarily executed sequentially, we must avoid giving a higher chance to individuals and plasmids that transfer first then to ones whose plasmids may have already been replaced by the time they try to transfer them.To do so, we randomize the order at which individuals attempt to transfer their plasmid at every generation.Finally, in nature there are examples of retrotransfer, where plasmid recipient also transfers genetic material back to the donor (Sia et al. 1996;Szpirer et al. 1999).Inspired by this, we included a parameter that specifies whether populations evolve with unidirectional (plasmid replacement) or bidirectional (plasmid swap) conjugation mechanism.
In the majority of our experiments, the organisms did not pay any direct cost for expressing the genes for plasmid transfer, the same way they do not pay any explicit cost for expressing metabolic genes.However, in nature, pili and other conjugation-related machinery is not only costly to produce but may also have a detrimental effect as it serves as a target for phage attachment (Smillie et al. 2010), so we added a fitness cost for expression of the donor/recipient genes, proportional to the donor/recipient ability they confer.We should stress that this is not a cost of transfer, as it affects the fitness no matter whether the plasmid transfer successfully happens or not.
Plasmid copy number and loss: For the ease of implementation, data collection and analysis, we assume that all individuals in Aevol have a single plasmid.Examining the effects of plasmid copy number would certainly be interesting, but remains as a potential topic of future studies.Similarly, we chose not to directly model plasmid loss, but individuals still may effectively loose their plasmid by drastically decreasing its size.The smallest gene in Aevol requires at least 48 base-pairs, which includes 22bp-long promoter, 6bp Shine-Dalgarno sequence, 4bp Shine-Dalgarno spacer, start codon, three codons determining the width, height, and mean of the protein triangle, stop codon (all codons are 3bp long), and 11bp reverse-complement terminator sequence.Thus, while technically plasmids cannot be entirely lost in Aevol, the organisms can evolve to not use and effectively eliminate them.
We conclude the description of Aevol and its the genetic algorithm heuristic by recounting the events that occur during a single generation of evolution: (1) organisms' fitness is evaluated, based on their metabolic proteins, (2) organisms that will reproduce are selected based on their fitness, (3) mutations are applied to the new-born organisms, (4) organisms migrate, by exchanging places with a randomly chosen individual, (5) plasmids are transferred between pairs of neighboring individuals, based on their donor ability and recipient immunity, followed by the start of the next generation and return to first event in the cycle.Using this setup throughout our experiments we are able to study the dynamics of plasmid conjugation in Aevol over thousands of generations of evolution.

Experimental design
Given the number of parameters relevant for plasmid transfer that can potentially be varied in Aevol, it is computationally nonpermissive to examine all possible combinations in any type of a factorial experimental design.Instead, we first focus on the interaction of plasmid conjugation and population structure.To do so, we performed experiments in which we set the rate of migration to 0, 100, 300, or 1000.In these experiments, the organisms did not pay any direct cost of expressing the donating or receiving genes.In the second set of experiments, we had no migration, but varied the cost of transfer instead, from 0 to 0.03, 0.1, or 0.3.To evaluate the interaction between the donor and recipient abilities, and potential coevolutionary dynamics, we also ran experiments in which either donor or recipient ability was not allowed to evolve.In particular, we set the extrinsic, constant probability of plasmid donation to 1, 0.3, 0.1, or 0.01 for all individuals, but made any genes on the donor part of the phenotypic axis act as neutral and not have any effect on fitness or donor ability.Alternatively, we set the default probability of transfer to 0 and made recipient genes act as neutral ones, allowing only for the evolution of donor ability.Finally, we conducted experiments in which the plasmid transfer was not unidirectional and instead of the invading plasmid replacing the resident one, the plasmids from the two individuals swapped places.
For each set of parameters we performed 20 replicate experiments by evolving populations of 1024 individuals for 20,000 generations.The replicate populations were started with a randomly generated ancestor containing a single metabolic gene.Each population was associated with a different seed for the random number generator, which governs all stochastic processes during evolution.All populations shared the same phenotypic target function, specified by the arithmetic sum of six Gaussian functions of the form y = H exp( -(x -M) 2 / (2W 2 ), where (H,M,W)={(0.25,0.15, 0.04), (0.35, 0.2, 0.02), (0.35, 0.45, 0.02), (0.25, 0.5, 0.04), (0.35, 0.8, 0.02), (0.25, 0.85, 0.04)}.First pair of functions is located on the metabolism part of the phenotypic axis, while the second and third pairs are on the donating and receiving sections, respectively.The three sections of the axis are equal in length.The mutation rate per base-pair was 2.5x10 -5 for all small and 2.5x10 -6 for all large mutations.Selection pressure constant was a = 0.7; At each generation, we recorded the average values for fitness, genome length, donor ability and recipient immunity in the population.Additionally, we recorded each of these values not only for the entire organism, but also for individual genetic units separately.For example, for an individual we would calculate the donor ability it would have if it contained only the plasmid or only the chromosome.All the statistical analysis was performed using Matlab R2012b.

Plasmids and migration
In the first set of experiments we studied the effect of population structure on the evolution of plasmid transfer.Our expectation was that higher donor ability, and thus higher rate of transfer, would evolve in populations with no migration.Specifically, we though that in the competition between donor ability and recipient immunity genes, the former would be favored in spatially structured populations by clustering together individuals that transfer genes to each other and thus decreasing the probability of negative interaction between imported and resident genes.The data in part did not supports Figure 1.Effect of population structure on donor ability and recipient immunity of plasmid transfer.Each line is an average value for (a) donor ability and (b) recipient immunity across 20 replicate populations that evolved for 20,000 generations with the same set of parameters, but a different random number seed.Different colors represent different migration rates (the number of organisms pairs that get swapped at each generation, 0, 100, 300, or 1000).The shaded area around the lines represents one standard error of the mean.The no migration treatment (dark blue) was used in all future sets of experiments as the baseline.our intuition (Figure 1): the average donor ability was not statistically different between the treatments at the end of the experiments (two-sample t-test, p > 0.2 for all pairwise comparisons between treatments), and in all but one case, neither was the recipient immunity (two-sample t-test, p > 0.05 except for the comparison between mig = 0 and mig = 300, where p = 0.047).However, the average probability of transfer did generally increase with higher migration (mean value of 0.144, 0.191, 0.243, 0.220 for mig = 0, 100, 300, 1000, respectively).Overall, in spite of much variation between the replicate experiments, we do find a trend for migration positively affecting the probability of plasmid transfer (all pairwise comparisons are significant, two-sample t-test, with at least p < 0.03).Additionally, these differences did not come solely from the change in donor ability or recipient immunity, but the interaction between the two.As transfer happens within a generation and organisms' migration happens between generations in Aevol, we cannot account for physical processes that could impede conjugation, such as pili breakage or detachment.Instead, our work suggests transfer is more favored when it can also result in the transferred genes spreading further and faster due to organism migration.These and other selection forces that may increase conjugation in well-mixed populations should be investigated in greater detail.

Cost of transfer
We continued to quantify the properties of in silico transfer by varying the cost of expressing the genes that are involved in moderating the transfer rate.For each transfer-related gene the fitness of a digital individual would decrease proportionally to the product of cost and the increase of the donor ability or recipient immunity.Our expectations were clear: at higher costs of expressing donor genes, less plasmid transfer would evolve.Data supports our hypothesis (Figure 2) and we find  that most transfer evolves when cost was zero (p < 0.001 for comparison with all other treatments), while low levels of transfer evolve at cost 0.03, and effectively no transfer at higher costs.While orders of magnitude less than the rates of transfer in nature, given our relatively small population sizes, the evolved number of transfers per generation is comparable to natural populations.We should note that even when explicit cost of transfer genes was zero, genes that do not increase fitness are quickly lost in Aevol, both due to drift and because they may interfere with other genes though large mutations (Knibbe et al. 2007).Given our results and the wide spread of transferable plasmids in nature, we could speculate that their cost of expression may not be greatly different than one incurred by any other genes.Alternatively, such cost could be offset by some direct and strong benefit that plasmids would confer, such as the frequently observed antibiotic resistance (Svara and Rankin 2011).

Genetic architecture of transfer
We continue the analysis of the baseline runs, with no migration or transfer cost, by examining the location of the metabolic and transfer genes.In nature, the molecular machinery for plasmid conjugation is located on the plasmid itself (Zatyka and Thomas 1998), but individuals could also control plasmid transfer via genes located on the chromosome.We expect that if plasmids confer a cost on their hosts, genes for recipient immunity would be selected for, and located on the main chromosome.In our baseline runs (where individuals evolved without any migration or transfer cost), we observe that the plasmid is the dominant genetic unit of the individual: not only are transfer genes located on the plasmid (Figure 3c,  3d), but it is on average larger than the chromosome (Figure 3b) and caries the majority of metabolic genes (Figure 3a).All the differences are statistically significant, as determined by two-sample t-test, with p < 0.01.We conclude that plasmids in Aevol behave largely like selfish genetic elements, controlling and increasing their own spread, but also taking on other aspects of the organisms' phenotype.Rather than the chromosome being the one who is trying to exclude invading and potentially detrimental plasmids, it is the plasmid that is defending itself from being replaced.However, contrary to intuition of classical plasmid biology, our plasmids evolve to be larger than chromosome and also carry the majority of metabolic genes.Rather than being strictly selfish in their evolution and propagation, they also carry metabolic, directly beneficial genes that may transfer to future hosts.Still, the benefit is at best mutual, since by increasing the host organism's fitness the plasmid also effectively increases its vertical transmission rate and thus the probability of being transmitted into the next generation.However, while all experimental populations evolved to comparable fitness levels they have done so by following different trajectories in terms of the gene distribution between the chromosome and the plasmid.In Figure 4, we show some or the possible outcomes from 4 different populations, in which the metabolic genes are solely the plasmid (Figure 4a), on the chromosome (Figure 4b), are shared between the two during most of evolution (Figure 4c) or are constantly jumping between the genetic units (Figure 4d).In multiple panels of the Figure 4 it is obvious that the fitness measured for the plasmid and for the chromosome do not add up to the fitness of the individual.For example, between the generations 1,000 and 4,000 the average fitness of individuals in Figure 4b is much less than what would be expected based on the plasmid and chromosome fitness.Similar antagonistic or synergistic interactions are frequently observed and create an additional channel of interaction between the genetic units.The mechanistic explanation is a straightforward one, with obvious biological parallels.For example, both plasmid and the chromosome may express a gene that confers 0.4 level to a selected trait, raising their fitness when considered alone.However, if the optimal level of the trait is 0.6, the individual with both this chromosome and plasmid will overexpress this gene and may have lower fitness than expected from the contributions of its genetic units.Such interactions between the plasmid and chromosome are also a striking example of the benefits that come from models like Aevol, as they could Figure 5. Examples of the distribution of the transfer genes across genetic units.We consider four replicate base experiments (no migration, no cost) over 20,000 generations of evolution (a-d).Different colors represent the average donor ability (blue) and recipient immunity (red) in the population.These examples are representative of the overall pattern of transfer rate evolution in the runs where both donor ability and recipient immunity evolved.Additionally, there were two experiments in which neither donor ability nor recipient immunity evolved (above an ad hoc threshold of 0.1 during at least 1,000 generations), as well as three in which donor ability evolved but recipient immunity never did.not be observed in the classical, analytical models, and even here, they were not something we necessarily expected to see.

Donor ability and recipient immunity coevolution
In order to examine the dynamics of plasmid transfer evolution, we examine the data from individual experiments, specifically the average plasmid donor ability and recipient immunity over the full course of the experiments.In Figure 5 we show four runs that are representative of the transfer rate evolution in our experiments and note two major trends: (1) Recipient immunity evolves only after donor ability.This can be interpreted as an example of the apparent shortsidedness of evolution.Although immunity to invading plasmids is generally beneficial in the long run, without immediate benefit, any immunity genes are lost to drift.
(2) A decrease or loss of donor ability is soon followed by the loss of recipient immunity.As in the previous case, the recipient immunity without donor ability confers no benefit for the organism and is thus quickly lost by drift alone.
We suspect that in situations where recipient immunity is maintained at levels higher than donor ability, such as around generation 7000 in Figure 5a, the genetic architecture constraints relevant genes in a way that makes it difficult to decrease their expression levels without either a decrease in fitness or a complete loss of immunity.To further assess the co-evolution of donor ability and recipient immunity we conducted two sets of experiments in which one of these traits was not allowed to evolve.When individuals had no possibility to modulate the recipient immunity (Figure 6a and 6c), the donor ability evolved to somewhat elevated, but not significantly higher levels.However, the average probability of transferring the plasmid (calculated just as the difference between the corresponding curves in Figure 6a and 6c) does differ between the two treatments by more than 60% and is significant (two-sided ttest, p < 0.001).This indicated there is no optimal level of transfer ability that evolves, at least in the time frame of our study.Instead, the amount of plasmid transfer depends on the environment in which the plasmids are evolving in, and in this case, the ability of individuals to fight off unwanted plasmids.
Finally, we examined the evolution of recipient rate when the individuals cannot evolve their donor ability.In this case, setting the donor ability to zero would not provide any new or interesting outcomes, as all our previous results point to recipient immunity not increasing in the absence of donor ability.Instead, we set the external, unchanging donor ability and let the recipient ability evolve in response (Figure 6b and  6d).We found that recipient immunity does evolve at intermediate levels of base donor ability (0.1, 0.3), but not the extreme ones (1, 0.01).In neither case did the recipient immunity evolve to the levels as high as when donor ability also evolved freely (two-sample t-test, p < 0.01).Although the range of constant, pre-set donor ability values was comparable to the ones that evolved freely, the recipient ability just could not compensate and "catch up".We take this as another strong indication that the evolutionary fate of transfer rate is shaped by the interactions between donor ability and recipient immunity -only when immunity could co-evolve with donor ability, following it at a relatively short distance, it rose to higher values.A closer examination of the order in which mutations arose and spread, across a number of replicate populations, could provide the definite description of this coevolution, but at this time, remains extremely computationally demanding and outside of the scope of this study.

Plasmid replacement and swapping
Bacterial conjugation is a form of sex, but compared to recombination, it is clearly one-sided and asymmetric: the flow of genetic information is unidirectional as there is a donor and a recipient of the plasmid.Motivated by plasmid retrotransfer, an exception to this rule, we modified the mechanism of conjugation in Aevol to swap two plasmids, rather than replace one with the copy of the other during every transfer event.We measured average donor ability (mean = 1.9x10 -5 , standard error of the mean = 7.0x10 -6 ) and recipient immunity (mean = 4.1x10 -5 , standard error of the mean = 1.7x10 -6 ) in the 20 replicate runs with swapping plasmid.Although both were significantly different than zero statistically (p = 0.015 for donor ability, p = 0.027 for recipient immunity, one-sample t-test) given the extremely low values, we do not consider them to be significant biologically but just a product of mutation-selection balance.We did hope to observe some digital sex, but given our previous results, these outcomes are not surprising.By swapping plasmids, we stopped them from being infectious, as the frequency of a plasmid could not increase purely via horizontal transfer.Instead, the plasmid transfer-related processes were now closer to sex and recombination and thus subject to similar short-term costs and only long-term benefits.In absence of parasite-driven Red Queen dynamics (Lively et al. 1990), changing environment (Misevic et al. 2010), or one of the other scenarios beneficial for sexual reproduction (West et al. 1999) the organisms are likely to remain asexual, consistent with our results.

Conclusions
Plasmids represent an important feature of microbial biology, have been extensively studied and used as an important tool in genetics, molecular and synthetic biology.However, many questions remain open, especially relating to plasmid evolution, interactions between the host and the plasmid, genetic architecture, and control over plasmid transfer.Here we presented an implementation of in silico transferable elements for the evolution platform Aevol.We demonstrate the strength of the approach by tackling classical research question of plasmid cost, but also investigate the evolutionary dynamics of metabolism and transfer genes in a way that would be extremely difficult to do in a natural system.We find signatures of coevolution between donor ability and recipient immunity, which evolve to be primarily, but not exclusively, encoded on the plasmid.Although plasmids seem to behave like selfish genetic elements, they at times also carry metabolic genes and may thus be directly beneficial to future hosts.Finally, during relatively long stretches of evolutionary time, the genes on the chromosome and the plasmid interacted epistatically, highlighting another way these genetic elements may affect each other's evolution.Throughout the study, the general trends were apparent, but were also accompanied by much stochastic variation and great diversity in the evolutionary trajectories.Future studies with Aevol will enable close analysis of individual-based effects as well as interactions between plasmid conjugation and other high-impact evolutionary events such as the evolution of cooperation or the evolution of multicellularity.

Figure 2 .
Figure 2. Effect of cost on donor ability and recipient immunity of plasmid transfer.Each line is an average value for (a) donor ability and (b) recipient immunity across 20replicate populations that evolved for 20,000 generations with the same set of parameters.Different colors represent costs of expressing donor ability or recipient immunity genes (0, 0.03, 0.1, or 0.3).The shaded area around the lines represents one standard error of the mean.The data for the baseline populations (dark blue lines, no cost) are the same as the ones used in the Figure1(no migration, dark blue line).

Figure 3 .
Figure 3. Genetic architecture of transfer.Four basic population properties, (a) fitness, (b) genome size, (c) donor ability, and (d) recipient immunity are averaged across 20 replicate populations that evolved for 20,000 generations with the same set of parameters.Different colors represent the property values obtained when considering just the chromosome (green), just the plasmid (red), or the entire organism (blue).The shaded area around the lines represents one standard error of the mean.The data for the baseline population (dark blue lines) are the same as the ones used in the baseline runs (no cost, no migration) in the previous figures.

Figure 4 .
Figure 4. Examples of the distribution of the fitness genes across genetic units.We consider four replicate base experiments (no migration, no cost) over 20,000 generations of evolution (a-d).Different colors represent the average fitness measurements obtained when considering just the chromosome (green), just the plasmid (red), or the entire individual (blue).

Figure 6 .
Figure 6.Evolution of transfer with fixed donor ability or recipient immunity.(a, c) Comparison of the experiments with freely evolving recipient ability (dark blue line) and ones where the extrinsic recipient immunity was set to zero (green line).(b, d) Comparison of the experiments with freely evolving donor ability (dark blue line) and ones where the extrinsic donor ability was set to a fixed value of 1, 0.3, 0.1 or 0.01.Color legend in panel (a) is relevant for both (a) and (c), and the one in panel (b) for both (b) and (d).The lines are mean values for 20 replicate experiments within each treatment and the shaded area represents one standard error of the mean.The data for evolving donor ability and recipient immunity experiments (dark blue liness) are from the baseline runs, as in the previous figures.