dfba.library

Functions to add a given DfbaModel to the dynamic library.

Module Contents

Functions

WriteIndent(theFile: TextIO, indentCount: int, text: str) → None

Write indent.

indices(nrow: int, reactions: cobra.DictList, reaction_id: str) → List[int]

Write indices.

col_indices(reactions: cobra.DictList, reaction_id: str) → List[int]

Write column indices.

ctrl_parm_expression(ctrl_parms: Dict, change_pnts: List) → str

Control paramter expression.

create(directory: str) → None

Create library.

write_model_to_file(name: str, kinetic_variables: cobra.DictList, exchange_fluxes: cobra.DictList, nexc: int, nreq: int, exchange_indices: List[int], change_pnts: List, directory: str) → None

Write DfbaModel to file.

dfba.library.WriteIndent(theFile: TextIO, indentCount: int, text: str)None[source]

Write indent.

Parameters
  • theFile (file) – Open cpp file.

  • indentCount (int) – Number of tabs to indent.

  • text (string) – The line of text to write to file.

dfba.library.indices(nrow: int, reactions: cobra.DictList, reaction_id: str)List[int][source]

Write indices.

Parameters
  • nrow (int) – Number of rows in LP problem.

  • reactions (DictList) – A DictList where the key is the reaction identifier and the value a cobra.Reaction object.

  • reaction_id (string) – Identifier of the reaction to return indices for.

Returns

indices – lpindices of forward and reverse reaction.

Return type

list

dfba.library.col_indices(reactions: cobra.DictList, reaction_id: str)List[int][source]

Write column indices.

Parameters
  • reactions (DictList) – A DictList object where the key is the reaction identifier and the value a cobra.Reaction object.

  • reaction_id (string) – Identifier of the reaction to return column indices for.

Returns

indices – Column indices of forward and reverse reaction.

Return type

list

dfba.library.ctrl_parm_expression(ctrl_parms: Dict, change_pnts: List)str[source]

Control paramter expression.

Parameters
  • ctrl_parms (dict) – A dict of control parameters to be included in expression.

  • change_pnts (list) – Ordered list of change points from control parameters in model.

Returns

control_expression – The control parameter expression.

Return type

string

dfba.library.create(directory: str)None[source]

Create library.

Parameters

directory (string) – Path to temporary directory containing library.

dfba.library.write_model_to_file(name: str, kinetic_variables: cobra.DictList, exchange_fluxes: cobra.DictList, nexc: int, nreq: int, exchange_indices: List[int], change_pnts: List, directory: str)None[source]

Write DfbaModel to file.

Parameters
  • name (string) – str of DfbaModel id

  • kinetic_variables (DictList) – A DictList object where the key is the kinetic variable identifier and the value a KineticValue object.

  • exchange_fluxes (DictList) – A DictList object where the key is the exchange flux identifier and the value an ExchangeFLux object.

  • nexc (int) – Number of exchange fluxes.

  • nreq (int) – Number of fluxes required to define ODE right-hand side.

  • exchange_indics (list) – Indices of exchange fluxes.

  • change_pnts (list) – Ordered list of change points from control parameters in model.

  • directory (string) – Path to temporary directory containing library.