Filters for manipulating data

The filters module provides some common filters for moving between proteins, roles, enzymes, and reactions. These are accessory functions that you will want to use with your FBA work

Identifying reactions with/without proteins

PyFBA.filters.reactions_and_proteins.reactions_with_no_proteins(reactions, verbose=False)

Figure out which reactions in our set have no proteins associated with them.

Parameters:
  • reactions (dict) – The reactions dictionary
  • verbose (bool) – prints out how many reactions have no proteins out of the total
Returns:

a set of reaction ids that have no proteins associated with them.

Return type:

set

PyFBA.filters.reactions_and_proteins.reactions_with_proteins(reactions, verbose=False)

Figure out which reactions in our set have proteins associated with them.

Parameters:
  • reactions (dict) – The reactions dictionary
  • verbose (bool) – prints out how many reactions have no proteins out of the total
Returns:

a set of reaction ids that have proteins associated with them.

Return type:

set

Converting between roles and reactions and vice-versa

PyFBA.filters.roles_and_reactions.reactions_to_roles(reaction_set, verbose=False)

Convert between reactions and roles using the model seed data

For a set of reaction IDs return a hash of the reaction id and the roles in that reaction.

Parameters:
  • reaction_set (set) – A set of reaction IDs that we want to convert to roles
  • verbose (bool) – print error reporting
Returns:

a hash of reaction ids and set of the associated roles

Return type:

dict of set of str

PyFBA.filters.roles_and_reactions.roles_to_reactions(roles, verbose=False)

Convert between roles and reactions using the model seed data

For a set of roles return a hash where the key is the role and the value is the set of reactions that role is involved in.

Parameters:
  • roles (set) – A set of roles that we want to convert to reaction IDs
  • verbose (bool) – print error reporting
Returns:

a hash of roles and set of the associated reaction ids

Return type:

dict of set of str