Auxillaryfiles

LP9weighted(W, K, P, model, LPproblem, epsilon)[source]

Solves a weighted variant of the LP9 problem from the FASTCORE algorithm (Vlassis et al., 2013): given an existing LP problem, minimizes the weighted L1 norm of the flux through the candidate reactions P subject to the flux through the core reactions K being at least epsilon.

USAGE:

V = LP9weighted (W, K, P, model, LPproblem, epsilon)

INPUTS:
  • Wn x 1 nonnegative weight vector (penalizes reactions in P with a higher weight more strongly)

  • K – Indices of the core reactions required to carry a flux of at least epsilon

  • P – Indices of the candidate reactions whose weighted flux magnitude (W(P) .* v(P)) is minimized

  • model – Model structure, with field:

    • .S - m x n stoichiometric matrix (only its size is used)

  • LPproblem – LP problem structure to extend, with fields:

    • .A - m2 x n2 linear constraint matrix

    • .b - m2 x 1 right hand side vector for A*x = b

    • .lb - n2 x 1 lower bound vector

    • .ub - n2 x 1 upper bound vector

    • .csense - m2 x 1 character array of constraint senses (E, G, or L)

  • epsilon – Minimum required flux through the reactions in K

OUTPUT:

Vn x 1 flux vector solving the weighted LP9 problem, restricted to the first n variables, or an n x 1 vector of NaN if no solution vector was returned

assignRxnWeights(MatricesSUX, weights, WeightsPerRxn, NoWeight)[source]

Assigns reaction weights

USAGE:

MatricesSUX = assignRxnWeights (MatricesSUX, weights, WeightsPerRxn, NoWeight)

INPUTS:
  • MatricesSUX – Input model structure, with field:

    • .MatrixPart - n x 1 vector indicating the origin of each reaction (1 - model, 2 - KEGG, 3 - exchange/transport)

  • 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. Format:

    • weights.MetabolicRxns = 10; % Universal database metabolic reactions

    • weights.ExchangeRxns = 10; % Exchange reactions

    • weights.TransportRxns = 10; % Transport reactions

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

  • WeightsPerRxn – Structure containing a list of reactions that should be assined with individual weights (WeightsPerRxn.rxns) AND a list of Reaction weights (WeightsPerRxn.weights) in the same order.

  • NoWeight – Weight that should be assigned to those reactions NOT in core reaction set and NOT in WeightsPerRxn (default:1000)

OUTPUT:

MatricesSUX – Output model structure

createUniversalReactionModel2(KEGGFilename, KEGGBlackList)[source]

Creates the U matrix using the universal data from the KEGG

USAGE:

KEGG = createUniversalReactionModel2 (KEGGFilename, KEGGBlackList)

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

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

OUTPUT:

KEGG – Contains universal database (U matrix) in matrix format

Note

This file is KEGG-specific: if non-KEGG-type metabolite IDs are used it will not parse the reactions correctly and will throw an error.

createXMatrix2(compoundsIn, transport, compartment, model)[source]

Creates a matrix full of exchange reactions based on the input list (creates an exchange reaction for each of the metabolites present in the model)

USAGE:

ExchangeRxnMatrix = createXMatrix2 (compoundsIn, transport, compartment, model)

INPUTS:
  • compoundsIn – List of metabolites

  • transport – if 1, transport reactions will be defined as well for every compounds (default: 0, which corresponds to only exchange reactions)

  • compartment – [c] –> transport from cytoplasm [c] to extracellular space [e] (default), [p] creates transport from [c] to [p] and from [p] to [c]

  • model – model structure - used to check if exchange reaction exists already before adding it to ExchangeRxnMatrix, with field:

    • .mets - m x 1 metabolite identifiers

OUTPUT:

ExchangeRxnMatrix – Model structure containing all exchange and transport reactions

findIntracellularRxns(model)[source]

This function finds all reactions that do not contain metabolites in [e] comparment.

USAGE:

[intracellRxnList] = findIntracellularRxns (model)

INPUT:

model – Model structure, with field:

  • .rxns - n x 1 reaction identifiers

OUTPUT:

intracellRxnList – List of intracellular reactions in model

generateSUXComp(model, dictionary, KEGGFilename, KEGGBlackList, listCompartments, KEGGMatrixLoad)[source]

Creates the matrices for gap filling for compartmentalized metabolic models (S) such that the universal database (U, e.g., KEGG) is placed in each compartment specified and reversible transport reactions (X) are added for each compound present in U and S, between the compartment and the cytosol. Additionally, exchange reactions are added for each metabolite in the extracellular space.

USAGE:

MatricesSUX = generateSUXComp (model, dictionary, KEGGFilename, KEGGBlackList, listCompartments, KEGGMatrixLoad)

INPUTS:
  • model – Model structure, with fields:

    • .mets - m x 1 metabolite identifiers

    • .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 – List of universal database IDs and their counterpart in the model (e.g., KEGG_dictionary.xls)

  • KEGGFilename – File name containing the universal database (e.g., KEGG - reaction.lst)

  • KEGGBlackList – List of excluded reactions from the universal database (e.g., KEGG)

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

  • KEGGMatrixLoad – load precomputed KEGG matrix (default: 0)

OUTPUT:

MatricesSUX – SUX matrix

Based on generateSUX.m but updated and expanded for compartmentalized gap filling efforts.

  • Ines Thiele, Jan 2021, added the option to preload KEGG matrix and

KeggExchangeRxnMatrix, if multiple reconstructions will be tested this is faster