BACKGROUND
biological systems often show modularity, in the sense that they can be separated into nearly-independent structural subsystems, each of which performs a specific function  <cit> .
the origin and preservation of modularity in biology is a subject of current interest  <cit> .
one approach to study the origin of modularity employs computer simulations of biological evolution  <cit> .
such simulations make random changes to a set of networks, and select those that best satisfy a given goal.
simulations towards a constant goal usually lead to non-modular networks.
even an initially modular network rapidly evolves connections that reduce modularity but increase fitness  <cit> .
this raises the question of which evolutionary forces can generate and maintain modular structure.
one possible force that can lead to modularity was suggested by evolutionary simulations where the goal changes over time  <cit> .
modular networks spontaneously evolved when the goal changed with time in a way that preserves the same sub-goals but in different combinations  <cit> .
under such 'modularly varying goals', the networks evolved and maintained modular structure, with a module for each sub-goal.
when the goal changed, the connections between these modules were rapidly rewired to adapt to the new goal.
here, we attempt to test these findings in a natural biological system, by asking whether there is a correlation between metabolic network's modularity and the variability of the environment in which it evolved.
we concentrated on the metabolic networks of bacteria due to the availability and quality of the data.
these networks can be systematically compared between species that live in environments that differ in their degree of variability.
metabolic networks represent the set of biochemical metabolic reactions within a living cell  <cit> .
metabolic networks of diverse bacterial species have been reconstructed based on their genomic sequence and additional biochemical data  <cit> .
previous structural comparisons of metabolic networks focused on differences between kingdoms or phyla   <cit> .
here, we ask whether there exists a correlation between the degree of modularity of the metabolic network of an organism and the variability in its environment.
we analyzed the metabolic networks of  <dig> bacteria species living in broad range of habitats including oceans, salt lakes, thermal vents, soil and within hosts.
the species were classified according to the degree of variability in their environment.
we measured the modularity levels and additional related structural parameters of bacteria metabolic networks, finding that the level of variability in organism's environment correlates with the modularity of the networks: the more variable the environment, the more modular the metabolic network.
our study therefore supports the view that environmental variability promotes modularity in biological networks.
RESULTS
classification of variability of bacterial environments
the natural environment of  <dig> bacterial species was classified based on the ncbi classification for bacterial lifestyle  <cit>  .
the classification includes six classes: obligate bacteria  <cit>  that are obligately associated with a host, either intracellulary or extracellulary.
an example is buchnera that lives in symbiosis inside aphids and has little contact with the outside world.
specialized bacteria that live in specialized environments such as marine thermal vents.
aquatic bacteria  <cit> , that live in fresh or seawater environment, and are not associated with hosts.
facultative bacteria, free living bacteria such as e. coli that often associate with a host.
multiple bacteria, that live in multiple different kinds of environments such as bacteria with a wide host range, and terrestrial bacteria, that live in the soil.
we ranked the variability of the different environments considering physical conditions  and heterogeneity of species  <cit> .
obligate bacteria are thought to have the most constant environment as these bacteria live within a biochemically controlled and isolated environment  <cit> , usually with only few other species or even no other species.
specialized and aquatic bacteria are adapted to a strict realm of ecological conditions, yet their habitat is less protected and exhibits higher species heterogeneity than the obligate class.
facultative bacteria that live both in hosts and in the outside world are exposed to a more variable environment than the former classes, but less variable than the multiple class that spans widely different habitats.
finally, the terrestrial class is often considered the most variable class  <cit> , since the soil is highly heterogeneous and has a diverse ecology.
in addition to this qualitative ordering, we sought a quantitative measure that may reflect environmental variability.
one such measure is the fraction of transcription factors out of the total number of genes in the organism.
the reason for using this measure is that theoretical analysis based on cost-benefit analysis suggests that transcription factors are more strongly selected in variable environments than in constant ones .
hence, more regulators per gene are expected the more variable the environment.
it was shown  <cit>  that the benefit of a transcription factor is highest when it can appropriately regulate gene expression in response to environmental changes, offsetting the cost of production and maintenance of the transcription factor protein and associated sensory systems  <cit> .
studies by moran and colleagues indicate that under constant conditions, genes for transcription factors tend to be lost from the genome  <cit> .
genes of organisms in nearly constant conditions are deleted, or are constitutively expressed and do not require transcription control, as was experimentally demonstrated for buchnera  <cit>  and rickettsia  <cit> .
in agreement with the above, we find that the fraction of transcription factors, as well as their total number, increases with the expected variability of the bacterial lifestyle classification .
note also that the size of the metabolic networks  tends to increase with the expected variability of the environment .
modularity of metabolic networks correlates with variability in the environment
the metabolic networks of the different species were obtained from kegg database.
in the networks, each metabolite is a node and edges represent metabolic reactions .
we used a standard measure of modularity  <cit> , to evaluate the modularity of each metabolic network.
we find that modularity increases with the variability in the environment .
the lowest modularity is found for the obligate class, higher modularity is found for the specialized and aquatic classes, and the highest modularity is found for facultative, multiple and terrestrial classes .
we further considered a control for the effects of network size on modularity, by comparing metabolic networks of the same size.
this was achieved by constructing subnetworks of each network containing n =  <dig> nodes , comparable to the smallest networks in the dataset.
these sub-networks were constructed by contracting linear pathways and cycles, and removing dangling nodes, until a network of the required size was obtained.
we find that the modularity of these equal-sized metabolic networks also significantly increased with environmental variability .
as a final control for the effect of network size, we computed the pearson partial correlation  <cit>  between modularity, environmental variability, and network size.
we find that the correlation between modularity and variability is significant also when removing the effect of network size .
each lifestyle class includes bacteria from different branches of the phylogenetic tree.
we find low correlation between the similarity in the modularity of pairs of species and their distance on the phylogenetic tree .
thus, modularity seems to be more correlated with environment than with evolutionary relatedness.
we find that networks from species in constant environments tend to be more tree-like than those in variable environments .
this can be quantitatively seen by considering two topological measures, betweenness-centrality  <cit>  and cyclic coefficients  <cit> , both properly normalized to account for different network sizes.
we find that the former increases and the latter decreases the more constant the environment, suggesting tree like structures .
the tree-like structure seems to result from a lack of alternate metabolic paths in networks from constant environments.
modules in organisms from variable environments are more functionally pure
we used the newman-girvan algorithm  <cit>  to define structural modules in each network, and tested whether the identified modules correspond to well-defined metabolic functions  <cit> .
a structural module in a network was considered to be also a functional module if it was enriched for substrates that had a shared metabolic function such as: central metabolism, biosynthesis of amino acids, carbohydrates, lipids etc.
.
for each network we evaluated two measures: functionality, defined as the fraction of structural modules that were significantly enriched for a metabolic function, and coverage – the fraction of biological functions that could be mapped to structural modules.
we find that the modules in networks of organisms from constant environments usually do not correspond to a defined metabolic function, but rather to mixtures of several biological categories.
in contrast, the modules of networks from variable environment classes usually corresponded to a unique function and the majority of the metabolic functions could be assigned to at least one structural module .
these results further indicate that the present approach for identifying modules yields modules that have biologically significant function  <cit> .
discussion
this study indicates that variability in the environment correlates with enhanced modular organization of metabolic networks, while constant environment correlate with a less modular structure.
one interpretation of these findings can be made in the context of previous simulation studies of evolution in modularly varying environments  <cit> .
the metabolic goal that a bacterium faces can be considered as a combination of sub-goals.
an example of a sub-goal is the biosynthesis of an amino acid such as histidine.
if histidine is missing in the environment, the bacterium must synthesize it.
if histidine is present, the bacterium can down-regulate the biosynthesis pathway and instead import this metabolite.
when the environment changes over time, it introduces a different combination of such metabolic sub-goals.
simulations suggested that varying the sub-goals leads to the evolution of networks with a modular structure, where each module corresponds to one of the sub-goals  <cit> .
modular structure evolves despite the fact that it is less optimal than non-modular solutions  <cit> .
in contrast, evolution under a goal that is constant over time leads to non-modular networks, in which many nodes participate in several functions  <cit> .
the present findings may be interpreted within this context: bacteria that live under varying environments typically evolve a functional module for each of the varying sub-goals.
bacteria under constant conditions tend to evolve towards a less modular design.
it is interesting to note that some metabolic goals are held relatively constant even when the environment changes.
an example is energy metabolism, which is needed for growth by all of the bacterial species studied, in all environments.
analysis of the metabolic networks shows that the part of the network responsible for energy metabolism  is less modular than other parts of the network   <cit> .
more generally, the fraction of the metabolic network devoted to constant goals  seems to increases as the environment becomes more constant .
an additional observation in the computer simulations  <cit>  is that initially modular networks rapidly degrade into non-modular but more optimal structures when the goal becomes constant over time.
examples of such a degeneration of modularity can be seen by comparing the closely related species e. coli and buchnera.
e. coli lives in a variable environment, moving between its mammalian host and the external world.
buchnera lives in a more constant environment, as an endosymbiont of aphids.
buchnera is found to fuse together pathways that are separate in e. coli, and thus to achieve its metabolic goals with a smaller set of enzymes  <cit> .
one example occurs in the histidine and purine modules .
both modules convert the metabolic substrates prpp to aicar in two distinct parhways.
e. coli seems to maintain these alternative pathways because under different environments  only one of the pathways is utilized.
for buchnera, on the other hand, as an endosymbiont that supplies amino-acids to its host, histidine biosynthesis is a fixed goal and under no regulation.
here, the purine module can count on the histidine module for aicar production.
the two pathways were thus combined into a single module, in which many of the genes are used for both functions  <cit> .
it would be interesting to uncover other mechanisms that degenerate or enhance modularity by comparing networks of closely related species with different environments.
one limitation of the present study is the limited knowledge of metabolic networks for diverse species.
the reconstructed networks, based on genomic data, were used to generate information about putative non-directed metabolic interactions.
the present network representation ignore: i) directionality of reactions ii) reaction stochiometry iii) that only a fraction of the reactions are active under given environmental conditions .
the above mentioned problems can be handled by more sophisticated network analyses  <cit> .
such studies employ correlated reaction sets as mathematically defined modules in biochemical reaction networks.
they constitute groups of reactions in a network that always appear together in functional states of that network and therefore represent a functional module of the reaction network.
previous work has shown that these sets can include non-obvious groups of reactions and differ from groupings of reactions based on structural analyses of network topology  <cit> .
one drawback of these latter approaches is that they require carefully annotated, genome-scale metabolic network, of which is only available for a handful number of species.
CONCLUSIONS
this study indicates that the modularity of metabolic networks correlates with the variability of the environment.
such a correlation supports the view that variability in the natural habitat promotes modularity.
it would be important to test this more fully as data on metabolic and regulatory networks of diverse species becomes more complete.
we currently know more about the structure of metabolic networks than about the ecology of the organisms.
it is a challenge to see how far one can go in what might be termed 'reverse ecology'  <cit> : inferring from the structure of biological system information about the environment in which it evolved.

 biological systems often show modularity, in the sense that they can be separated into nearly-independent structural subsystems, each of which performs a specific function. the origin and preservation of modularity in biology is a subject of current interest. one approach to study the origin of modularity employs computer simulations of biological evolution. such simulations make random changes to a set of networks, and select those that best satisfy a given goal. simulations towards a constant goal usually lead to non-modular networks. even an initially modular network rapidly evolves connections that reduce modularity but increase fitness. this raises the question of which evolutionary forces can generate and maintain modular structure. one possible force that can lead to modularity was suggested by evolutionary simulations where the goal changes over time. modular networks spontaneously evolved when the goal changed with time in a way that preserves the same sub-goals but in different combinations. under such'modularly varying goals', the networks evolved and maintained modular structure, with a module for each sub-goal. when the goal changed, the connections between these modules were rapidly rewired to adapt to the new goal. here, we attempt to test these findings in a natural biological system, by asking whether there is a correlation between metabolic network's modularity and the variability of the environment in which it evolved. we concentrated on the metabolic networks of bacteria due to the availability and quality of the data. these networks can be systematically compared between species that live in environments that differ in their degree of variability. metabolic networks represent the set of biochemical metabolic reactions within a living cell. metabolic networks of diverse bacterial species have been reconstructed based on their genomic sequence and additional biochemical data. previous structural comparisons of metabolic networks focused on differences between kingdoms or phyla. here, we ask whether there exists a correlation between the degree of modularity of the metabolic network of an organism and the variability in its environment. we analyzed the metabolic networks of bacteria species living in broad range of habitats including oceans, salt lakes, thermal vents, soil and within hosts. the species were classified according to the degree of variability in their environment. we measured the modularity levels and additional related structural parameters of bacteria metabolic networks, finding that the level of variability in organism's environment correlates with the modularity of the networks: the more variable the environment, the more modular the metabolic network. our study therefore supports the view that environmental variability promotes modularity in biological networks.  classification of variability of bacterial environments the natural environment of bacterial species was classified based on the ncbi classification for bacterial lifestyle. the classification includes six classes: obligate bacteria that are obligately associated with a host, either intracellulary or extracellulary. an example is buchnera that lives in symbiosis inside aphids and has little contact with the outside world. specialized bacteria that live in specialized environments such as marine thermal vents. aquatic bacteria, that live in fresh or seawater environment, and are not associated with hosts. facultative bacteria, free living bacteria such as e. coli that often associate with a host. multiple bacteria, that live in multiple different kinds of environments such as bacteria with a wide host range, and terrestrial bacteria, that live in the soil. we ranked the variability of the different environments considering physical conditions and heterogeneity of species. obligate bacteria are thought to have the most constant environment as these bacteria live within a biochemically controlled and isolated environment, usually with only few other species or even no other species. specialized and aquatic bacteria are adapted to a strict realm of ecological conditions, yet their habitat is less protected and exhibits higher species heterogeneity than the obligate class. facultative bacteria that live both in hosts and in the outside world are exposed to a more variable environment than the former classes, but less variable than the multiple class that spans widely different habitats. finally, the terrestrial class is often considered the most variable class, since the soil is highly heterogeneous and has a diverse ecology. in addition to this qualitative ordering, we sought a quantitative measure that may reflect environmental variability. one such measure is the fraction of transcription factors out of the total number of genes in the organism. the reason for using this measure is that theoretical analysis based on cost-benefit analysis suggests that transcription factors are more strongly selected in variable environments than in constant ones. hence, more regulators per gene are expected the more variable the environment. it was shown that the benefit of a transcription factor is highest when it can appropriately regulate gene expression in response to environmental changes, offsetting the cost of production and maintenance of the transcription factor protein and associated sensory systems. studies by moran and colleagues indicate that under constant conditions, genes for transcription factors tend to be lost from the genome. genes of organisms in nearly constant conditions are deleted, or are constitutively expressed and do not require transcription control, as was experimentally demonstrated for buchnera and rickettsia. in agreement with the above, we find that the fraction of transcription factors, as well as their total number, increases with the expected variability of the bacterial lifestyle classification. note also that the size of the metabolic networks tends to increase with the expected variability of the environment. modularity of metabolic networks correlates with variability in the environment the metabolic networks of the different species were obtained from kegg database. in the networks, each metabolite is a node and edges represent metabolic reactions. we used a standard measure of modularity, to evaluate the modularity of each metabolic network. we find that modularity increases with the variability in the environment. the lowest modularity is found for the obligate class, higher modularity is found for the specialized and aquatic classes, and the highest modularity is found for facultative, multiple and terrestrial classes. we further considered a control for the effects of network size on modularity, by comparing metabolic networks of the same size. this was achieved by constructing subnetworks of each network containing n = nodes, comparable to the smallest networks in the dataset. these sub-networks were constructed by contracting linear pathways and cycles, and removing dangling nodes, until a network of the required size was obtained. we find that the modularity of these equal-sized metabolic networks also significantly increased with environmental variability. as a final control for the effect of network size, we computed the pearson partial correlation between modularity, environmental variability, and network size. we find that the correlation between modularity and variability is significant also when removing the effect of network size. each lifestyle class includes bacteria from different branches of the phylogenetic tree. we find low correlation between the similarity in the modularity of pairs of species and their distance on the phylogenetic tree. thus, modularity seems to be more correlated with environment than with evolutionary relatedness. we find that networks from species in constant environments tend to be more tree-like than those in variable environments. this can be quantitatively seen by considering two topological measures, betweenness-centrality and cyclic coefficients, both properly normalized to account for different network sizes. we find that the former increases and the latter decreases the more constant the environment, suggesting tree like structures. the tree-like structure seems to result from a lack of alternate metabolic paths in networks from constant environments. modules in organisms from variable environments are more functionally pure we used the newman-girvan algorithm to define structural modules in each network, and tested whether the identified modules correspond to well-defined metabolic functions. a structural module in a network was considered to be also a functional module if it was enriched for substrates that had a shared metabolic function such as: central metabolism, biosynthesis of amino acids, carbohydrates, lipids etc.. for each network we evaluated two measures: functionality, defined as the fraction of structural modules that were significantly enriched for a metabolic function, and coverage – the fraction of biological functions that could be mapped to structural modules. we find that the modules in networks of organisms from constant environments usually do not correspond to a defined metabolic function, but rather to mixtures of several biological categories. in contrast, the modules of networks from variable environment classes usually corresponded to a unique function and the majority of the metabolic functions could be assigned to at least one structural module. these results further indicate that the present approach for identifying modules yields modules that have biologically significant function. discussion this study indicates that variability in the environment correlates with enhanced modular organization of metabolic networks, while constant environment correlate with a less modular structure. one interpretation of these findings can be made in the context of previous simulation studies of evolution in modularly varying environments. the metabolic goal that a bacterium faces can be considered as a combination of sub-goals. an example of a sub-goal is the biosynthesis of an amino acid such as histidine. if histidine is missing in the environment, the bacterium must synthesize it. if histidine is present, the bacterium can down-regulate the biosynthesis pathway and instead import this metabolite. when the environment changes over time, it introduces a different combination of such metabolic sub-goals. simulations suggested that varying the sub-goals leads to the evolution of networks with a modular structure, where each module corresponds to one of the sub-goals. modular structure evolves despite the fact that it is less optimal than non-modular solutions. in contrast, evolution under a goal that is constant over time leads to non-modular networks, in which many nodes participate in several functions. the present findings may be interpreted within this context: bacteria that live under varying environments typically evolve a functional module for each of the varying sub-goals. bacteria under constant conditions tend to evolve towards a less modular design. it is interesting to note that some metabolic goals are held relatively constant even when the environment changes. an example is energy metabolism, which is needed for growth by all of the bacterial species studied, in all environments. analysis of the metabolic networks shows that the part of the network responsible for energy metabolism is less modular than other parts of the network. more generally, the fraction of the metabolic network devoted to constant goals seems to increases as the environment becomes more constant. an additional observation in the computer simulations is that initially modular networks rapidly degrade into non-modular but more optimal structures when the goal becomes constant over time. examples of such a degeneration of modularity can be seen by comparing the closely related species e. coli and buchnera. e. coli lives in a variable environment, moving between its mammalian host and the external world. buchnera lives in a more constant environment, as an endosymbiont of aphids. buchnera is found to fuse together pathways that are separate in e. coli, and thus to achieve its metabolic goals with a smaller set of enzymes. one example occurs in the histidine and purine modules. both modules convert the metabolic substrates prpp to aicar in two distinct parhways. e. coli seems to maintain these alternative pathways because under different environments only one of the pathways is utilized. for buchnera, on the other hand, as an endosymbiont that supplies amino-acids to its host, histidine biosynthesis is a fixed goal and under no regulation. here, the purine module can count on the histidine module for aicar production. the two pathways were thus combined into a single module, in which many of the genes are used for both functions. it would be interesting to uncover other mechanisms that degenerate or enhance modularity by comparing networks of closely related species with different environments. one limitation of the present study is the limited knowledge of metabolic networks for diverse species. the reconstructed networks, based on genomic data, were used to generate information about putative non-directed metabolic interactions. the present network representation ignore: i) directionality of reactions ii) reaction stochiometry iii) that only a fraction of the reactions are active under given environmental conditions. the above mentioned problems can be handled by more sophisticated network analyses. such studies employ correlated reaction sets as mathematically defined modules in biochemical reaction networks. they constitute groups of reactions in a network that always appear together in functional states of that network and therefore represent a functional module of the reaction network. previous work has shown that these sets can include non-obvious groups of reactions and differ from groupings of reactions based on structural analyses of network topology. one drawback of these latter approaches is that they require carefully annotated, genome-scale metabolic network, of which is only available for a handful number of species.  this study indicates that the modularity of metabolic networks correlates with the variability of the environment. such a correlation supports the view that variability in the natural habitat promotes modularity. it would be important to test this more fully as data on metabolic and regulatory networks of diverse species becomes more complete. we currently know more about the structure of metabolic networks than about the ecology of the organisms. it is a challenge to see how far one can go in what might be termed'reverse ecology': inferring from the structure of biological system information about the environment in which it evolved. 
to address this, we studied the relation between environmental variability and modularity in a natural and well-studied system, the metabolic networks of bacteria. we find that metabolic networks of organisms in variable environments are significantly more modular than networks of organisms that evolved under more constant conditions. this study supports the view that variability in the natural habitat of an organism promotes modularity in its metabolic network and perhaps in other biological systems. recent theory suggests that modularity can be enhanced when the environment changes over time. biological systems are often modular: they can be decomposed into nearly-independent structural units that perform specific functions.
 biological systems are often modular: they can be decomposed into nearly-independent structural units that perform specific functions. the evolutionary origin of modularity is a subject of much current interest. recent theory suggests that modularity can be enhanced when the environment changes over time. however, this theory has not yet been tested using biological data.  to address this, we studied the relation between environmental variability and modularity in a natural and well-studied system, the metabolic networks of bacteria. we classified bacterial species according to the degree of variability in their natural habitat. we find that metabolic networks of organisms in variable environments are significantly more modular than networks of organisms that evolved under more constant conditions.  this study supports the view that variability in the natural habitat of an organism promotes modularity in its metabolic network and perhaps in other biological systems. 