Modelling plasmid persistence in polymicrobial communities, assuming fixed (a, c) or variable (b, d) plasmid fitness effects. a, b Relative fitness histogram obtained by randomly sampling 104 parameter values from the parameter distribution shown in the inset plot (points illustrate the expected values of each distribution and ellipses their standard deviation; green, plasmid-bearing bacteria; orange, plasmid-free bacteria). The green ellipse in b is larger as a consequence of considering that the cost of plasmid-bearing is normally distributed with variance (σ2 = 0.007). As a result, the distribution of plasmid fitness effects also has higher variance, with a considerable fraction of plasmid–host associations producing a benefit to the host. Dotted red lines indicate mean relative fitness of plasmid carrying cells. c, d Colour gradient represents the percentage of cells carrying plasmids at the end of 5000 stochastic simulations; orange indicates a population without plasmids and green a community composed of plasmid-carrying cells. If plasmid-bearing is associated with a fixed fitness cost for all members of the community, plasmid maintenance requires a high conjugation rate. The increased proportion of plasmid-bearing cells in d indicates that a distribution of plasmid fitness effects with high variance reduces the critical conjugation rate needed to maintain plasmids in the population, enabling plasmids to persist at low conjugation rates. e Mean fraction of plasmid-bearing cells as a function of the number of strains in the community with a conjugation rate γ = 1.5 × 10−11. If the plasmid always produces a reduction in host fitness (mean w < 1 and low variance), plasmid frequency decreases as the number of strains in the community increases (green line). In contrast, for higher variance at the same mean w, the fraction of plasmid-bearing cells increases with community complexity (orange line).