def get_gene_associations(model):
for reaction in model.reactions:<EOL><INDENT>assoc = None<EOL>if reaction.genes is None:<EOL><INDENT>continue<EOL><DEDENT>elif isinstance(reaction.genes, string_types):<EOL><INDENT>assoc = boolean.Expression(reaction.genes)<EOL><DEDENT>else:<EOL><INDENT>variables = [boolean.Variable(g) for g in reaction.genes]<EOL>assoc = boolean.Expression(boolean.And(*variables))<EOL><DEDENT>yield reaction.id, assoc<EOL><DEDENT>
Create gene association for class :class:`.GeneDeletionStrategy`.

    Return a dict mapping reaction IDs to
    :class:`psamm.expression.boolean.Expression` objects,
    representing relationships between reactions and related genes. This helper
    function should be called when creating :class:`.GeneDeletionStrategy`
    objects.

    Args:
        model: :class:`psamm.datasource.native.NativeModel`.