BACKGROUND
prokaryotes considered as the most ancient living organisms and essential part of the earth biosphere.
in particular, prokaryotic  communities maintain all major biogeochemical cycles  <cit> .
typical examples of the communities are spatially complex, layered structures of the bacterial mats or biofilms  <cit> ).
a majority of prokaryote species cannot be cultured, so we have to study them within their natural environment, i.e.
in communities.
hence, mathematical modeling and simulation of bacterial communities are indispensable for understanding of the functioning and evolution of bacteria.
spatial factors are well-known to be among major forces of the evolution  <cit> .
from ecological and evolutionary points of view, spatial distribution of species plays a large role in local microbial cooperation and competition; consequently, spatial distribution influences evolution  <cit> .
combined with other evolutionary factors, these factors affect dynamics of allele frequencies in populations of a community  <cit> .
thus, it has been shown that mutator populations adapted faster than wild-type populations in both liquid and solid environments.
also, it has been shown that independently of the mutation rate, the increase in fitness in the spatially structured environment was smaller than in the unstructured one  <cit> .
summarizing the mentioned above, the study of dependence of functioning and evolution of microbial communities on the spatial distribution of organisms and substances is of essential theoretical interest.
equally important is the study of how various communities transform their habitats.
at present, a number of software tools are available for modeling and simulation of spatially distributed microbial communities.
a majority of these tools, such as cellular automata umcca  <cit> , multi-agent software packages agentcell  <cit> , aquasim  <cit> , indisim  <cit>  and others  <cit> , emphasize the details of the spatial distribution of cells as such.
however, the study of the genetic variability effects upon a spatial structure of a community is of equal importance.
on the other hand, evolutionary oriented software packages, for example, aevol  <cit>  and others  <cit> , mainly focus on genetic structure, evolution and/or metabolism and do not provide the modules for the study of spatial organization.
in present study, we took into account both the spatial distribution of cells and substances and the genetic variability of individual populations by developing a software with expanded set of options that permits the requested modeling.
in this paper, we have carried out the modeling of the spatial heterogeneity of environment surrounding the microbial community and its influence on population dynamics and evolution.
for this purpose, we have developed a software package for the modeling of spatially distributed microbial communities ; the package was added to haploid evolutionary constructor  software that was described previously  <cit> .
we have constructed and analyzed computational models of the prokaryotic communities' evolution with "poisoner-prey" trophic interactions in heterogeneous flow environments.
we have also studied models of the horizontal gene transfer in prokaryotic communities living in spatially distributed habitats under changing environmental conditions.
according to our models, a combination of chemotaxis with other spatial factors might significantly affect the life of prokaryotic communities through the changes in both the dynamics of population and its genetic structure.
modeling methods
simulations have been carried out with the hec software.
the key object modeled in the hec is the prokaryotic polymorphic population which is assumed here to be equivalent to species .
populations consist of cells utilizing substrates which are either consumed from the environment or are synthesized by themselves.
utilization energy is then used for the reproduction and synthesis of other substrates.
synthesized substrates may be either used by cells for own requirements or secreted into habitat.
in the latter case, substrates may be consumed by cells of other species.
in the hec, substrate synthesis and utilization, as well as cell reproduction, are described via the corresponding gene networks  which are named strategies .
numerical parameters of those gns assumed to be "genes" inheriting across the generations.
cells are supposed to belong to the same population  if they possess the same gn structures.
however, numerical parameters of gns in cells of a certain population may vary that models the genetic polymorphism.
the generalized genome of a polymorphic population is formed by a set of allele distributions for each "gene".
mutations changing numerical values of gn parameters consequently change the corresponding allele distribution.
mutations may either be pre-described by the user, or be randomly generated with beta distribution .
in the hec, both finite and infinite sites models may be used optionally.
at the same time, horizontal gene transfer or genes changes the structure of gn, which, in turn, aids in generation of novel species.
these processes may also be pre-described by the user or be randomly generated.
thus, the polymorphic population is characterized by the generalized population genome, the synthesis strategy, the reproduction strategy, intercellular substrates and other parameters .
most of the hec parameters concerning the cell size, amounts of substrates required for cell reproduction and other factors have been estimated on the base of e.coli data  <cit> .
the simulations describe the dynamics of populations, dynamics of allele frequencies , origin and extinction of species, and dynamics of environmental substrates.
all the dynamics of the system is conditioned by the efficiency of metabolic processes of community members in particular environmental conditions .
number of classical models including the logistic growth  <cit>  of the bacterial population and fisher's fundamental theorem of natural selection  <cit>  had previously been implemented in the hec and found to be consistent with the model expectations  <cit> .
we have extended the original hec  by adding the cases of one-, two- or three-dimensional spatial distributions of cells and substrates into the model .
we use the grid of "point environments" - finite mesh of little volume connected with continuous flow  to model spatial distributions in hec 1d-3d.
standard simulation step in the hec 1d-3d consists of the following two stages:
calculation of new states for each point environments  including simulation of the following processes: consumption of substrates, utilization of substrates, reproduction, substrate synthesis and secretion.
this stage is apparently inherited from the hec 0d;
spatial redistribution of substrates and cells in the modeled system including the simulation of flow, diffusion, and chemotaxis processes .
detailed description of spatial processes, as well as nuances related to differences in characteristic times of reproduction and spatial processes, is presented in additional file  <dig> .
hence, the processes of substrate production and utilization, reproduction, mutation, genes loss and horizontal transfer are simulated as part of the standard hec 0d iteration and occur independently in the each mesh point .
only spatial redistribution of organisms and substrates requires nodes synchronization .
RESULTS
modeling "poisoner-prey" community in spatially heterogeneous habitats
using the methods described above, we have studied the change of genetic diversity in populations of the "poisoner-prey" community.
the "poisoner-prey" model has been previously described in our recent studies  <cit> .
one-dimensional flow-through environment .
microbial community consisted of two populations - the poisoner and the prey .
metabolic by-product secreted by the poisoners would inhibit the growth of the prey which product would conversely activate the growth of the poisoner population.
besides, both populations would consume non-specific substrate which had come into the habitat with the inflow.
they used it for the growth.
in this model  we have considered systems of various nodes number .
since a qualitative character of model behavior remained the same, we have considered 10-node tubes without losing generality in this paper.
furthermore, as we have not simulated any mutation, the allele frequencies changed only by the efficiency of metabolic processes of community members in particular environment, which, in turn, depends on corresponding gn).
for each allelic combination in a polymorphic population p, the fitness is calculated as the /pbefore ratio, where pbefore and pafter denote the size of p before and after the reproduction process, respectively.
in the described model, we have considered the following ways of a spatial organization:
<dig>  flow-through habitat ;
<dig>  perpendicular-flow habitats .
first, we have considered a model  with the uniform initial distribution of cells and substances, and flow-through  spatial organization with the flow rate of  <dig>  .
initial populations were genetically polymorphic: prey cells varied in terms of their sensitivity to the s <dig> inhibitor, poisoner cells varied in terms of their efficiency of the s <dig> substrate utilization.
population dynamics of the community demonstrates  that after a relatively short period of oscillation in the preys' size which is associated with the steady growth of the poisoners, the size of both populations becomes stable.
however, if we look at separate nodes , we can see that after  <dig> generations the prey survives only in 1st and 2nd nodes, while the poisoner lives in all nodes of the habitat.
we think that this is due to the preys which live only on the non-specific substrate which is in sufficient amount only in the nodes close to the inflow.
at the same time, the poisoner can partially compensate the lack of the non-specific substrate with the s <dig>
at the same time, we have analyzed the change of genetic diversity in both populations.
figure  <dig> shows that adaptive alleles  completely displace less adaptive ones in course of time.
moreover, the nodes outlying from the source of the non-specific substrate are characterized by the rapid genetic diversity loss for the prey population which is associated with the preservation of genetic diversity in the poisoner .
reverse situation is observed in proximal nodes .
one hundred simulation runs have been performed in which the initial allele distributions varied in such a way that the frequency for each allele lied in the range 5-15% .
confidence intervals are stated at the 95% confidence level.
however, in central nodes  we have observed an increase of time of the genetic diversity preservation - inadaptive alleles would extinct only at  <dig> ±  <dig>  generation.
we think this can be explained by the flow transferring migrants from proximal regions of a habitat in which relatively high genetic diversity remains.
therefore, spatial localization of microorganisms may influence the evolutionary rate: depending on the cell position relative to the source of non-specific substrate, we have observed evolutionary rates among poisoners and preys to be differed from each other.
poisoners evolve more rapidly than preys when located near the source of non-specific substrate and vice versa.
located far from the source, the preys evolve more rapidly.
later we have studied the above model by adding a non-uniform initial state and chemotaxis.
spatial structure of a habitat has been set to perpendicular-flow .
initial distribution of the inhibitor s <dig> has been set to gradient .
flow rate was the same as in the previous case.
we have analyzed the influence of chemotaxis on the model behavior.
figure  <dig> shows the chemotaxis-off case .
in different nodes oscillations in the prey population size vary due to non-uniform distribution of inhibitor.
poisoners population size negligibly varies in different nodes.
situation changes when chemotaxis switches on: cells can actively move to nodes with more favorable conditions.
simulation results are shown in additional file  <dig> fig.
s <dig>  s <dig>  inhibitor gradient and cell movement cause an origin of local oscillations in population dynamics which affects the dynamics of both separate nodes and a habitat in whole.
analysis of this model under various environmental conditions has shown that the non-uniform distribution of substrates that was due to either initial inequalities data or high diffusion rate along with the chemotaxis resulted in emergent community dynamics evident in a movement of cells to a better place of living, into the nodes with higher concentrations of necessary substrates.
under these circumstances, both local oscillations and even an irregular behavior were observed .
this finding is in an agreement with experimentally observed behavior of antagonistic e.coli strains reported earlier  <cit> .
detailed analysis of the genetic structure dynamics in these populations is described below.
we have considered the "poisoner-prey" model with a perpendicular flow and a diffusion-dependent non-uniformity of substrates.
at the baseline, the genetic polymorphism was same to that in previous models .
population dynamics of the model is shown in additional file  <dig> fig.
s <dig>
diffusion causes non-uniformity.
combined with active movement of cells, it leads to irregularities in the dynamics within local populations .
it is evident that chemotaxis may promote irregular oscillations of the population size in separate nodes while at the genetic level the dynamics of allele frequencies remains stable .
modeling horizontal transfer of genes in spatially distributed systems under varying environmental conditions
the second model describes co-functioning and competition of populations in a community consisting of two trophic cycles living in the 1d tube habitat  under varying environmental conditions.
this model is the extension of a previously published model with an uniform mixing   <cit> .
each trophic cycle includes three populations .
for this community, we have considered two combinations of breeding strategies: nc-nc and c-c. here, nc-nc strategy implies that all populations employ non-compensatory strategy, implementing the liebig's law of the minimum: "the growth is controlled not by the total amount of resources available, but by the most scarce resource "  <cit> ; c-c means that all populations of a community breed via the compensatory reproduction strategy, implementing the rubel's law of compensation of ecological factors: "if one factor intensifies the action of another, the minimum of the latter is less than it would be without the help of the former.
the contrary effect is possible when the accompanying factor results in raising the minimum"  <cit>  .
our previous studies for the 0d case have shown that during long period of starvation the non-compensatory strategy preserved the genetic diversity while compensatory strategy was preserving it only for a shortwhile  <cit> .
at the same time, non-compensatory systems have been shown to be less adaptable for harsh environmental conditions than compensatory ones.
we have considered both cases with and without chemotaxis.
for these models, we have studied how the horizontal transfer  of genes and change of environmental conditions affected the community functioning:
<dig>  on the 100th generation, we have simulated the ht of the gene of the s <dig> specific substrate utilization from cells of the p <dig> population into cells of the p <dig> population.
it would lead to the origin of new type cells which then would form the p <dig> population connecting two trophic cycles.
<dig>  on the 2000th generation, we have simulated the decrease of a non-specific substrate concentration in the flow by factor of  <dig>  such a "starvation" continued for  <dig> generations and then initial conditions had been restored.
first, we have considered flow-through habitats.
in c-c communities when chemotaxis was switched off, the ht would change the fate of the communities if only occurred in nodes close to the source of a non-specific substrate : new population would survive and population sizes would differentiate.
if the ht occurred in outlying nodes , new population could not settle and would be eliminated soon.
chemotaxis encouraged fixation  and sustaining of biodiversity .
however, total biomass of such a community turned out to be lower .
palaeontologist zherikhin and paleobotanist meyen proposed the concepts of zonal stratification  <cit>  and phytospreading  <cit> , which are the extensions of darlington's "equatorial pump" concept  <cit> .
according to these concepts, the most rates of taxa formation are observed in such locations in which the struggle for existence against abiotic factors is reduced.
in the previous model , the p <dig> population survived only if the ht occurred in substrate-rich nodes , which are analogues of zherikhin's and meyen's biotopes.
in poor ecosystems, the novel species could not grow up to the necessary size for an effective competition in the community in spite of the fact that novel genotype would be potentially more adaptive than others .
it is in good agreement with the concepts of equatorial pump and phytospreading, as the evolutionary success of a novel species is related to not only pre-adaptations, but also to habitat conditions  <cit> .
there is also an interesting conclusion of the habitat constraint mentioned above.
it is commonly supposed that adaptations appear in one or several individuals.
if they occur in unfavorable conditions, a small subpopulation of mutants would not fixate in a community owing to its size.
that is why pre-adaptations should be accumulated in the form of a neutral variability during the period of relatively optimal habitat conditions.
they manifest when conditions change.
simulation results were similar to those for compensatory communities in non-compensatory communities without chemotaxis.
however, in contrast to the c-c case, the presence of chemotaxis has dramatically changed the fate of nc-nc communities.
ht has destabilized the system leading to the extinction of the part of the acceptor trophic ring : if the ht occurred close to the source of a non-specific substrate , the whole acceptor trophic ring would perish ; in other cases  only the p <dig> population would perish .
finally, we have considered systems with perpendicular-flow habitats.
in c-c communities, chemotaxis was found to result in a bit more expressed differentiation of the population size under starvation  - pmax/pmin ratios are  <dig>   and  <dig>  .
in nc-nc communities , the cell movement ability would lead to the origin of irregular oscillations , although of a severely limited amplitude .
it seems surprising to us that while the p <dig> is the potential beneficiary of the community perturbations caused by the ht .
it should particularly be noted that the destabilization of the community occurred prior to the starvation.
the novel p <dig> population is rather adaptive as it always survives.
however, the p <dig> does not dominate in the community, which is rather not obvious.
in our opinion, the reason is that the nc trophic ring consists of the highly specialized symbiotrophic populations realizing the optimal system of trophic interactions.
if the ht along with the chemotaxis promotes the origin of high-competing species and then such species may destabilize the established community even long before the starvation.
it consequently may lead to unpredictable dynamics of the community.
the location of the ht significantly affects the fate of communities living in flow-through habitats leading to the differentiation and even the change of the community structure.
in perpendicular-flow habitats, the location of the ht plays much lesser role: functional modes of a community do not change whenever the ht occurred.
CONCLUSIONS
in this study, the methods for modeling spatially distributed microbial communities with changing genetic structure have been presented along with the hec 1d-3d software package.
the software allows one to build a model of the microbial community that takes into account both spatial environmental factors and genetic and metabolic variations.
thus, the software described provides it users with expanded simulation capabilities and is superior to existing tools for simulation of microbial communities.
the models of functioning and evolution of prokaryotic communities implementing "poisoner-prey" trophic interactions in spatially heterogeneous habitats have been constructed and analyzed.
spatial localization of organisms has been shown to affect the selection intensity and their evolutionary rate: depending on the distance from a substrate source, we have observed evolutionary rates among poisoner and prey populations to be differed from each other.
for "poisoner-prey" communities living in perpendicular-flow habitats, we have also shown that spatial heterogeneity might lead to the origin of irregular population dynamics, but dynamics of genetic structure  at the time would remain stable.
the horizontal transfer models in symbiotic communities consisted of two trophic cycles and living in spatially distributed habitats under varying environmental conditions have also been analyzed.
location of the ht origin has been noted to essentially influence the fate of the community, especially in flow-through habitats.
as for the temporary starvation, various locations of the ht have determined various population structure and even species composition of the community.
in perpendicular-flow habitats, place of the ht origin would play much lesser role: functional regimes of the community would not change whenever it occurred.
therefore, it has been shown that movement factors  associated with a non-uniform spatial distribution of cells and substances might dramatically affect the life of communities which has been manifested in both population dynamics and dynamics of genetic diversity of populations for all considered models.
abbreviations
hec: haploid evolutionary constructor
gn: gene networks
ht: horizontal transfer
c: compensatory reproduction strategy
nc: non-compensatory reproduction strategy
additional information
additional information can be found in additional file  <dig>   <dig>   <dig>   <dig>   <dig>   <dig> and  <dig>
competing interests
the authors declare that they have no competing interests.
authors' contributions
kai has implemented spatially distributed versions of the hec.
kai and lsa have developed and simulated the models.
kai, myug, kna and lsa have analyzed results and performed biological interpretations.
lsa has coordinated the writing of the paper.
all authors have read and approved the final manuscript.
supplementary material
additional file 1
archive containing the supplementary figures.
7-zip archive containing the supplementary figures s1-s <dig>
click here for file
additional file 2
archive containing the hec script and statistic files of pp_spectre_ <dig> model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figures 5- <dig>  s <dig>  table  <dig>
click here for file
additional file 3
archive containing the hec script and statistic files of ort_10_d =  <dig> model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure  <dig>
click here for file
additional file 4
archive containing the hec script and statistic files of reissue.rubel.through.chem =  <dig> .hgt <dig> model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure  <dig> .
click here for file
additional file 5
archive containing the hec script and statistic files of reissue.rubel.through.chem =  <dig> .hgt <dig> model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure  <dig> .
click here for file
additional file 6
archive containing the hec script and statistic files of reissue.liebig.through.chem =  <dig> .hgt <dig> model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure  <dig>
click here for file
additional file 7
archive containing the hec script and statistic files of reissue.liebig.through.chem =  <dig> .hgt <dig> model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure  <dig>
click here for file
additional file 8
archive containing the hec script and statistic files of reissue.liebig.through.chem =  <dig> .hgt <dig> model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure  <dig>
click here for file
additional file 9
archive containing the hec script and statistic files of reissue.rubel.ort model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s <dig> .
click here for file
additional file 10
archive containing the hec script and statistic files of reissue.rubel.ort .chem =  <dig>  model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s <dig> .
click here for file
additional file 11
archive containing the hec script and statistic files of reissue.liebig.ort model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s <dig> .
click here for file
additional file 12
archive containing the hec script and statistic files of reissue.liebig.ort .chem =  <dig>  model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s <dig> .
click here for file
additional file 13
simulation of spatially distributed habitats; breeding strategies formulas
click here for file
additional file 14
archive containing the hec executable file.
7-zip archive containing the hec executable file .
click here for file
additional file 15
archive containing the hec script and statistic files of ort_10_d =  <dig> model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figures s7-s <dig>  s9a.
click here for file
additional file 16
archive containing the hec script and statistic files of ort_10_d =  <dig>  model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s9b.
click here for file
additional file 17
archive containing the hec script and statistic files of ort_10_d =  <dig>  model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s9c.
click here for file
additional file 18
archive containing the hec script and statistic files of pp_spectre_ <dig> model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s10-s <dig>
click here for file
additional file 19
archive containing the hec script and statistic files of reissue.rubel.through model.
7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s <dig>
click here for file
acknowledgements
we appreciate valentin suslov  for biological discussions and help in interpretation of simulation results.
declarations
publication of this article has been funded by the rsf n 14-24- <dig> grant.
this article has been published as part of bmc evolutionary biology volume  <dig> supplement  <dig>  2015: selected articles from the ix international conference on the bioinformatics of genome regulation and structure\systems biology : evolutionary biology.
the full contents of the supplement are available online at http://www.biomedcentral.com/bmcevolbiol/supplements/15/s <dig>

 prokaryotes considered as the most ancient living organisms and essential part of the earth biosphere. in particular, prokaryotic communities maintain all major biogeochemical cycles. typical examples of the communities are spatially complex, layered structures of the bacterial mats or biofilms ). a majority of prokaryote species cannot be cultured, so we have to study them within their natural environment, i.e. in communities. hence, mathematical modeling and simulation of bacterial communities are indispensable for understanding of the functioning and evolution of bacteria. spatial factors are well-known to be among major forces of the evolution. from ecological and evolutionary points of view, spatial distribution of species plays a large role in local microbial cooperation and competition; consequently, spatial distribution influences evolution. combined with other evolutionary factors, these factors affect dynamics of allele frequencies in populations of a community. thus, it has been shown that mutator populations adapted faster than wild-type populations in both liquid and solid environments. also, it has been shown that independently of the mutation rate, the increase in fitness in the spatially structured environment was smaller than in the unstructured one. summarizing the mentioned above, the study of dependence of functioning and evolution of microbial communities on the spatial distribution of organisms and substances is of essential theoretical interest. equally important is the study of how various communities transform their habitats. at present, a number of software tools are available for modeling and simulation of spatially distributed microbial communities. a majority of these tools, such as cellular automata umcca, multi-agent software packages agentcell, aquasim, indisim and others, emphasize the details of the spatial distribution of cells as such. however, the study of the genetic variability effects upon a spatial structure of a community is of equal importance. on the other hand, evolutionary oriented software packages, for example, aevol and others, mainly focus on genetic structure, evolution and/or metabolism and do not provide the modules for the study of spatial organization. in present study, we took into account both the spatial distribution of cells and substances and the genetic variability of individual populations by developing a software with expanded set of options that permits the requested modeling. in this paper, we have carried out the modeling of the spatial heterogeneity of environment surrounding the microbial community and its influence on population dynamics and evolution. for this purpose, we have developed a software package for the modeling of spatially distributed microbial communities; the package was added to haploid evolutionary constructor software that was described previously. we have constructed and analyzed computational models of the prokaryotic communities' evolution with "poisoner-prey" trophic interactions in heterogeneous flow environments. we have also studied models of the horizontal gene transfer in prokaryotic communities living in spatially distributed habitats under changing environmental conditions. according to our models, a combination of chemotaxis with other spatial factors might significantly affect the life of prokaryotic communities through the changes in both the dynamics of population and its genetic structure. modeling methods simulations have been carried out with the hec software. the key object modeled in the hec is the prokaryotic polymorphic population which is assumed here to be equivalent to species. populations consist of cells utilizing substrates which are either consumed from the environment or are synthesized by themselves. utilization energy is then used for the reproduction and synthesis of other substrates. synthesized substrates may be either used by cells for own requirements or secreted into habitat. in the latter case, substrates may be consumed by cells of other species. in the hec, substrate synthesis and utilization, as well as cell reproduction, are described via the corresponding gene networks which are named strategies. numerical parameters of those gns assumed to be "genes" inheriting across the generations. cells are supposed to belong to the same population if they possess the same gn structures. however, numerical parameters of gns in cells of a certain population may vary that models the genetic polymorphism. the generalized genome of a polymorphic population is formed by a set of allele distributions for each "gene". mutations changing numerical values of gn parameters consequently change the corresponding allele distribution. mutations may either be pre-described by the user, or be randomly generated with beta distribution. in the hec, both finite and infinite sites models may be used optionally. at the same time, horizontal gene transfer or genes changes the structure of gn, which, in turn, aids in generation of novel species. these processes may also be pre-described by the user or be randomly generated. thus, the polymorphic population is characterized by the generalized population genome, the synthesis strategy, the reproduction strategy, intercellular substrates and other parameters. most of the hec parameters concerning the cell size, amounts of substrates required for cell reproduction and other factors have been estimated on the base of e.coli data. the simulations describe the dynamics of populations, dynamics of allele frequencies, origin and extinction of species, and dynamics of environmental substrates. all the dynamics of the system is conditioned by the efficiency of metabolic processes of community members in particular environmental conditions. number of classical models including the logistic growth of the bacterial population and fisher's fundamental theorem of natural selection had previously been implemented in the hec and found to be consistent with the model expectations. we have extended the original hec by adding the cases of one-, two- or three-dimensional spatial distributions of cells and substrates into the model. we use the grid of "point environments" - finite mesh of little volume connected with continuous flow to model spatial distributions in hec 1d-3d. standard simulation step in the hec 1d-3d consists of the following two stages: calculation of new states for each point environments including simulation of the following processes: consumption of substrates, utilization of substrates, reproduction, substrate synthesis and secretion. this stage is apparently inherited from the hec 0d; spatial redistribution of substrates and cells in the modeled system including the simulation of flow, diffusion, and chemotaxis processes. detailed description of spatial processes, as well as nuances related to differences in characteristic times of reproduction and spatial processes, is presented in additional file. hence, the processes of substrate production and utilization, reproduction, mutation, genes loss and horizontal transfer are simulated as part of the standard hec 0d iteration and occur independently in the each mesh point. only spatial redistribution of organisms and substrates requires nodes synchronization.  modeling "poisoner-prey" community in spatially heterogeneous habitats using the methods described above, we have studied the change of genetic diversity in populations of the "poisoner-prey" community. the "poisoner-prey" model has been previously described in our recent studies. one-dimensional flow-through environment. microbial community consisted of two populations - the poisoner and the prey. metabolic by-product secreted by the poisoners would inhibit the growth of the prey which product would conversely activate the growth of the poisoner population. besides, both populations would consume non-specific substrate which had come into the habitat with the inflow. they used it for the growth. in this model we have considered systems of various nodes number. since a qualitative character of model behavior remained the same, we have considered 10-node tubes without losing generality in this paper. furthermore, as we have not simulated any mutation, the allele frequencies changed only by the efficiency of metabolic processes of community members in particular environment, which, in turn, depends on corresponding gn). for each allelic combination in a polymorphic population p, the fitness is calculated as the /pbefore ratio, where pbefore and pafter denote the size of p before and after the reproduction process, respectively. in the described model, we have considered the following ways of a spatial organization: flow-through habitat; perpendicular-flow habitats. first, we have considered a model with the uniform initial distribution of cells and substances, and flow-through spatial organization with the flow rate of. initial populations were genetically polymorphic: prey cells varied in terms of their sensitivity to the s inhibitor, poisoner cells varied in terms of their efficiency of the s substrate utilization. population dynamics of the community demonstrates that after a relatively short period of oscillation in the preys' size which is associated with the steady growth of the poisoners, the size of both populations becomes stable. however, if we look at separate nodes, we can see that after generations the prey survives only in 1st and 2nd nodes, while the poisoner lives in all nodes of the habitat. we think that this is due to the preys which live only on the non-specific substrate which is in sufficient amount only in the nodes close to the inflow. at the same time, the poisoner can partially compensate the lack of the non-specific substrate with the s at the same time, we have analyzed the change of genetic diversity in both populations. figure shows that adaptive alleles completely displace less adaptive ones in course of time. moreover, the nodes outlying from the source of the non-specific substrate are characterized by the rapid genetic diversity loss for the prey population which is associated with the preservation of genetic diversity in the poisoner. reverse situation is observed in proximal nodes. one hundred simulation runs have been performed in which the initial allele distributions varied in such a way that the frequency for each allele lied in the range 5-15%. confidence intervals are stated at the 95% confidence level. however, in central nodes we have observed an increase of time of the genetic diversity preservation - inadaptive alleles would extinct only at ± generation. we think this can be explained by the flow transferring migrants from proximal regions of a habitat in which relatively high genetic diversity remains. therefore, spatial localization of microorganisms may influence the evolutionary rate: depending on the cell position relative to the source of non-specific substrate, we have observed evolutionary rates among poisoners and preys to be differed from each other. poisoners evolve more rapidly than preys when located near the source of non-specific substrate and vice versa. located far from the source, the preys evolve more rapidly. later we have studied the above model by adding a non-uniform initial state and chemotaxis. spatial structure of a habitat has been set to perpendicular-flow. initial distribution of the inhibitor s has been set to gradient. flow rate was the same as in the previous case. we have analyzed the influence of chemotaxis on the model behavior. figure shows the chemotaxis-off case. in different nodes oscillations in the prey population size vary due to non-uniform distribution of inhibitor. poisoners population size negligibly varies in different nodes. situation changes when chemotaxis switches on: cells can actively move to nodes with more favorable conditions. simulation results are shown in additional file fig. s s inhibitor gradient and cell movement cause an origin of local oscillations in population dynamics which affects the dynamics of both separate nodes and a habitat in whole. analysis of this model under various environmental conditions has shown that the non-uniform distribution of substrates that was due to either initial inequalities data or high diffusion rate along with the chemotaxis resulted in emergent community dynamics evident in a movement of cells to a better place of living, into the nodes with higher concentrations of necessary substrates. under these circumstances, both local oscillations and even an irregular behavior were observed. this finding is in an agreement with experimentally observed behavior of antagonistic e.coli strains reported earlier. detailed analysis of the genetic structure dynamics in these populations is described below. we have considered the "poisoner-prey" model with a perpendicular flow and a diffusion-dependent non-uniformity of substrates. at the baseline, the genetic polymorphism was same to that in previous models. population dynamics of the model is shown in additional file fig. s diffusion causes non-uniformity. combined with active movement of cells, it leads to irregularities in the dynamics within local populations. it is evident that chemotaxis may promote irregular oscillations of the population size in separate nodes while at the genetic level the dynamics of allele frequencies remains stable. modeling horizontal transfer of genes in spatially distributed systems under varying environmental conditions the second model describes co-functioning and competition of populations in a community consisting of two trophic cycles living in the 1d tube habitat under varying environmental conditions. this model is the extension of a previously published model with an uniform mixing. each trophic cycle includes three populations. for this community, we have considered two combinations of breeding strategies: nc-nc and c-c. here, nc-nc strategy implies that all populations employ non-compensatory strategy, implementing the liebig's law of the minimum: "the growth is controlled not by the total amount of resources available, but by the most scarce resource "; c-c means that all populations of a community breed via the compensatory reproduction strategy, implementing the rubel's law of compensation of ecological factors: "if one factor intensifies the action of another, the minimum of the latter is less than it would be without the help of the former. the contrary effect is possible when the accompanying factor results in raising the minimum". our previous studies for the 0d case have shown that during long period of starvation the non-compensatory strategy preserved the genetic diversity while compensatory strategy was preserving it only for a shortwhile. at the same time, non-compensatory systems have been shown to be less adaptable for harsh environmental conditions than compensatory ones. we have considered both cases with and without chemotaxis. for these models, we have studied how the horizontal transfer of genes and change of environmental conditions affected the community functioning: on the 100th generation, we have simulated the ht of the gene of the s specific substrate utilization from cells of the p population into cells of the p population. it would lead to the origin of new type cells which then would form the p population connecting two trophic cycles. on the 2000th generation, we have simulated the decrease of a non-specific substrate concentration in the flow by factor of such a "starvation" continued for generations and then initial conditions had been restored. first, we have considered flow-through habitats. in c-c communities when chemotaxis was switched off, the ht would change the fate of the communities if only occurred in nodes close to the source of a non-specific substrate: new population would survive and population sizes would differentiate. if the ht occurred in outlying nodes, new population could not settle and would be eliminated soon. chemotaxis encouraged fixation and sustaining of biodiversity. however, total biomass of such a community turned out to be lower. palaeontologist zherikhin and paleobotanist meyen proposed the concepts of zonal stratification and phytospreading, which are the extensions of darlington's "equatorial pump" concept. according to these concepts, the most rates of taxa formation are observed in such locations in which the struggle for existence against abiotic factors is reduced. in the previous model, the p population survived only if the ht occurred in substrate-rich nodes, which are analogues of zherikhin's and meyen's biotopes. in poor ecosystems, the novel species could not grow up to the necessary size for an effective competition in the community in spite of the fact that novel genotype would be potentially more adaptive than others. it is in good agreement with the concepts of equatorial pump and phytospreading, as the evolutionary success of a novel species is related to not only pre-adaptations, but also to habitat conditions. there is also an interesting conclusion of the habitat constraint mentioned above. it is commonly supposed that adaptations appear in one or several individuals. if they occur in unfavorable conditions, a small subpopulation of mutants would not fixate in a community owing to its size. that is why pre-adaptations should be accumulated in the form of a neutral variability during the period of relatively optimal habitat conditions. they manifest when conditions change. simulation results were similar to those for compensatory communities in non-compensatory communities without chemotaxis. however, in contrast to the c-c case, the presence of chemotaxis has dramatically changed the fate of nc-nc communities. ht has destabilized the system leading to the extinction of the part of the acceptor trophic ring: if the ht occurred close to the source of a non-specific substrate, the whole acceptor trophic ring would perish; in other cases only the p population would perish. finally, we have considered systems with perpendicular-flow habitats. in c-c communities, chemotaxis was found to result in a bit more expressed differentiation of the population size under starvation - pmax/pmin ratios are and. in nc-nc communities, the cell movement ability would lead to the origin of irregular oscillations, although of a severely limited amplitude. it seems surprising to us that while the p is the potential beneficiary of the community perturbations caused by the ht. it should particularly be noted that the destabilization of the community occurred prior to the starvation. the novel p population is rather adaptive as it always survives. however, the p does not dominate in the community, which is rather not obvious. in our opinion, the reason is that the nc trophic ring consists of the highly specialized symbiotrophic populations realizing the optimal system of trophic interactions. if the ht along with the chemotaxis promotes the origin of high-competing species and then such species may destabilize the established community even long before the starvation. it consequently may lead to unpredictable dynamics of the community. the location of the ht significantly affects the fate of communities living in flow-through habitats leading to the differentiation and even the change of the community structure. in perpendicular-flow habitats, the location of the ht plays much lesser role: functional modes of a community do not change whenever the ht occurred.  in this study, the methods for modeling spatially distributed microbial communities with changing genetic structure have been presented along with the hec 1d-3d software package. the software allows one to build a model of the microbial community that takes into account both spatial environmental factors and genetic and metabolic variations. thus, the software described provides it users with expanded simulation capabilities and is superior to existing tools for simulation of microbial communities. the models of functioning and evolution of prokaryotic communities implementing "poisoner-prey" trophic interactions in spatially heterogeneous habitats have been constructed and analyzed. spatial localization of organisms has been shown to affect the selection intensity and their evolutionary rate: depending on the distance from a substrate source, we have observed evolutionary rates among poisoner and prey populations to be differed from each other. for "poisoner-prey" communities living in perpendicular-flow habitats, we have also shown that spatial heterogeneity might lead to the origin of irregular population dynamics, but dynamics of genetic structure at the time would remain stable. the horizontal transfer models in symbiotic communities consisted of two trophic cycles and living in spatially distributed habitats under varying environmental conditions have also been analyzed. location of the ht origin has been noted to essentially influence the fate of the community, especially in flow-through habitats. as for the temporary starvation, various locations of the ht have determined various population structure and even species composition of the community. in perpendicular-flow habitats, place of the ht origin would play much lesser role: functional regimes of the community would not change whenever it occurred. therefore, it has been shown that movement factors associated with a non-uniform spatial distribution of cells and substances might dramatically affect the life of communities which has been manifested in both population dynamics and dynamics of genetic diversity of populations for all considered models. abbreviations hec: haploid evolutionary constructor gn: gene networks ht: horizontal transfer c: compensatory reproduction strategy nc: non-compensatory reproduction strategy additional information additional information can be found in additional file and competing interests the authors declare that they have no competing interests. authors' contributions kai has implemented spatially distributed versions of the hec. kai and lsa have developed and simulated the models. kai, myug, kna and lsa have analyzed results and performed biological interpretations. lsa has coordinated the writing of the paper. all authors have read and approved the final manuscript. supplementary material additional file 1 archive containing the supplementary figures. 7-zip archive containing the supplementary figures s1-s click here for file additional file 2 archive containing the hec script and statistic files of pp_spectre_ model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figures 5- s table click here for file additional file 3 archive containing the hec script and statistic files of ort_10_d = model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure click here for file additional file 4 archive containing the hec script and statistic files of reissue.rubel.through.chem =.hgt model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure. click here for file additional file 5 archive containing the hec script and statistic files of reissue.rubel.through.chem =.hgt model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure. click here for file additional file 6 archive containing the hec script and statistic files of reissue.liebig.through.chem =.hgt model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure click here for file additional file 7 archive containing the hec script and statistic files of reissue.liebig.through.chem =.hgt model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure click here for file additional file 8 archive containing the hec script and statistic files of reissue.liebig.through.chem =.hgt model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure click here for file additional file 9 archive containing the hec script and statistic files of reissue.rubel.ort model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s. click here for file additional file 10 archive containing the hec script and statistic files of reissue.rubel.ort.chem = model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s. click here for file additional file 11 archive containing the hec script and statistic files of reissue.liebig.ort model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s. click here for file additional file 12 archive containing the hec script and statistic files of reissue.liebig.ort.chem = model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s. click here for file additional file 13 simulation of spatially distributed habitats; breeding strategies formulas click here for file additional file 14 archive containing the hec executable file. 7-zip archive containing the hec executable file. click here for file additional file 15 archive containing the hec script and statistic files of ort_10_d = model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figures s7-s s9a. click here for file additional file 16 archive containing the hec script and statistic files of ort_10_d = model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s9b. click here for file additional file 17 archive containing the hec script and statistic files of ort_10_d = model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s9c. click here for file additional file 18 archive containing the hec script and statistic files of pp_spectre_ model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s10-s click here for file additional file 19 archive containing the hec script and statistic files of reissue.rubel.through model. 7-zip archive containing text file with the model script and statistic files concerned the results depicted in figure s click here for file acknowledgements we appreciate valentin suslov for biological discussions and help in interpretation of simulation results. declarations publication of this article has been funded by the rsf n 14-24- grant. this article has been published as part of bmc evolutionary biology volume supplement 2015: selected articles from the ix international conference on the bioinformatics of genome regulation and structure\systems biology: evolutionary biology. the full contents of the supplement are available online at http://www.biomedcentral.com/bmcevolbiol/supplements/15/s 
microbial communityspatial distributionevolutionary modelingprokaryotes23- june ix international conference on the bioinformatics of genome regulation and structure\systems biology novosibirsk, russia in this paper, we have constructed and simulated a set of multiscale models of spatially distributed microbial communities and study an influence of unevenly distributed environmental factors on the genetic diversity and evolution of the community members. furthermore, in spatially heterogeneous communities, the chemotaxis might dramatically affect the evolution of community members. a set of the models of spatially distributed communities was built to demonstrate that the spatial distribution of cells affects both intensity of selection and evolution rate. haploid evolutionary constructor software http://evol-constructor.bionet.nsc.ru/ was expanded by adding the tool for the spatial modeling of a microbial community. in spatially heterogeneous communities, the change in the direction of the environmental flow might be reflected in local irregular population dynamics, while the genetic structure of populations remains stable.
 multiscale approaches for integrating submodels of various levels of biological organization into a single model became the major tool of systems biology. in this paper, we have constructed and simulated a set of multiscale models of spatially distributed microbial communities and study an influence of unevenly distributed environmental factors on the genetic diversity and evolution of the community members.  haploid evolutionary constructor software http://evol-constructor.bionet.nsc.ru/ was expanded by adding the tool for the spatial modeling of a microbial community. a set of the models of spatially distributed communities was built to demonstrate that the spatial distribution of cells affects both intensity of selection and evolution rate.  in spatially heterogeneous communities, the change in the direction of the environmental flow might be reflected in local irregular population dynamics, while the genetic structure of populations remains stable. furthermore, in spatially heterogeneous communities, the chemotaxis might dramatically affect the evolution of community members. microbial communityspatial distributionevolutionary modelingprokaryotes23- june ix international conference on the bioinformatics of genome regulation and structure\systems biology novosibirsk, russia 