Surfnetsubfunctions

generateGrRules(model, hyperlinkCommand)[source]

Generate model.grRules consistent with model.rules and model.genes, with an additional function of adding a field *.grRulesLinked in which the genes in the rules are hyperlinked with the provided command when displayed in the Matlab command window (used by surfNet.m).

USAGE

model = generateGrRules (model, hyperlinkCommand)

INPUT

model – COBRA model

OPTIONAL INPUT

hyperlinkCommand – a string of Matlab command for the genes in the model e.g., ‘fprintf(‘’%s’’)’ where %s will be replaced by the gene (default [], not adding the field for hyperlinked grRules)

OUTPUT

model – COBRA model updated with *.grRules, and *.grRulesLinked if hyperlinkCommand is a non-empty string

isValidPrintFields(fields)[source]

Subroutine called by surfNet for validating the input for printFields (fields to be printed when calling surfNet)

USAGE

flag = isValidPrintFields (fields)

INPUT

fields – field content from a COBRA model

OUTPUT

flag – true if the content can be printed by surfNet

numToFormattedString(num, ordMagMin, ordMagMax, nChar, cellOutput)[source]

Convert numerical values in Matlab into formatted strings within a maximum of characters with format specific to the order of magnitude of the values. For values larger or small than the thresholds, scientific notation is used, otherwise decimal expression.

USAGE

s = numToFormattedString (num, ordMagMin, ordMagMax, cellOutput)

INPUT

num – array of numerical values

OPTIONAL INPUTS
  • ordMagMin – order of magitude below which the formatted string is in scientific notation (default -6, i.e., for values < 1e-6)

  • ordMagMin – order of magitude above which the formatted string is in scientific notation (default 8, i.e., for values >= 1e8)

  • nChar – number of character in the converted string, excluding the sign (default 8)

  • cellOutput – true to have the output being a single cell of string if the input num is scalar, otherwise a string (default false)

OUTPUT

str – the formatted string or cell array of strings

Print a string hyperlinked to running a Matlab command when displayed in the Matlab command window. Called by surfNet.m

USAGE

p = printHyperlink (command, linkWord, wordLength, printFlag)

INPUTS
  • command – A string containing a matlab command (e.g., fprintf(‘abcn’))

  • linkWord – the text that is being printed and hyperlinked

OPTIONAL INPUTS
  • wordLength – the length of the formatted string (default 0, the length of linkWord)

  • printFlag – true to print and return the string, false to return the string only

OUTPUT

p – the hyperlinked string

printMetRxnInfo(metRxnInfo, firstFieldWtComma, printFieldName, fieldNameExcluded, ordMagMin, ordMagMax, nCharMax)[source]

Called by surfNet.m for printing information about a metabolite or reaction

USAGE

printMetRxnInfo (metRxnInfo, firstFieldWtComma, printFieldName, fieldNameNotPrinted, ordMagMin, ordMagMax, nCharMax)

INPUTS
  • metRxnInfo – 2-by-N cell array for N fields to be printed. The first row contains the field names and the second row contains the corresponding information for a particular metabolite/reaction to be printed

  • firstFieldWtComma – a positive integer indicating after which field has been printed, start adding a comma separating each field

  • printFieldName – true to print field names, false not to.

  • fieldNameExcluded – fields whose field names are not printed (useful only if printFieldName = true)

  • ordMagMin – min. order of magnitude to be used when calling numToFormattedString.m

  • ordMagMax – max. order of magnitude to be used when calling numToFormattedString.m

  • nCharMax – max. number of characters to be used when calling numToFormattedString.m

printRxnFormulaLinked(model, rxnAbbrList, printFlag, metNameFlag, flux, nCharBreak, commandUsingMet)[source]

print reaction formulae in which the metabolites are hyperlinked to run a specific command involving the metabolites when displayed in the Matlab command window. Called by surfNet.m.

USAGE

p = printRxnFormulaLinked (model, rxnAbbrList, printFlag, metNameFlag, flux, nCharBreak, commandUsingMet)

INPUTS

model – COBRA model

OPTIONAL INPUTS
  • rxnAbbrList – cell array of reactions to be printed (default all reactions)

  • printFlag – true to print, otherwise return the strings only (default true)

  • metNameFlag – true to display met names in *.metNames instead of *.mets (default false)

  • flux – the flux of the reaction. When non-empty, determine the arrow for the formula accordingly

  • nCharBreak – max. number of character printed on each line

  • commandUsingMet – string of Matlab command for the genes in the model, e.g., ‘fprintf(‘’%s’’)’ where %s will be replaced by the metabolites (default [], not adding the field for hyperlinked grRules)