Efmtool Interface

This module provides an interface for efmtool

pycomo.helper.efmtool_interface.community_matrix_sbml(cobra_model, organism_ids, mu=1)

Extracts stoichiometric matrix, and lists of reaction IDs, metabolite IDs and reversibilities from a cobra model. Adds bounds on growth rate and the total sum of microbe fractions=1

Args:

cobra_model: cobrapy Model object created with PyCoMo organism_ids: list of organism names used in the cobra model mu: growth rate to set

Returns:

N: numpy array with the stoichiometric matrix formatted for the use with efmtool rxns: list of reaction names mets: list of metabolite names revs: list of reversibilities (0 irreversible / 1 reversible)

pycomo.helper.efmtool_interface.make_nice_results(modes, rxn_names)

Convert array from efmtool into a nice pandas DataFrame Args:

modes: numpy array with the output of “efmtool.calculate_efms()” rxn_names: list of reaction names

Returns:

pandas data frame with EFMs as rows and reactions as columns

pycomo.helper.efmtool_interface.run_efmtool(matrix, rxn_names, met_names, revs=[])

run efmtool and return numpy array with fluxes Args:

matrix: numpy array with the stoichiometric matrix rxn_names: list of reaction names met_names: list of metabolite names revs: list of reversibilities (0 irreversible / 1 reversible).

If not provided, all reactions are assumed to be irreversible.

Returns:

pandas data frame with EFMs as rows and reactions as columns