Evolution, Biodiversity and Ecology in Microbial Communities: Mathematical Modeling and Simulation with the “Haploid Evolutionary Constructor” Software Tool

Life on Earth exists in the form of interacting communities of two types: populations and ecosystems. Populations maintain reproduction and Darwinian selection. Substance and energy exchange both with the environment and between populations is one of the major functions of ecosystems, which, as a result, enables the necessary conditions for organism reproduction [1–3]. Consequently, it is reasonable to consider any evolutionary process both in terms of population and in terms of ecosystems. Therefore, the evolutionary success of any given genotype carrier is related not only to fixation in population, but also the influence of such a population on functioning of the ecosystem. It is impossible to understand patterns of certain species’ evolution without considering the trophic structure of the ecosystem, as a part of which they exist. An ecosystem enables the sparing use of environmental resources by setting up various linear or branched trophic chains [4]. When several linear chains or their branches integrate, a trophic cycle can arise, which enables reproduction of one or another resource [5–7]. On the other hand, an unusable resource – a metabolic cul-de-sac – can arise in ecosystems, which is buried or removed by the flow [8–10].


Introduction
Life on Earth exists in the form of interacting communities of two types: populations and ecosystems. Populations maintain reproduction and Darwinian selection. Substance and energy exchange both with the environment and between populations is one of the major functions of ecosystems, which, as a result, enables the necessary conditions for organism reproduction [1][2][3]. Consequently, it is reasonable to consider any evolutionary process both in terms of population and in terms of ecosystems. Therefore, the evolutionary success of any given genotype carrier is related not only to fixation in population, but also the influence of such a population on functioning of the ecosystem. It is impossible to understand patterns of certain species' evolution without considering the trophic structure of the ecosystem, as a part of which they exist. An ecosystem enables the sparing use of environmental resources by setting up various linear or branched trophic chains [4]. When several linear chains or their branches integrate, a trophic cycle can arise, which enables reproduction of one or another resource [5][6][7]. On the other hand, an unusable resource -a metabolic cul-de-sac -can arise in ecosystems, which is buried or removed by the flow [8][9][10].
Symbiotic relationships are widespread in ecosystems, and especially specific to prokaryotic communities. These communities often have taxonomical diversity and are characterized by a complicated trophic chain with a certain extent of closeness. Specific traits of prokaryotes, such as a pinotrophy diet, small cell size and low speed, lead to an organism's inability to escape from the surrounding environment quickly, and to the "biogenic desert" problem [11], when organisms that inhabit the center of a high-density population have to go hungry due to lack of nutrients. Therefore, the characteristic feature of prokaryotic ecosystems is metabolism integration -from the close association of single organisms of different species [12] to spatially-structured, trophically highly-closed ecosystems of meromictic [13] and soda lakes [14], and, after all, global biogeochemical cycles of the biosphere [15]. The large majority of prokaryotes in nature exist as a part of communities with a complicated structure -bacterial mats or biofilms, whose common metabolite pool often forms a complete cycle [15,16]. The presence of such cycles optimizes community members' metabolism. Trophic rings, within which metabolic products of one species or strain are used or can in certain conditions be used for food by others, are revealed in bacterial biofilms and in complex metabolic graphs, reconstructed on the basis of metagenomic projects [17,18].
Close bacterial association in biofilms enhances the probability of horizontal gene transfer between different bacteria, which enable them to obtain new features [19][20][21]. The importance of the horizontal transfer is supported by recently discovered natural vectors for cloning exogenes in prokaryotic genomes -integrons and superitegrons [22,23]. Therefore, most prokaryotes exist as a part of communities. A wide variety of prokaryotes are unable to grow in pure culture (uncultured prokaryotes) confirms this [24]. The evolution of such highly-integrated communities has its qualitative specific factors and cannot be reduced to the evolution of distinct populations composing them. Thus, while the reproduction rate of prokaryotes is exceptionally high, an experimental study of prokaryotic evolution is difficult, as it requires the study of the whole prokaryotic community. Accordingly, the mathematical modeling of evolutionary processes, adjusted for different types of trophic interactions, spatial distribution of organisms, genetic structure of populations, speciation, different reproduction schemes, environmental influence and other factors, is one of the main methods for the study of the evolutionary process. The modeling of evolution is one of the primary challenges of 21 st century biology, mathematics and computer science.
Traditional approaches to evolutionary and population process modeling include methods of population dynamics [25,26] and methods of population genetics [27,28]. Population dynamics modeling methods describe population size changes through time subject to environmental conditions, trophic interactions between populations and other features, but as a rule, population genetic structure changes cannot be studied using these methods. As to population genetics methods, they are generally based on methods of the probability theory and mathematical statistics [29][30][31]. They allow for studying the evolution of population genetic structure, but do not provide means for the modeling of the population dynamics process in detail.
Further development of modeling and simulation methods led to so-called "hybrid" methods [32,33], which allow us to investigate changes both in the size and genetic structure of a population simultaneously. However, it should be noted that the large majority of these methods (like the other population genetics methods) are focused on diploid organism population modeling (generally, with sexual reproduction).
Methods of "portrait" (individual-oriented, agent-based) modeling [34][35][36] bridge the gap between individual characteristics and community structure, evolving as a consequence of some or other rules of interactions between individuals. These approaches are illustrative enough, but may have a high computational complexity (ideally, they require a detailed description of every individual in the population). Besides, most of them are static, i.e. during calculations their structure can be changed only within the limits predetermined by the developer. As a result, if modern computer capacity is sufficient for modeling of a population of diploid organisms with sexual reproduction (whereas the effective size of such populations is generally no more than 100-1000 individuals), then direct simulation modeling is often problematic for the modeling of a population of haploid organisms, particularly bacteria (the effective size of bacterial populations is 10 6 -10 9 individuals).
With due consideration to the abovementioned requirements of the evolutionary and population process modeling tool, we previously developed a modeling method and software package "Haploid evolutionary constructor" (HEC) [37,38]. The HEC provides tools to simulate the functioning of a haploid organism population network, trophically linked with substrate-product relationships under the environmental effect. This modeling approach provides a means of simultaneously describing the prokaryotic community at various levels of its biological organization: genetic, metabolic, population and ecological, flexibly varying the degree of description detail at any level. During the model simulation, each population may vary both its size and genetic diversity due to selection and mutations. The key feature of this methodology is the ability to model such evolutionary and population processes that require an intense structure rearrangement of a model during simulation. Such processes contain, for example, horizontal genetic transfer and speciation. Besides, the methodology offers the possibility to describe the polymorphism of one or several genes in a population, where the number of alleles can be changed during the simulation process.
In summary, the HEC provides comprehensive study of the bacterial community model, analyzing the dynamics of changes in allelic frequency, the population size, the concentration of metabolites, the community trophic structure and its evolution, including stochastic genetic factors.
During model simulation via the HEC, the number of populations reached 300, with an approximate total 10 20 individuals, the size of distinct population came to 10 18 , with around 10 6 -10 7 different genotypes (up to 4000-15000 different genotypes within one population in case of multiple polymorphism of 10-15 genes).

Haploid Evolutionary Constructor methodology description
The HEC methodology provides modeling and simulation of biological and evolutionary processes in trophically linked communities of unicellular haploid organisms. Figure 1 shows the scheme of the main HEC objects and processes. The HEC simulates trophic interconnected haploid organism networks that are combined into populations according to genetic proximity and reside in one whole volume termed environment. Organisms may consume and utilize substrates and synthesize, and then secrete products into the environment, which inversely can be used by other organisms as substrates. Some substrates favorably affect population growth, others, on the contrary, may have an inhibiting effect. The efficiencies (as rate constants) of substrate utilization and product production are controlled by certain genes.
So-called nonspecific substrates are reproduced by the in-flow ( Figure 1 shows scheme with one nonspecific substrate N 1 ). By contrast substrates running into the environment only through cell activity (synthesis and secretion) are known as specific (represented by S i in Figure 1).

Environment
Environment is a bounded flow system of fixed volume V total , containing all populations and substrates. The environment is also a mediator of relationships between populations (and substrates); the inflowing and outflowing processes of both substrates and cells are connected with it. The environment is characterized by following variables: • V total -environment capacity (in liters); the specific substrates outflow follows the formula below (specific substrates flow into the environment associated with these substrates through cell synthesis as described below):

Population modeling
We consider populations to be a set of cells, that have common substrate using and producing properties. Cells are considered to belong to the same population (same species) if they: 1. utilize the same variety of nonspecific and specific substrates; 2. produce the same variety of specific products; 3. have the same trophic strategy; 4. have the same synthesis strategy.
We define basic terms and notions, used hereinafter as follows: • trait -any given substrate synthesis or utilization rate constant. Every trait is considered as unambiguously controlled by one gene. In this particular case, the gene is considered a unit of inheritance; • allele -a gene variant, i.e. a particular value of the corresponding constant; • individual's genotype is the set of alleles, divided into five groups. The first group (c i ) characterizes the efficiency of specific substrate utilization (s i ), the second group (d i )substrate production rate, the third group (r i ) -efficiency of nonspecific substrate utilization, the fourth group (m i ) -efficiency of immunity against phages, and the fifth group (v i ) -phage (viruses) genes; • mutation is a change of a corresponding trait value, which can be interpreted as a gene shifting into another state (allele).
Using the introduced terminology, the concept of a monomorphic population can be formed -a population of "genetically identical" cells, where all cells have corresponding genes represented by the same alleles. The genotype, common for all the cells of such population, is called the monomorphic population genotype.
In order for cells to use substrates for their reproduction and population size growth along with products synthesis, at first they have to get these substrates from environment. In the HEC, the process of substrate consumption is described by the particular step, where a cell's requirement of various substrates and the availability of substrates in the environment are taken into consideration. In case of any substrate deficiency, a competition for this substrate may occur either intrapopulation or interpopulation (when cells of several populations may use the same substrate at the same time). In case of substrate excess, the maximum amount of the substrate consumed by one cell is defined by the value of the substrate consumption rate. This value is species-specific and cannot be changed due to mutation (in this HEC version) -this may be equivalent to, for example, the size limit for one cell. Hence, monomorphic population is additionally characterized by the amount of substrate molecules consumed.
Trophic strategies is a term for the formulas and laws, describing population changes in a single generation depending on population size, the amount of consumed substrates, the flow rate, mortality rate and other factors. Examples of trophic strategies are illustrated by the equations below (other formulas may be also used, including those defined by the user): where I consumed -set of indices of substrates consumed; k flow -flow rate in the environment ("washout" rate); k death -population mortality rate; a basal -"natural increase" of the population; γ, γ 0 , γ i -coefficients, describing the nonlinear nature of substrate influence on population growth; K ij -coefficients, describing the efficiency of substrate influence on population growth (depends on corresponding traits).
The equation [eq.3] governs the utilization process of several specific and one nonspecific substrate, where the latter is essential for cells -when it is not available, the population does not grow. Substrates have strong cooperativity. Besides, some substrates are able to compensate in some degree the lack of other necessary substrates, including a nonspecific substrate deficiency. The trophic strategy described in [eq.3], satisfies the Rubel's law of replaceability of ecological factors [39], and is called the compensatory trophic strategy.
The equation [eq.4] again governs the utilization process of several specific and one nonspecific substrate. Nevertheless, every substrate is essential. A deficiency of one substrate cannot be compensated by an excess others. The trophic strategy described by [eq.4] satisfies the ecological Liebig's law of the minimum [4] and called the noncompensatory trophic strategy.
The equation [eq.5] governs the utilization process of one nonspecific substrate coupled with the inhibiting effect of specific substrates on population growth. Besides, this effect is cooperative. This trophic strategy is called the inhibitory trophic strategy.
Similar to the concept of a monomorphic population, we define the concept of polymorphic population, which can be regarded as a set of monomorphic subpopulations. Cells in a polymorphic population have the same gene variety, while different cells can have different alleles of one or several genes. The polymorphic population is characterized by the "generalized genome" -a set of population's genetic spectra. The genetic spectrum is the distribution of allele occurrence frequencies in a population (for one gene) ( Figure 2).
Mutation in terms of a genetic spectrum means the change of its profile (thus, the formation of a new allele is possible, Figure 3).
The change of the polymorphic population size is calculated according to the following scheme. The polymorphic population is split into many monomorphic subpopulations. Then, the growth for each subpopulation is calculated according to formulas similar to the abovementioned (eq.3-5). Next, the monomorphic populations are merged into a polymorphic population. The polymorphic population is split based on the proportion of every allele for all genes in the population genotype. The substrates consumed by the polymorphic population are divided proportional to the sizes of the single monomorphic populations. It noteworthy, that each single monomorphic population growth may differ markedly from the growth of other subpopulations. It depends on the monomorphic population genotype, population size and the amount of certain substrates consumed by the population. Consequently, the proportion of alleles in a population may change (which may be interpreted as the adaptation of the population to certain conditions).

Metabolism
When a cell synthesizes a product, that it can utilize itself, it is obvious that there is "no use" in secreting this product into the environment and then competing for it on "equal terms" with   Product synthesis by the cells of a polymorphic population is described by the gene network model of metabolite synthesis, which we call the synthesis strategy ( Figure 5).
An example of a formula describing a simple synthesis strategy: where Δs i -amount of synthesized i-type substrate; Assign initial substrate concentrations

Infection process modeling
To model a phage infection, the HEC provides extended objects of polymorphic populations: polymorphic phage populations and the polymorphic population of infected cells (the "normal" polymorphic populations are therefore regarded as "healthy").
The infection modeling includes the following phases: infection of the healthy cells through phage penetration from the environment into one part of the cell population, phage reproduction inside of the infected cells, and finally, the phages burst into the environment after the lysis of cells. The infected cells form polymorphic populations, further reproduction of which may follow a lytic or a lysogenic pathway. The lytic pathway means death (lysis) of the infected cells with synchronous phage formation and their transportation into the environment (the number of phages depends on their profusion). The lysogenic pathway means prophage formation and no phage transportation into the environment follows. At the same time the population of the infected cells reproduces like an ordinary polymorphic population in the HEC (i.e. according to the trophic strategy), acquiring immunity to that type of phage ( Figure 6). For each population P infected : calculate a fraction of cells realizing lytic/ lysogenic strategy as a function of cells' "fullness" by substrates The choice of the lysogenic or the lytic scenario depends on the conditions of the cell population at the moment of infection: optimum conditions lead to a lytic type, pessimal conditions-to a lysogenic. In the latter case, a part of the population randomly switches to the lytic form if conditions improve, causing the death of this part and phage generation (Figure 7).
The polymorphism of phages, the formation of new strains owing to mutations and competition between strains are also described via the genetic spectra arithmetics. However, in the phage populations unlike prokaryotic populations, genes define a specific virulence (an ability to infect certain populations) and abundance (the number of copies per lysed cell).

Simulation of prokaryotic communities via the Haploid Evolutionary Constructor
Through the use of the HEC software tool, we have simulated a number of biological models of the functioning and evolution of unicellular haploid organism communities [37]. Inter alia, the correspondence of the modeling results to biological data as well as previously published mathematical models has been illustrated. We estimated the key parameters of the model, regarding cell size, number of substrates required for cell division and other factors based on E.coli cell information [40].
To verify the modeling approach, a number of basic models were considered, and the obtained results confirmed correspondence to both classical models and experimental information [38]. Thus, the models examined proved the biological adequacy of the HEC and its applicability for a wide range of population, genetic and ecological problems.

Modeling of biodiversity dynamics and adaptability in bacterial communities
The evolutionary success of a biological system relates to the balance of two characteristics: its stability (ability to preserve its structure and homeostasis despite changes in the environment) and its adaptability -ability to preserve an evolutionary flexibility in response to uncontrolled environmental changes. Traditionally, communities that are more complex are considered to be more stable, but there can be exceptions. The study of model dynamics, when the population size growth of one species depends on the population size of others species in the community, confirms that increased complexity leads to the improvement of stability only when community connectivity increases at the same time.
We maintained a comparative simulation of stability dynamics, the adaptability and biodiversity of trophic closed communities with compensatory and non-compensatory metabolism (according to Rubel and Liebig respectively). The trophic strategies formulas representing these laws [eq.3,4] are mentioned in the HEC models description. The deficiency or low concentration of a nonspecific substrate in the environment leads to population extinction for both strategies. However, in case of compensatory nutrition strategy, the deficiency (a low concentration, but not a complete lack) of a nonspecific substrate in the environment can partly be compensated by the high concentration of specific substrates. This satisfies Rubel's law of Infestation Cells are in pessimal conditions

Cells are in optimal conditions
Infected population Lysogenic cycle: Phage genes are appended to population genome (genetic spectra vector), which leads to a prophage origin.
Further lifecycle of infected population is the same with ordinary polymorphic population.
Infected population Lytic cycle: Part of cells perish (up to 100%), with phages raising.
Number of phages raised after lysis depends on virulence, which in its turn, is defined by alleles of phage genes.
Later, If environmental conditions become more optimal, partial transition of a population in lytic form is possible It is known that the change of conditions on Earth shows a certain cyclism. Its sources are geophysical and astronomical cyclic processes [41,42]. As a result, the input of matter and energy into the ecosystem tends to change. To keep the common value of this flow constant, the ecosystem must conduct an evolutionary search for new sources of matter and energy [6,43]. Hence, the "learning ability" of the ecosystem becomes a critical parameter. The horizontal gene transfer (HGT) in prokaryotic populations is a relatively easy way to carry out such "learning". The simulation showed that the trophic structure of a community imposes substantive restrictions on the benefits of the HGT -a long-term effect is possible only in case of HGT between populations, whose metabolisms are sufficiently rich and flexibly adjustable (compensatory trophism). For populations with simplified metabolisms (non-compensatory trophism), the HGT offers only localized advantages. This contradicts the assumption that the major trend of prokaryotes evolution is individual genome simplification, compensated by relationship amplification in the bacterial community. Such simplification in the long term leads to the death of the community.
The simulation showed dramatically better adaptivity of trophic rings with compensatory (ТRC) trophism in comparison with non-compensatory ones. The fixation of beneficial mutations even in one TRC population improved stability of the entire system, significantly extending its lifetime, i.e. offering an additional chance to wait out the starvation, or even completely saved the ТRS from extinction due to the metabolism optimization. Nevertheless, many taxa in the world are unable to compensate one resource with another on a broad scale. Why is the major trend of the evolution on Earth increasing biodiversity by means of progressive specialization, rather than the formation of biota based on several taxa-generalists? Let us assume that "learning ability" is a critical parameter for evolution within an ecosystem. Subsequently, in case of a low biodiversity level in an ecosystem with compensatory trophism, it is entirely possible that new sources of energy and matter will never be found. In fact, the probability of finding such sources is higher in ecosystems that preserve a high level of biodiversity until extinction. Then, if the value of the initial nutrient flow is recovered, a new source will be added, providing the ecosystem with resources for further progressive evolution. Therefore, in the long term Liebig's systems have an advantage over Rubel's. It should be noted that this advantage has, as with all evolutionary processes, a nondeterministic, stochastic nature, while the stability of the advantage is determined. Thus, when biodiversity is high, the system may die out for stochastic reasons. This matches paleontological information. A permanent rotation of hegemonic biotas, without sacrificing comparably small amounts of epibiotic ecosystems, accumulating virtually the entire range of biochemical activities (cyanobacterium tufts, alkalophilic communities), is observed in the fossil records.

Evolutionary trends of genome sophistication and simplification
One of the most important periods in the evolution of life on Earth is eukaryotic cell formation [44]. The comparative study involving genome-wide information for bacteria, archaea and eukaryotes suggest that the microbial eukaryotic domains could not be inherited from the ancestors of mitochondria and plastids, but were borrowed from other bacteria [45]. In such a case, the origin of eukaryotes is a consequence of the autonomism of one member of the complex synotrophic prokaryotic community through the looping back of major regulatory interactions. It is considered that such autonomism is the result of symbiosis of several types of prokaryotes, and it is fairly probable that the entire series of HGT between symbionts took place.

Genome amplification
By applying the HEC, we investigated the evolution of a community, which at the beginning of computations constituted a trophic ring, in which each of the three populations consumed and produced precisely one specific substrate. For example, the first population produced the substrate consumed by the second, and the second produced the substrate consumed by the third population, etc. (Figure 8).  During calculations with a certain probability between cells of different populations (10 -7 per generation per cell), HGT could take place. As a result, new populations, either consuming a larger number of specific substrates or producing a larger number of specific products would be formed. It was found, that in the longer term (after 10000-15000 generations), the population with the "most complete genome" (i.e. populations consuming and producing the maximum possible number of specific substrates in the given trophic system), or the population with an "almost complete genome" gain an extreme biomass advantage at the specified conditions. Namely, at modetare genome-length-penalty level values (0.01-0.05), and with stable poor environmental conditions (nonspecific substrate concentration in the inflow is around 10 -4 mM, i.e. at the survival minimum for parent population cells) ( Table 1). In the long-term, such populations replaced all other populations from the trophic system ("outsider" populations either died or reached a maximum number in the environment that hovered around 10-100 individuals) (Figure 9).

Genome simplification
We have also simulated the processes of gene loss due to a higher genome-length penalty (0.1-0.25) for the environment in which a single metabolically complete population is presented ab initio (the genetic analogue of P30 from Table 1). During the iteration process, both gene loss and HGT compensating deletions could occur. It was demonstrated, that a strong genome reproduction tendency is observed in both suitable and unsuitable environmental conditions. The most primitive populations, possessing just two utilization genes (one for nonspecific and the other for specific substrates), replaced other populations.
Therefore, the selective advantage of the "metabolically rich" populations emerged under pessimal conditions and was a combination of autonomism (lower dependence on specific substrate concentration in the environment) and egoism (cells of an autonomous population on average secrete less specific substrates into the environment and consume them independently). The selection supports autonomizing populations, however their formation causes the degradation of the trophic ring into an alliance of autonomous populations, accompanied by a "trail" of small nonautonomous populations. The simulation showed that HGT, in case of poor environmental conditions, actually transforms the collective metabolism of a trophic ring to the metabolism of separate populations, which in general conforms the scenario [46] of eukaryotes formation in symbiogenesis.
However, if conditions are optimal, cells reduced their genome successfully, as well as reducing the time necessary for the reproduction. This fact was observed during the experiment repeatedly [47,48].

Evolutionary trends in prokaryotic communities influenced by phages
To study phage infection influence on possible evolutionary tendencies, models of prokaryotic community infection were constructed. The model from 2.2 (a trophic ring consisting of three populations) was used as a basic model. The horizontal transfer and gene loss processes were stochastically generated during simulations. The addition of a phage population to the community led to an infestation of all populations, while the proportion of infected cells depended on the phage concentration in the environment. The infection fundamentally changed the dynamics of the community, inhibiting the growth or even destroying fast growing populations (following the infection of a lytic pathway), and as a result supported less competitive populations in such conditions. For example, a series of numerical experiments showed that, in pessimal conditions, environments can displace the populations that are far from having a metabolically complete genome ( Figure 10). This presents a contrast to the tendency of genome amplification in such conditions as noted above (ref.

2.2).
Possible changes in evolutionary tendencies in case of a phage infection have also been discovered for communities in optimal environmental conditions. Figure 11 shows the survival of a population with a metabolically complete genome -the worst adapted population in the community before the moment of infection. The periodic nature of both prokaryotic and phage population size curves is explained by spontaneous transition of a part of cells to a lytic form, followed by death or the forming of new phages due to lysis.
It should be noted that the given results of numerical simulations are stochastic in nature. In a number of numeric experiments, infection led to death of the entire community, or the community died before the infection due to the fast growth of unduly primitive populations. Changes in evolutionary tendencies do not always take place either. Consequently, our results show that phage infection of a community can, but does not necessarily, change its evolutionary tendency.

Simulation of prokaryotic communities implementing synthesis strategy according to the molecular triggers principle
The model of genetic regulation of protein biosynthesis (Figure 12), suggested by F.Jacob and J. Monod [49], and mathematically studied by D.S. Chernavsky and his colleagues [50], is of a trigger nature. Figure 10. Population size dynamics in pessimal environmental conditions. For some, a species formation takes place in the system due to HGT and gene loss, but an infection occurred at the 10000 th iteration. Shortly afterwards, most of the populations became extinct. Surviving populations did not have a metabolically complete genome. Furthermore, among the survivors there were populations with extremely primitive genomes (lower scheme in figure). In the genome figures, the black bar represents the phage gene, i.e. all survived populations are phage carriers. Figure 11. Population size dynamics of a community in optimal conditions. For some time species formation takes place within the system due to HGT and gene loss, but at the 10000 th iteration an infection occurs. Shortly afterwards, all populations become extinct, except the population with a metabolically complete genome infected by the phage. This model describes a system consisting of two genes, G 1 and G 2 , which synthesize regulators P 1 and P 2 , which are suppressors of G 2 and G 1 respectively. This genetic system has at least two stable stationary states -gene G 1 or gene G 2 is expressed within the system. The probability of transit (a switch) from one stationary state to another is caused by disturbing factors (for example, by adding of one of the regulators to the system), which enables us to suggest the trigger nature of this system. By applying the HEC, a model of a trophic community with one nonspecific substrate N 1 , consisting of one population and synthesizing two specific substrates S 1 and S 2 has been built. The synthesis constants for these substrates are noted as d 1 and d 2 respectively. The synthesis strategy for the cells in the population is described through the gene network -the molecular trigger. The mathematical model of the corresponding gene network is given below [eq.7]. Liebig's non-compensatory strategy has been used as the trophic strategy.
Where d ī and d j -are mean values of the d i and d j traits in the population.
The parametric analysis of this model has been reported in many studies e.g. in [51]. In particular, it is shown that if γ≥2 and certain values of d ī /d j >g, the system takes on the properties of trigger. There are two stable critical points on the phase plane of the system, between which a labile saddle point is situated. The meaning of the g parameter is bifurcational, while the bifurcation is of a trigger nature (saddle forms).
We have conducted a series of computer simulations and have illustrated the possibility of a trigger mode appearing in this model, depending on the gene network parameter values [eq. 7], and physiological, population and ecological parameters.We have demonstrated that the modes of gene networks functioning inside the organism taking into account restrictions on organism, population and ecological levels, may considerably differ from the modes predicted based on analysis of mathematical models of these networks. For instance, in the molecular trigger model [eq.7] the saddle point (S1=S2=c) is an unstable stationary state. However, in our model we showed the probability of the system stabilizing precisely in such a state despite the fact that the initial data differed from this state. Such stabilization is possible due to additional factors, including limited cell wall permeability, which limits the effect of substrate switchers.
As can be seen from the above, the models we built suggest an additional epigenetic mechanism of the functioning mode stability of persistence gene networks. Such mechanisms were theoretically and experimentally developed by, for example, R.N. Tchuraev and colleagues [52,53]. Via our models, we have also obtained examples the stability persistence of gene network functioning. That is true even in cases when the gene network structure in itself supposes both the presence of several such modes. The possibility of switching between these modes have also been obtained through this models. Such mechanisms can, on the one hand, explain the "nonworking" of artificial genetic constructions during experiments, when they should work according to the calculations in silico. On the other hand, these mechanisms are of significant evolutionary importance and require further study.

Conclusion
The "Haploid Evolutionary Constructor" (HEC) software provides modeling of evolutionary and population processes in prokaryotic communities adjusted for the genetic structure of the population, trophic relationships between populations and the influence of environmental conditions ( Figure 13). The special feature of the HEC is the approach that enables the modeling of structure variable systems, which in fact provides for the possibility to vary the number of populations, genes, and other variables and parameters immediately during simulations. This makes it possible to model the processes of the gene loss and horizontal transfer between cells, as well as the companion processes of speciation. Together, they open up possibilities for the modeling of bacterial community evolution and their population and ecological dynamics.
We have compared two trophic strategies of prokaryotes: compensatory and non-compensatory nutrition. It has been shown that compensatory systems are more stable under hard environmental conditions. The beneficial mutations in such prokaryotic communities often extend the lifetime of the community significantly. The compensatory systems are more stable in continuously varying conditions from the viewpoint of preserving and growing biomass, while the non-compensatory systems are more stable when it comes to conserving biodiversity [54]. In this way, both strategies have their evolutionary advantages and disadvantages. Neither of them dominate absolutely.
We have studied the importance of gene horizontal transfer and loss during the evolution of the prokaryotic communities depending on ecological conditions. The models have shown the genesis of autonomous populations with rich intrinsic cellular metabolism in pessimal conditions. However, their genome is unstable, and the metabolically complete populations lose genes if conditions improve. This evolutionary tendency may be overcome by the addition of phages to the system. Moreover, the result is of a stochastic nature. We suggest that this shows the potential role of bacteriophages in the genesis of eukaryotes [55].
The study of a trigger-type gene network (two mutually repressing operons) has shown that special characteristics of intracellular factors are able to stabilize states that are defined as being unstable during the mathematical analysis of continuous gene network models. Therefore, alongside ecological and population genetics modeling, the HEC can be used for research on the competition and evolution of gene networks in populations, as well as for the optimization of gene network parameters for certain environmental conditions. The gene network model can be described as a synthesis strategy, while the criterion of optimality and selection mechanisms are trophic strategies.

HEC -Haploid Evolutionary Constructor
HGT -Horizontal Gene Transfer