コード例 #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"]))
コード例 #2
0
ファイル: test_consistency.py プロジェクト: sgalkina/memote
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"]
コード例 #3
0
ファイル: test_consistency.py プロジェクト: biosustain/memote
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"]
コード例 #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"]
コード例 #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
コード例 #6
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