:mod:`dfba.library` =================== .. py:module:: dfba.library .. autoapi-nested-parse:: Functions to add a given `DfbaModel` to the dynamic library. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: dfba.library.WriteIndent dfba.library.indices dfba.library.col_indices dfba.library.ctrl_parm_expression dfba.library.create dfba.library.write_model_to_file .. function:: WriteIndent(theFile: TextIO, indentCount: int, text: str) -> None Write indent. :param theFile: Open cpp file. :type theFile: file :param indentCount: Number of tabs to indent. :type indentCount: int :param text: The line of text to write to file. :type text: string .. function:: indices(nrow: int, reactions: cobra.DictList, reaction_id: str) -> List[int] Write indices. :param nrow: Number of rows in LP problem. :type nrow: int :param reactions: A DictList where the key is the reaction identifier and the value a `cobra.Reaction` object. :type reactions: DictList :param reaction_id: Identifier of the reaction to return indices for. :type reaction_id: string :returns: **indices** -- lpindices of forward and reverse reaction. :rtype: list .. function:: col_indices(reactions: cobra.DictList, reaction_id: str) -> List[int] Write column indices. :param reactions: A `DictList` object where the key is the reaction identifier and the value a `cobra.Reaction` object. :type reactions: DictList :param reaction_id: Identifier of the reaction to return column indices for. :type reaction_id: string :returns: **indices** -- Column indices of forward and reverse reaction. :rtype: list .. function:: ctrl_parm_expression(ctrl_parms: Dict, change_pnts: List) -> str Control paramter expression. :param ctrl_parms: A dict of control parameters to be included in expression. :type ctrl_parms: dict :param change_pnts: Ordered list of change points from control parameters in model. :type change_pnts: list :returns: **control_expression** -- The control parameter expression. :rtype: string .. function:: create(directory: str) -> None Create library. :param directory: Path to temporary directory containing library. :type directory: string .. function:: 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. :param name: str of `DfbaModel` id :type name: string :param kinetic_variables: A `DictList` object where the key is the kinetic variable identifier and the value a `KineticValue` object. :type kinetic_variables: DictList :param exchange_fluxes: A `DictList` object where the key is the exchange flux identifier and the value an `ExchangeFLux` object. :type exchange_fluxes: DictList :param nexc: Number of exchange fluxes. :type nexc: int :param nreq: Number of fluxes required to define ODE right-hand side. :type nreq: int :param exchange_indics: Indices of exchange fluxes. :type exchange_indics: list :param change_pnts: Ordered list of change points from control parameters in model. :type change_pnts: list :param directory: Path to temporary directory containing library. :type directory: string