17.1.1.2.1.1. cobra.flux_analysis.deletion

17.1.1.2.1.1.1. Module Contents

17.1.1.2.1.1.1.1. Functions

_reactions_knockouts_with_restore(model, reactions)

_get_growth(model)

_reaction_deletion(model, ids)

_gene_deletion(model, ids)

_reaction_deletion_worker(ids)

_gene_deletion_worker(ids)

_init_worker(model)

_multi_deletion(model, entity, element_lists, method=’fba’, solution=None, processes=None, **kwargs)

Provide a common interface for single or multiple knockouts.

_entities_ids(entities)

_element_lists(entities, *ids)

single_reaction_deletion(model, reaction_list=None, method=’fba’, solution=None, processes=None, **kwargs)

Knock out each reaction from a given list.

single_gene_deletion(model, gene_list=None, method=’fba’, solution=None, processes=None, **kwargs)

Knock out each gene from a given list.

double_reaction_deletion(model, reaction_list1=None, reaction_list2=None, method=’fba’, solution=None, processes=None, **kwargs)

Knock out each reaction pair from the combinations of two given lists.

double_gene_deletion(model, gene_list1=None, gene_list2=None, method=’fba’, solution=None, processes=None, **kwargs)

Knock out each gene pair from the combination of two given lists.

cobra.flux_analysis.deletion.LOGGER[source]
cobra.flux_analysis.deletion.CONFIGURATION[source]
cobra.flux_analysis.deletion._reactions_knockouts_with_restore(model, reactions)[source]
cobra.flux_analysis.deletion._get_growth(model)[source]
cobra.flux_analysis.deletion._reaction_deletion(model, ids)[source]
cobra.flux_analysis.deletion._gene_deletion(model, ids)[source]
cobra.flux_analysis.deletion._reaction_deletion_worker(ids)[source]
cobra.flux_analysis.deletion._gene_deletion_worker(ids)[source]
cobra.flux_analysis.deletion._init_worker(model)[source]
cobra.flux_analysis.deletion._multi_deletion(model, entity, element_lists, method='fba', solution=None, processes=None, **kwargs)[source]

Provide a common interface for single or multiple knockouts.

Parameters
  • model (cobra.Model) – The metabolic model to perform deletions in.

  • entity ('gene' or 'reaction') – The entity to knockout (cobra.Gene or cobra.Reaction).

  • element_lists (list) – List of iterables ``cobra.Reaction``s or ``cobra.Gene``s (or their IDs) to be deleted.

  • method ({"fba", "moma", "linear moma", "room", "linear room"}, optional) – Method used to predict the growth rate.

  • solution (cobra.Solution, optional) – A previous solution to use as a reference for (linear) MOMA or ROOM.

  • processes (int, optional) – The number of parallel processes to run. Can speed up the computations if the number of knockouts to perform is large. If not passed, will be set to the number of CPUs found.

  • kwargs – Passed on to underlying simulation functions.

Returns

A representation of all combinations of entity deletions. The columns are ‘growth’ and ‘status’, where

indexfrozenset([str])

The gene or reaction identifiers that were knocked out.

growthfloat

The growth rate of the adjusted model.

statusstr

The solution’s status.

Return type

pandas.DataFrame

cobra.flux_analysis.deletion._entities_ids(entities)[source]
cobra.flux_analysis.deletion._element_lists(entities, *ids)[source]
cobra.flux_analysis.deletion.single_reaction_deletion(model, reaction_list=None, method='fba', solution=None, processes=None, **kwargs)[source]

Knock out each reaction from a given list.

Parameters
  • model (cobra.Model) – The metabolic model to perform deletions in.

  • reaction_list (iterable, optional) – ``cobra.Reaction``s to be deleted. If not passed, all the reactions from the model are used.

  • method ({"fba", "moma", "linear moma", "room", "linear room"}, optional) – Method used to predict the growth rate.

  • solution (cobra.Solution, optional) – A previous solution to use as a reference for (linear) MOMA or ROOM.

  • processes (int, optional) – The number of parallel processes to run. Can speed up the computations if the number of knockouts to perform is large. If not passed, will be set to the number of CPUs found.

  • kwargs – Keyword arguments are passed on to underlying simulation functions such as add_room.

Returns

A representation of all single reaction deletions. The columns are ‘growth’ and ‘status’, where

indexfrozenset([str])

The reaction identifier that was knocked out.

growthfloat

The growth rate of the adjusted model.

statusstr

The solution’s status.

Return type

pandas.DataFrame

cobra.flux_analysis.deletion.single_gene_deletion(model, gene_list=None, method='fba', solution=None, processes=None, **kwargs)[source]

Knock out each gene from a given list.

Parameters
  • model (cobra.Model) – The metabolic model to perform deletions in.

  • gene_list (iterable) – ``cobra.Gene``s to be deleted. If not passed, all the genes from the model are used.

  • method ({"fba", "moma", "linear moma", "room", "linear room"}, optional) – Method used to predict the growth rate.

  • solution (cobra.Solution, optional) – A previous solution to use as a reference for (linear) MOMA or ROOM.

  • processes (int, optional) – The number of parallel processes to run. Can speed up the computations if the number of knockouts to perform is large. If not passed, will be set to the number of CPUs found.

  • kwargs – Keyword arguments are passed on to underlying simulation functions such as add_room.

Returns

A representation of all single gene deletions. The columns are ‘growth’ and ‘status’, where

indexfrozenset([str])

The gene identifier that was knocked out.

growthfloat

The growth rate of the adjusted model.

statusstr

The solution’s status.

Return type

pandas.DataFrame

cobra.flux_analysis.deletion.double_reaction_deletion(model, reaction_list1=None, reaction_list2=None, method='fba', solution=None, processes=None, **kwargs)[source]

Knock out each reaction pair from the combinations of two given lists.

We say ‘pair’ here but the order order does not matter.

Parameters
  • model (cobra.Model) – The metabolic model to perform deletions in.

  • reaction_list1 (iterable, optional) – First iterable of ``cobra.Reaction``s to be deleted. If not passed, all the reactions from the model are used.

  • reaction_list2 (iterable, optional) – Second iterable of ``cobra.Reaction``s to be deleted. If not passed, all the reactions from the model are used.

  • method ({"fba", "moma", "linear moma", "room", "linear room"}, optional) – Method used to predict the growth rate.

  • solution (cobra.Solution, optional) – A previous solution to use as a reference for (linear) MOMA or ROOM.

  • processes (int, optional) – The number of parallel processes to run. Can speed up the computations if the number of knockouts to perform is large. If not passed, will be set to the number of CPUs found.

  • kwargs – Keyword arguments are passed on to underlying simulation functions such as add_room.

Returns

A representation of all combinations of reaction deletions. The columns are ‘growth’ and ‘status’, where

indexfrozenset([str])

The reaction identifiers that were knocked out.

growthfloat

The growth rate of the adjusted model.

statusstr

The solution’s status.

Return type

pandas.DataFrame

cobra.flux_analysis.deletion.double_gene_deletion(model, gene_list1=None, gene_list2=None, method='fba', solution=None, processes=None, **kwargs)[source]

Knock out each gene pair from the combination of two given lists.

We say ‘pair’ here but the order order does not matter.

Parameters
  • model (cobra.Model) – The metabolic model to perform deletions in.

  • gene_list1 (iterable, optional) – First iterable of ``cobra.Gene``s to be deleted. If not passed, all the genes from the model are used.

  • gene_list2 (iterable, optional) – Second iterable of ``cobra.Gene``s to be deleted. If not passed, all the genes from the model are used.

  • method ({"fba", "moma", "linear moma", "room", "linear room"}, optional) – Method used to predict the growth rate.

  • solution (cobra.Solution, optional) – A previous solution to use as a reference for (linear) MOMA or ROOM.

  • processes (int, optional) – The number of parallel processes to run. Can speed up the computations if the number of knockouts to perform is large. If not passed, will be set to the number of CPUs found.

  • kwargs – Keyword arguments are passed on to underlying simulation functions such as add_room.

Returns

A representation of all combinations of gene deletions. The columns are ‘growth’ and ‘status’, where

indexfrozenset([str])

The gene identifiers that were knocked out.

growthfloat

The growth rate of the adjusted model.

statusstr

The solution’s status.

Return type

pandas.DataFrame