# 17.1.1.5.1.2. cobra.medium.boundary_types¶

Contains function to identify the type of boundary reactions.

This module uses various heuristics to decide whether a boundary reaction is an exchange, demand or sink reaction. It mostly orientates on the following paper:

Thiele, I., & Palsson, B. Ø. (2010, January). A protocol for generating a high-quality genome-scale metabolic reconstruction. Nature protocols. Nature Publishing Group. http://doi.org/10.1038/nprot.2009.203

## 17.1.1.5.1.2.1. Module Contents¶

### 17.1.1.5.1.2.1.1. Functions¶

 Find the external compartment in the model. is_boundary_type(reaction, boundary_type, external_compartment) Check whether a reaction is an exchange reaction. find_boundary_types(model, boundary_type, external_compartment=None) Find specific boundary reactions.
cobra.medium.boundary_types.LOGGER[source]
cobra.medium.boundary_types.find_external_compartment(model)[source]

Find the external compartment in the model.

Uses a simple heuristic where the external compartment should be the one with the most exchange reactions.

Parameters

model (cobra.Model) – A cobra model.

Returns

The putative external compartment.

Return type

str

cobra.medium.boundary_types.is_boundary_type(reaction, boundary_type, external_compartment)[source]

Check whether a reaction is an exchange reaction.

Parameters
• reaction (cobra.Reaction) – The reaction to check.

• boundary_type (str) – What boundary type to check for. Must be one of “exchange”, “demand”, or “sink”.

• external_compartment (str) – The id for the external compartment.

Returns

Whether the reaction looks like the requested type. Might be based on a heuristic.

Return type

boolean

cobra.medium.boundary_types.find_boundary_types(model, boundary_type, external_compartment=None)[source]

Find specific boundary reactions.

Parameters
• model (cobra.Model) – A cobra model.

• boundary_type (str) – What boundary type to check for. Must be one of “exchange”, “demand”, or “sink”.

• external_compartment (str or None) – The id for the external compartment. If None it will be detected automatically.

Returns

A list of likely boundary reactions of a user defined type.

Return type

list of cobra.reaction