示例#1
0
文件: basic.py 项目: sulheim/memote
def find_protein_complexes(model):
    """
    Find tuples of gene identifiers that comprise functional enzyme complexes.

    Parameters
    ----------
    model : cobra.Model
        The metabolic model under investigation.

    Returns
    -------
    set
        A set of tuples of genes that are connected via "AND" in
        gene-protein-reaction rules (GPR) and thus constitute protein
        complexes.

    """
    protein_complexes = set()
    for rxn in model.reactions:
        if rxn.gene_reaction_rule:
            for candidate in helpers.find_functional_units(
                    rxn.gene_reaction_rule):
                if len(candidate) >= 2:
                    protein_complexes.add(tuple(candidate))
    return protein_complexes
示例#2
0
def find_protein_complexes(model):
    """
    Find tuples of gene identifiers that constitute functional enzyme complexes.

    Parameters
    ----------
    model : cobra.Model
        The metabolic model under investigation.

    """
    protein_complexes = set()
    for rxn in model.reactions:
        if rxn.gene_reaction_rule:
            for candidate in helpers.find_functional_units(
                    rxn.gene_reaction_rule):
                if len(candidate) >= 2:
                    protein_complexes.add(tuple(candidate))
    return protein_complexes
示例#3
0
def test_find_functional_units(gpr_str, expected):
    """Expect type of enzyme complexes to be identified correctly."""
    assert list(helpers.find_functional_units(gpr_str)) == expected