7.1.1.3.1.3. pta.sampling.primitives

Abstract base class for sampling over the flux polytope.

7.1.1.3.1.3.1. Module Contents

class pta.sampling.primitives.FluxSpaceSamplingModel(polytope: PolyRound.api.Polytope, reaction_ids: List[str])[source]

Bases: pta.sampling.commons.SamplerInterface

Object holding the information necessary to sample a flux space.

Parameters
  • polytope (Polytope) – Polytope object describing the flux space.

  • reaction_ids (List[str]) – Identifiers of the reactions in the flux space.

property G(self) numpy.array[source]

Gets the left-hand side of the constraints of the flux space.

property h(self) numpy.array[source]

Gets the right-hand side of the constraints of the flux space.

property to_fluxes_transform(self) Tuple[numpy.array, numpy.array][source]

Gets the transform from a point in the model to a point in the flux space.

property reaction_ids(self)[source]

Gets the IDs of the reactions in the model.

to_fluxes(self, value: numpy.array) numpy.array[source]

Transform a point or matrix from the model to the flux space.

Parameters

value (np.array) – Input values.

Returns

The corresponding fluxes.

Return type

np.array

property dimensionality(self) int[source]

Gets the dimensionality of the flux space.

get_initial_points(self, num_points: int) numpy.array[source]

Gets initial points for sampling fluxes.

Parameters
Returns

Array containing the initial points.

Return type

np.array