memote.support.consistency_helpers module

Helper functions for stoichiometric consistency checks.

memote.support.consistency_helpers.stoichiometry_matrix(metabolites, reactions)[source]

Return the stoichiometry matrix representation of a set of reactions.

The reactions and metabolites order is respected. All metabolites are expected to be contained and complete in terms of the reactions.

Parameters:

reactions : iterable

A somehow ordered list of unique reactions.

metabolites : iterable

A somehow ordered list of unique metabolites.

Returns:

numpy.array

The 2D array that represents the stoichiometry matrix.

dict

A dictionary mapping metabolites to row indexes.

dict

A dictionary mapping reactions to column indexes.

memote.support.consistency_helpers.nullspace(matrix, atol=1e-13, rtol=0.0)[source]

Compute the nullspace of a 2D numpy.array.

Notes

Adapted from: https://scipy.github.io/old-wiki/pages/Cookbook/RankNullspace.html