New

createGroupIncidenceMatrix(model, trainingModel, param)[source]

Build a combined group (fragment) incidence matrix for a test model and the training model, as used by the component contribution method

USAGE:

combinedModel = createGroupIncidenceMatrix (model, trainingModel, param)

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

    • .mets - m x 1 cell array of metabolite identifiers

    • .inchi - structure whose .nonstandard field is an m x 1 cell array of nonstandard InChI

  • trainingModel – training data model structure with fields:

    • .S - p x n stoichiometric matrix of the training data

    • .mets - p x 1 metabolite abbreviations

    • .rxns - n x 1 reaction abbreviations

    • .metKEGGID - p x 1 cell array of metabolite KEGG IDs

    • .inchi - structure whose .nonstandard field is a p x 1 cell array of nonstandard InChI

    • .cids_that_dont_decompose - KEGG compound IDs that do not decompose (manual fragmentation)

    • .groups - g x 1 cell array of group definitions (written)

    • .G - p x g group incidence matrix (written)

    • .groupDecomposableBool - p x 1 boolean of group-decomposable metabolites (written)

    • .trainingMetBool - p x 1 boolean flagging training metabolites (written)

    • .testMetBool - p x 1 boolean flagging test metabolites (written)

OPTIONAL INPUT:

param – structure of parameters with fields:

  • .printLevel - verbosity level (default 0)

  • .fragmentationMethod - ‘abinito’ (default) or ‘manual’

  • .modelCache - cache filename for the test-model fragmentation

  • .radius - number of bonds around each central atom (default 1)

  • .dGPredictorPath - absolute path to a clone of dGPredictor

  • .canonicalise - boolean, canonicalise SMILES fragments (default 0)

OUTPUT:

combinedModel – combined model structure (training padded with test-only metabolites), with fields including:

  • .S - k x n stoichiometric matrix

  • .G - k x g group incidence matrix

  • .groups - g x 1 cell array of group definitions

  • .mets - k x 1 cell array of metabolite identifiers

  • .rxns - n x 1 reaction abbreviations

  • .inchi - structure whose .nonstandard field is a k x 1 cell array of nonstandard InChI

  • .groupDecomposableBool - k x 1 boolean of group-decomposable metabolites

  • .inchiBool - k x 1 boolean of metabolites with an InChI

  • .trainingMetBool - k x 1 boolean flagging training metabolites

  • .testMetBool - k x 1 boolean flagging test metabolites

  • .test2CombinedModelMap - m x 1 mapping of model.mets to combinedModel.mets

getGroupVectorFromInchi(inchi, printLevel)[source]

Decompose an InChI into a group-contribution vector via the inchi2gv python script

USAGE:

group_def = getGroupVectorFromInchi (inchi, printLevel)

INPUT:

inchi – InChI string of the metabolite to decompose

OPTIONAL INPUT:

printLevel – verbosity level (default 0): 0 no output, 1 progress only, 2 progress and warnings

OUTPUT:

group_def – row vector of group counts (the group-contribution vector), empty if the InChI cannot be decomposed

getMappingScores(model, trainingModel)[source]

Finds the best mapping between the model metabolites and the training model metabolites, the higher the confidence score, the more reliable the mapping

USAGE:

mappingScore = getMappingScores (model, trainingModel)

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

    • .mets - m x 1 cell array of metabolite identifiers

    • .inchi - structure of InChI strings, with fields .standard, .standardWithStereo and .standardWithStereoAndCharge (each m x 1 cell arrays)

  • trainingModel – training COBRA model structure with fields:

    • .metKEGGID - p x 1 cell array of metabolite KEGG IDs

    • .inchi - structure of InChI strings, with fields .standard, .standardWithStereo and .standardWithStereoAndCharge (each p x 1 cell arrays)

OUTPUT:

mappingScorenMet x nTrainingMet sparse matrix giving the best mapping score between model and training metabolites (higher is more reliable)

regulariseGroupIncidenceMatrix(combinedModel, printLevel)[source]

Identify similar and duplicate metabolites in the combined model, comparing group-decomposition vectors and InChI, to regularise the group incidence matrix

USAGE:

[groupM, inchiM] = regulariseGroupIncidenceMatrix (combinedModel, printLevel)

INPUT:

combinedModel – combined model structure with fields:

  • .G - k x g group incidence matrix

  • .inchi - structure whose .nonstandard field is a k x 1 cell array of nonstandard InChI

  • .inchiBool - k x 1 boolean of metabolites with an InChI

  • .trainingMetBool - k x 1 boolean flagging training metabolites

  • .testMetBool - k x 1 boolean flagging test metabolites

  • .mets - k x 1 cell array of metabolite identifiers

OPTIONAL INPUT:

printLevel – verbosity level (default 0)

OUTPUTS:
  • groupMnMet x nMet logical matrix, true where two metabolites share a group decomposition

  • inchiMnMet x nMet logical matrix, true where two metabolites share an InChI