Here we show several examples of analysis than can be made using PyNetMet with different metabolic modes. The models used here are:
The first model is available here in its OptGene format, for the other two models we present links to the journal where they are published where one can download the models from the additional materials in SBML format.
Let's start with examples on how to create Enzyme objects:
in this example one defines the variable enz1 which contains the reaction whose name is reac1, where one molecule of A combines with two molecules of B to result in one molecule of C and one of D. One should always put spaces surrounding the ":", "->" and "+" signs, otherwise the symbols might get confused with the metabolite names.
The representation of an enzyme object will be its initial string, but with numbers transformed to float type. Note the following examples:
from these examples one should note that it is possible to use spaces in the metabolite names, but the Enzyme class will remove these spaces from the names. One can also use symbols like "+" or "-".
The first step to analyse any metabolic model is to load it as a Metabolism object:
The class Metabolism creates a new pathway for the transport reactions in the model:
The iCM925 model, for instance, is reported to have 938 reactions and 881 metabolites, while the object cbe has 957 reactions and 900 metabolites. The difference (19) is the number of transport reactions in the _TRANSPORT_ pathway.
Each metabolic model has an attribute called net which is the network formed by its metabolites. In the example below we show how to use it to produce the plots for the topological overlap of nodes in each network. For each model we make three plots, the first with the arbitrary order in which the nodes appear in the model, then with the nodes ordered by the Kruskal algorithm and finally with the algorithm contained in the Network object.
These commands should produce the nine plots below. One can clearly see the increase of quality in the clustering from the figures in the left (random ordering) to the right (ordering according to the algorithm implemented in PyNetMet.network class).
Model | Unsorted | Sorted with Kruskal | Sorted with Network class |
---|---|---|---|
iSyn811 | |||
iCM925 | |||
iAK692 |
The average clustering for each network can be easily obtained:
Another interesting analysis that can be made using the methods from the Network class are the search for disconnected components or the study of paths between the nodes of the metabolic network. Once the method components is called for a network, apart from the disc_comps attribute, it automatically creates two new attributes, dists and paths that contain the shortest distances and paths in between any two nodes of the network.
The attribute disc_comps is a list with the list of nodes in each disconnected component of the network. In the above example we printed the number of nodes in each component, which shows us the giant component (976 metabolites) that comprises the metabolism, and 5 other components which are the result of reactions disconnected from the main metabolism and that could be removed from the metabolic model. The metabolism method bad_reacs removes these reactions and also reactions where one product and one substrate only appear once in the whole metabolism, indicating that these reactions are also poorly connected to the main component.
For the other networks:
In the above examples the network under study is the one composed only by the metabolites in each metabolic model. One can chose to work with the bipartite network formed by metabolites and reactions. In the following examples we build this network in order to study paths between metabolites.
In this example we calculated the shortest path from glucose to pyruvate: it goes through reaction 2.7.1.2b, which has ADP as product and ADP is substrate in reaction 2.7.1.40a that produces pyruvate. Note that if one prints paths[ipyr] the numbers that one sees are [4, 990, 3, 1003, 21]. The numbers 3, 4 and 21 correspond to the positions of ADP, alpha-D-glucose and pyruvate in the list syf.metabol, but the numbers that correspond to reactions 2.7.1.2b and 2.7.1.40a in the list syf.enzymes are not 990 and 1003, but instead 1 (990-syf.nmets) and 14 (1003-syf.nmets).
Metabolites that could not be reached from glucose are marked with the symbol "X" in the dists list:
Here we see that 221 metabolites could not be reached from glucose. From those that could be reached, the average shortest path is around 5.788 and the furthest metabolite reached by glucose is Astxbm which is 20 nodes away.
Having a Metabolism object definined with a metabolic model, one only has to call the FBA in order to perform a FBA analysis: