Fastgapfill

fastGapFill(consistMatricesSUX, epsilon, weights, weightsPerReaction)[source]

This function requires the fastCORE algorithm (Vlassis et al., 2013, http://arxiv.org/abs/1304.7992) as well as the output from prepareFastGapFill.

USAGE:

[AddedRxns] = fastGapFill (consistMatricesSUX, epsilon, weights, weightsPerReaction)

INPUTS:
  • consistMatricesSUX – Flux consistent SUX matrix to be obtained from prepareFastGapFill, with fields:

    • .rxns - n x 1 reaction identifiers of the SUX matrix

    • .C1 - Indices of the core (flux consistent model plus solvable blocked) reactions in consistMatricesSUX

    • .weights - n x 1 reaction weight vector assigned by assignRxnWeights from weights and weightsPerReaction

  • epsilon – Parameter for fastCore (optional input, default: getCobraSolverParams(‘LP’, ‘feasTol’)*100). Please refer to Vlassis et al. to get more details on this parameter.

  • weights – Weight structure that permits to add weights to non-core reactions (it is recommended to use values other than 0 and 1, with lower weight corresponding to higher priority, with fields:

    • .MetabolicRxns - Weight for universal database metabolic reactions (default: 10)

    • .ExchangeRxns - Weight for exchange reactions (default: 10)

    • .TransportRxns - Weight for transport reactions (default: 10)

    Optional input. Default: weigth of 10 for all non-core reactions.

  • weightsPerReaction – Optional input. Individual per-reaction weights, with fields:

    • .rxns - Cell array of reaction identifiers to assign individual weights to (default: empty)

    • .weights - Weights corresponding to .rxns, in the same order (default: empty)

OUTPUT:

AddedRxns – Reactions that have been added from UX matrix to S

generateSUXMatrix(model, dictionary, KEGGFilename, KEGGBlackList, compartment, addModel)[source]

Creates the matrices for matlab smiley – > combines S, U, (KEGG), X (transport)

USAGE:

MatricesSUX = generateSUXMatrix (model, dictionary, KEGGFilename, KEGGBlackList, compartment, addModel)

INPUTS:
  • model – COBRA model structure, with fields:

    • .mets - m x 1 metabolite identifiers

    • .rxns - n x 1 reaction identifiers

    • .lb - n x 1 lower flux bounds (used to count reversible reactions)

    • .subSystems - n x 1 reaction subsystem annotations

    • .RxnSubsystem - set internally from .subSystems before merging with the universal database and exchange/transport matrices; not required as input

  • dictionary – Dictionary used to transform the KEGG model

OPTIONAL INPUTS:
  • KEGGFilename – File name containing KEGG database

  • KEGGBlackList – Contains black list, default = {}

  • compartment – [c] –> transport from cytoplasm [c] to extracellulat space [e] (default), [p] creates transport from [c] to [p] and from [p] to [c], if ‘’ - no exchange reactions/transport will be added to the matrix.

  • addModel – model structure, containing an additional matrix or model that should be combined with SUX matrix. Note that the naming of metabolites in this matrix has to be identical to model naming. Also, the list should be unique.

OUTPUT:
MatricesSUX – Combined SUX matrix structure (S, U, X),

converted to an irreversible model, with .MatrixPart indicating the origin of each reaction (1 - model reactions, 2 - KEGG reactions, 3 - exchange/transport reactions)

identifyBlockedRxns(model, epsilon)[source]

This function computes all blocked reactions using the approach described in The FASTCORE algorithm for context-specific metabolic network reconstructions, Vlassis et al., 2013, PLoS Comp Biol.`

USAGE:

[consistModel, BlockedRxns] = identifyBlockedRxns (model, epsilon)

INPUTS:
  • model – Model structure, with field:

    • .rxns - n x 1 reaction identifiers, used to determine the consistent/inconsistent reaction sets

  • epsilon – Parameter (default: getCobraSolverParams(‘LP’, ‘feasTol’)*100; see Vlassis et al for more details)

OUTPUT:
  • consistModel – Flux consistent model that does not contain any blocked reactions anymore

  • BlockedRxns – Structure containing all blocked reactions and their reaction formula that were in model

postProcessGapFillSolutions(AddedRxns, model, BlockedRxns, IdentifyPW)[source]

This function uses the output from fastGapFill and signs generalized function to the identified solutions from the universal database (e.g., ‘Metabolic reaction’, ‘Transport reaction’, ‘Exchange reaction’). It also provides basic statistics for the solution. One can use the option ‘IdentifyPW’ to compute for each solved blocked reaction a flux vector, such that the flux through this reaction is maximized while the sum of all fluxes is minimized. This analysis can be helpful to put the solution reactions into the network context.

USAGE:

[AddedRxnsExtended] = postProcessGapFillSolutions (AddedRxns, model, BlockedRxns, IdentifyPW)

INPUTS:
  • AddedRxns – Output from fastGapFill.m, with fields:

    • .rxns - k x 1 identifiers of the added reactions

    • .rxnFormula - k x 1 reaction formulas of the added reactions

  • model – Model structure. Original model given as input into prepareFastGapFill

  • BlockedRxns – Structure of previously blocked reactions, to be obtained from prepareFastGapFill, with fields:

    • .solvableRxns - Identifiers of the previously blocked reactions solved by gap filling

    • .solvableFormula - Reaction formulas corresponding to .solvableRxns

  • IdentifyPW – Optional: identifies reactions that are need from consistent model and added reactions to have flux through previously blocked reaction, default: false

OUTPUT:

AddedRxnsExtended – Structure containing the information present in AddedRxns along with the statistics and if desired pathways containing the flux vectors, with additional fields:

  • .subSystem - Assigned reaction category (e.g. ‘Metabolic reaction’, transport, or exchange) for each entry in .rxns

  • .Stats - Counts of metabolic/transport/exchange solutions found (.metabolicSol, .transportSol, .exchangeSol)

  • .solvableRxnsSol - (if IdentifyPW) per solved blocked reaction, the flux vector solution

  • .Problem - (if IdentifyPW) reactions for which no flux-carrying solution could be identified

prepareFastGapFill(model, listCompartments, epsilon, filename, dictionary_file, blackList)[source]

This function generate the input file (consistMatricesSUX) for fastGapFill.m. Please refer to Thiele et al, 2013 for more details. This function is based on the fastCORE algorithm (Vlassis et al., 2013).

USAGE:

[consistModel, consistMatricesSUX, BlockedRxns] = prepareFastGapFill (model, listCompartments, epsilon, filename, dictionary_file, blackList)

INPUTS:
  • model – Model structure, with field:

    • .mets - m x 1 metabolite identifiers (used to derive the default listCompartments)

  • listCompartments – List of intracellular compartments in the model (optional input, default compartments to be considered: ‘[c]’,’[m]’,’[l]’,’[g]’,’[r]’,’[x]’,’[n]’)

  • epsilon – Parameter for fastCore (optional input, default: 1e-4). Please refer to Vlassis et al. to get more details on this parameter.

  • filename – File name containing universal database (e.g., KEGG; optional input, default: reaction.lst)

  • dictionary_file – List of universal database IDs and their counterpart in the model (optional input, default: KEGG_dictionary.xls)

  • blackList – List of excluded reactions from the universal database (e.g., KEGG) (optional input, default: no blacklist)

OUTPUT:
  • consistModel – Flux consistent subnetwork of the input model

  • consistMatricesSUX – Flux consistent SUX matrix, which contains the flux consistent S matrix (model), the universal database placed in all cellular compartments along with transport reactions for each metabolite from cytosol to compartment and exchange reactions for all extracellular metabolites.

  • BlockedRxns – Blocked reactions in mode%

submitGapFill(swift, modelFile, dbFile, dictionaryFile, prepareFGFResults, weightsPerRxnFile, forceRerun, epsilon, blackList, listCompartments)[source]

A test function for prepareFastGapFill, swiftGapFill, and fastGapFill, allowing all files to be optionally specified and not requiring prepareFastGapFill to be rerun (if relevant variables are saved in a specified workspace file) if it has already been run.

This function performs three runs of fastGapFill or swiftGapFill on the same prepared model, with weights as specified in the ‘Define Runs’ section of the code. The ‘runs’ variable can be appended to or changed to enable the running of `fastGapFill or swiftGapFill for different combinations of weights (and different weightsPerRxnFile files).

This function draws inspiration heavily from the example already available for fastGapFill, i.e. runGapFill_example.m

N.B. The defaults are set for testing all of the functionality of the algorithm, including setting a (toy) weight file, which is not necessary in running fastGapFill or swiftGapFill so should be specified as empty if running without a weight file.

All inputs are optional, defaults to E. coli model iAF1260 and example files)

USAGE:

[AddedRxns] = submitGapFill (swift, modelFile, dbFile, dictionaryFile, prepareFGFResults, weightsPerRxnFile, forceRerun, epsilon, blackList, listCompartments)

OPTIONAL INPUTS:
  • swift – Boolean specifying whether to run swiftGapFill or fastGapFill (default: false)

  • modelFile – File containing model, either .mat or .xml (default: ‘examples/iAF1260.mat’, relative to this function’s own folder)

  • dbFile – File containing universal database (default: ‘AuxillaryFiles/reaction.lst’, relative to this function’s own folder)

  • dictionaryFile – File containing db metabolite IDs and model counterparts, either .xls or .tsv (default: ‘AuxillaryFiles/KEGG_dictionary.xls’, relative to this function’s own folder)

  • prepareFGFResults – File for storing/loading prepareFastGapFill results (default: ‘tutorials/reconstruction/fastGapFill/example/prepareFGFResultsDefault.mat’, relative to CBTDIR)

  • weightsPerRxnFile – File containing individual weights for reactions (default: ‘examples/sampleWeights.tsv’)

  • forceRerun – Boolean specifying whether to rerun prepareFastGapFill even if it has already been run. N.B. If this is set to ‘true’ it will overwrite the precalculated default results files, unless prepareFGFResults is specified outside the examples directory (default: false)

  • epsilon – Float, a fastCore parameter (default: getCobraSolverParams(‘LP’, ‘feasTol’)*100)

  • blackList – List of excluded universal DB reactions (default: none)

  • listCompartments – List of compartments in the model to be gapFilled N.B. the default is set within prepareGapFill (default: all compartments specified in the model)

OUTPUT:

AddedRxns – Reactions that have been added from UX matrix to S

swiftGapFill(consistMatricesSUX, tol, weights, weightsPerReaction)[source]

This function requires the swiftcore algorithm as well as the output from prepareFastGapFill.

USAGE:

[reconstruction, AddedRxns] = swiftGapFill (consistMatricesSUX, tol, weights, weightsPerReaction)

INPUT:

consistMatricesSUX – Flux consistent SUX matrix to be obtained from prepareFastGapFill, with fields:

  • .rxns - n x 1 reaction identifiers of the SUX matrix

  • .C1 - Indices of the core (flux consistent model plus solvable blocked) reactions in consistMatricesSUX

  • .weights - n x 1 reaction weight vector assigned by assignRxnWeights from weights and weightsPerReaction

OPTIONAL INPUTS:
  • tol – Parameter for swiftcore (default: 1e-10).

  • weights – Weight structure that permits to add weights to non-core reactions It is recommended to use values other than 0 and 1, with lower weight corresponding to higher priority, with fields:

    • .MetabolicRxns - Weight for universal database metabolic reactions (default: 10)

    • .ExchangeRxns - Weight for exchange reactions (default: 10)

    • .TransportRxns - Weight for transport reactions (default: 10)

    Default: weigth of 10 for all non-core reactions.

  • weightsPerReaction – Optional input. Individual per-reaction weights, with fields:

    • .rxns - Cell array of reaction identifiers to assign individual weights to (default: empty)

    • .weights - Weights corresponding to .rxns, in the same order (default: empty)

OUTPUTS:
  • reconstruction – The flux consistent metabolic network structure reconstructed from the core reactions by swiftcore

  • AddedRxns – Reactions that have been added from UX matrix to S