Met2MetGraph | R Documentation |
This function loads a metabolic model and returns a metabolic graph having metabolites as nodes and edges connecting reagents to products.
Met2MetGraph( infile, catalyzed, rmMets, recMets_list, exprDir, delim, simpl, GPRparse, outDir, outFormat, directed, add_rev_rxn, plot )
infile |
Path to the input SBML file |
catalyzed |
logical value indicating whether only reactions catalyzed by enzymes must be considered. Default TRUE. |
rmMets |
logical value indicating whether the recurring metabolites must be removed. Default TRUE. |
recMets_list |
a list of recurring metabolite names. The format must be the same of the model. If not provided and rmMets=TRUE the list used is the one provided by the package "system.file("extdata", "metNames.txt", package = "Met2Graph")". |
exprDir |
path to directory containing expression data for each sample. Test data in "system.file("extdata/expression/", package = "Met2Graph")". Expression files must contain two columns, one for gene id (corresponding to the ids contained into the metabolic model, usually ENSEMBL ids) and one for expression values. If the ENSEMBL id contains the version, this latter will be ignored. |
delim |
column separator of expression files. Default tab. |
simpl |
logical value indicating whether the simplification of multiple edges must be applied. If TRUE, GPRparse parameter needs to be set. Default TRUE. |
GPRparse |
Character string indicating the method for GPR parsing. meanSum, minMax, minSum are implemented. Default meanSum. |
outDir |
path to output directory. If not provided outputs will be written in "system.file("extdata/output/", package = "Met2Graph")". |
outFormat |
character string indicating the format of the graph to export. Default "ncol". For other formats and details please see write.graph function of igraph package. |
directed |
Logical value, indicating if the graph must be created directed. Default TRUE. |
add_rev_rxn |
Logical value, whether or not reversible reactions must be considered and edges written in both directions. If FALSE it takes into account the direction as present in the stoichiometric matrix, for general models it is usually forced from left to right In case of condition-specific models obtained through FBA this is not necessary. Default FALSE. |
Builds a metabolites-based graph from the metabolic model. The metabolites are connected by reactions and, if present, by the relative catalyzing enzymes. Two metabolites are connected if, in one or multiple reactions, one is a substrate and the other one is a product. The gene-protein-reaction (GPR) associations are automatically extracted from the model. If not present, those extracted from the human generic GEM are used.
If the parameter catalyzed is TRUE, only reactions with associated enzymes are kept.
If gene expression data are provided each edge represented by the enzymes catalyzing the reactions is weighted by the expression values.
The resulting graph can be obtained with multiple edges corresponding to the multiple enzymes connecting the two metabolites or can be simplified to single edges, the choice is indicated by the parameter "simpl", where a logical value is required.
Several methods of simplification are proposed, and can be indicated through the parameter "GPRparse". For this parameter three options are possible: 1) "meanSum": for each edge expression values of enzymes acting in the same reaction are averaged, and these averages are then summed up for enzymes acting in different reactions; 2) "minMax": according to the GPR associations, enzymes catalyzing the same reaction are associated by "AND" or "OR" logical relationships based on complex or mutual exclusive activity respectively. For each edge the weight is given by the minimum expression value of enzymes related by "AND" and the maximum value for "OR", again the values of enzymes acting in different reactions are summed up; 3) "minSum": according to the GPR associations, enzymes catalyzing the same reaction are associated by "AND" or "OR" logical relationships based on complex or mutual exclusive activity respectively. For each edge the weight is given by the minimum expression value of enzymes related by "AND" and the summed value for "OR", again the values of enzymes acting in different reactions are summed up.
If the parameter add_rev_rxn is set to TRUE, each edge will be duplicated in both directions in case of reversible reactions.
Recurring metabolites (e.g. ATP, CO2, NADP) can be removed to avoid unrealistic paths setting the parameter "rmMets"==TRUE and using the list of these compounds contained in the data of the package by default or one provided by the user through parameter "recMets".
The resulting graph can be built directed or not. Given the rules behind the definition of connections it is naturally directed but the user can choose to not consider this aspect, setting the "directed" parameter to FALSE.
A metabolic graph with metabolites as nodes and reactions/enzymes as edges in the format chosen by the user. If expression values are present the edges are weighted by them, and one graph per each sample is returned. A tsv file with edges and expression values of each sample is also generated.
## Not run: infile <- system.file("extdata", "kidney.xml", package = "Met2Graph") exprDir <- system.file("extdata/expression/", package = "Met2Graph") outDir <- system.file("extdata/output/", package = "Met2Graph") Met2MetGraph(infile, catalyzed = TRUE, rmMets = TRUE, exprDir=exprDir, simpl = TRUE , GPRparse = "meanSum", outDir=outDir, outFormat = "ncol", directed=TRUE, add_rev_rxn=FALSE, plot=FALSE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.