Пример #1
0
def test_find_deadends(read_only_model, store):
    """Expect no deadends to be present."""
    store["deadend_metabolites"] = [
        met.id for met in consistency.find_deadends(read_only_model)
    ]
    assert len(store["deadend_metabolites"]) == 0,\
        "The following metabolites are not consumed by any " \
        "reaction of the model: {}".format(
            ", ".join(store["deadend_metabolites"]))
Пример #2
0
def test_find_deadends(read_only_model):
    """
    Expect no dead-ends to be present.

    Dead-ends are metabolites that can only be produced but not consumed by
    reactions in the model. They may indicate the presence of network gaps.
    """
    ann = test_find_deadends.annotation
    ann["data"] = get_ids(consistency.find_deadends(read_only_model))
    ann["metric"] = len(ann["data"]) / len(read_only_model.metabolites)
    ann["message"] = wrapper.fill(
        """A total of {} ({:.2%}) metabolites are not consumed by any reaction
        of the model: {}""".format(
            len(ann["data"]), ann["metric"], truncate(ann["data"])))
    assert ann["data"] == 0, ann["message"]
Пример #3
0
def test_find_deadends(model):
    """
    Expect no dead-ends to be present.

    Dead-ends are metabolites that can only be produced but not consumed by
    reactions in the model. They may indicate the presence of network and
    knowledge gaps.

    Implementation:
    Find dead-end metabolites structurally by considering only reaction
    equations and reversibility. FBA is not carried out.

    """
    ann = test_find_deadends.annotation
    ann["data"] = get_ids(consistency.find_deadends(model))
    ann["metric"] = len(ann["data"]) / len(model.metabolites)
    ann["message"] = wrapper.fill(
        """A total of {} ({:.2%}) metabolites are not consumed by any reaction
        of the model: {}""".format(
            len(ann["data"]), ann["metric"], truncate(ann["data"])))
    assert ann["data"] == 0, ann["message"]
Пример #4
0
def test_find_deadends(model):
    """
    Expect no dead-ends to be present.

    Dead-ends are metabolites that can only be produced but not consumed by
    reactions in the model. They may indicate the presence of network and
    knowledge gaps.

    Implementation:
    Find dead-end metabolites structurally by considering only reaction
    equations and reversibility. FBA is not carried out.

    """
    ann = test_find_deadends.annotation
    ann["data"] = get_ids(consistency.find_deadends(model))
    ann["metric"] = len(ann["data"]) / len(model.metabolites)
    ann["message"] = wrapper.fill(
        """A total of {} ({:.2%}) metabolites are not consumed by any reaction
        of the model: {}""".format(len(ann["data"]), ann["metric"],
                                   truncate(ann["data"])))
    assert ann["data"] == 0, ann["message"]
Пример #5
0
def test_find_deadends(model, num):
    """Expect the appropriate amount of deadends to be found."""
    deadends = consistency.find_deadends(model)
    assert len(deadends) == num
Пример #6
0
def test_find_deadends(model, num):
    """Expect the appropriate amount of deadends to be found."""
    deadends = consistency.find_deadends(model)
    assert len(deadends) == num