Example #1
0
def test_find_orphans(read_only_model, store):
    """Expect no orphans to be present."""
    store["orphan_metabolites"] = [
        met.id for met in consistency.find_orphans(read_only_model)
    ]
    assert len(store["orphan_metabolites"]) == 0,\
        "The following metabolites are not produced by any " \
        "reaction of the model: {}".format(
            ", ".join(store["orphan_metabolites"]))
Example #2
0
def test_find_orphans(read_only_model):
    """
    Expect no orphans to be present.

    Orphans are metabolites that are only consumed but not produced by
    reactions in the model. They may indicate the presence of network gaps.
    """
    ann = test_find_orphans.annotation
    ann["data"] = get_ids(consistency.find_orphans(read_only_model))
    ann["metric"] = len(ann["data"]) / len(read_only_model.metabolites)
    ann["message"] = wrapper.fill(
        """A total of {} ({:.2%}) metabolites are not produced by any reaction
        of the model: {}""".format(
            len(ann["data"]), ann["metric"], truncate(ann["data"])))
    assert len(ann["data"]) == 0, ann["message"]
Example #3
0
def test_find_orphans(model):
    """
    Expect no orphans to be present.

    Orphans are metabolites that are only consumed but not produced by
    reactions in the model. They may indicate the presence of network and
    knowledge gaps.

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


    """
    ann = test_find_orphans.annotation
    ann["data"] = get_ids(consistency.find_orphans(model))
    ann["metric"] = len(ann["data"]) / len(model.metabolites)
    ann["message"] = wrapper.fill(
        """A total of {} ({:.2%}) metabolites are not produced by any reaction
        of the model: {}""".format(
            len(ann["data"]), ann["metric"], truncate(ann["data"])))
    assert len(ann["data"]) == 0, ann["message"]
Example #4
0
def test_find_orphans(model):
    """
    Expect no orphans to be present.

    Orphans are metabolites that are only consumed but not produced by
    reactions in the model. They may indicate the presence of network and
    knowledge gaps.

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


    """
    ann = test_find_orphans.annotation
    ann["data"] = get_ids(consistency.find_orphans(model))
    ann["metric"] = len(ann["data"]) / len(model.metabolites)
    ann["message"] = wrapper.fill(
        """A total of {} ({:.2%}) metabolites are not produced by any reaction
        of the model: {}""".format(len(ann["data"]), ann["metric"],
                                   truncate(ann["data"])))
    assert len(ann["data"]) == 0, ann["message"]
Example #5
0
def test_find_orphans(model, num):
    """Expect the appropriate amount of orphans to be found."""
    orphans = consistency.find_orphans(model)
    assert len(orphans) == num
def test_find_orphans(model, num):
    """Expect the appropriate amount of orphans to be found."""
    orphans = consistency.find_orphans(model)
    assert len(orphans) == num