# psamm.gapfilling – Gap-filling functions¶

Functionality related to gap-filling in general.

This module contains some general functions for preparing models for gap-filling. Specific gap-filling methods are implemented in the gapfill and fastgapfill modules.

psamm.gapfilling.add_all_database_reactions(model, compartments)

Add all reactions from database that occur in given compartments.

Parameters: model – psamm.metabolicmodel.MetabolicModel.
psamm.gapfilling.add_all_exchange_reactions(model, compartment, allow_duplicates=False)

Add all exchange reactions to database and to model.

Parameters: model – psamm.metabolicmodel.MetabolicModel.
psamm.gapfilling.add_all_transport_reactions(model, boundaries, allow_duplicates=False)

Add all transport reactions to database and to model.

Add transport reactions for all boundaries. Boundaries are defined by pairs (2-tuples) of compartment IDs. Transport reactions are added for all compounds in the model, not just for compounds in the two boundary compartments.

Parameters: model – psamm.metabolicmodel.MetabolicModel. boundaries – Set of compartment boundary pairs. Set of IDs of reactions that were added.
psamm.gapfilling.create_extended_model(model, db_penalty=None, ex_penalty=None, tp_penalty=None, penalties=None)

Create an extended model for gap-filling.

Create a psamm.metabolicmodel.MetabolicModel with all reactions added (the reaction database in the model is taken to be the universal database) and also with artificial exchange and transport reactions added. Return the extended psamm.metabolicmodel.MetabolicModel and a weight dictionary for added reactions in that model.

Parameters: model – psamm.datasource.native.NativeModel. db_penalty – penalty score for database reactions, default is None. ex_penalty – penalty score for exchange reactions, default is None. tb_penalty – penalty score for transport reactions, default is None. penalties – a dictionary of penalty scores for database reactions.