Beispiel #1
0
def test_find_disconnected(read_only_model, store):
    """Expect no disconnected metabolites to be present."""
    store["disconnected_metabolites"] = [
        met.id for met in consistency.find_disconnected(read_only_model)
    ]
    assert len(store["disconnected_metabolites"]) == 0,\
        "The following metabolites are not associated with any " \
        "reaction of the model: {}".format(
            ", ".join(store["disconnected_metabolites"]))
Beispiel #2
0
def test_find_disconnected(read_only_model):
    """
    Expect no disconnected metabolites to be present.

    Disconnected metabolites are not part of any reaction in the model. They
    are most likely left-over from the reconstruction process, but may also
    point to network gaps.
    """
    ann = test_find_disconnected.annotation
    ann["data"] = get_ids(consistency.find_disconnected(read_only_model))
    ann["metric"] = len(ann["data"]) / len(read_only_model.metabolites)
    ann["message"] = wrapper.fill(
        """A total of {} ({:.2%}) metabolites are not associated with any
        reaction of the model: {}""".format(
            len(ann["data"]), ann["metric"], truncate(ann["data"])))
    assert len(ann["data"]) == 0, ann["message"]
Beispiel #3
0
def test_find_disconnected(model):
    """
    Expect no disconnected metabolites to be present.

    Disconnected metabolites are not part of any reaction in the model. They
    are most likely left-over from the reconstruction process, but may also
    point to network and knowledge gaps.

    Implementation:
    Check for any metabolites of the cobra.Model object with emtpy reaction
    attribute.

    """
    ann = test_find_disconnected.annotation
    ann["data"] = get_ids(consistency.find_disconnected(model))
    ann["metric"] = len(ann["data"]) / len(model.metabolites)
    ann["message"] = wrapper.fill(
        """A total of {} ({:.2%}) metabolites are not associated with any
        reaction of the model: {}""".format(
            len(ann["data"]), ann["metric"], truncate(ann["data"])))
    assert len(ann["data"]) == 0, ann["message"]
Beispiel #4
0
def test_find_disconnected(model, num):
    """Expect the appropriate amount of disconnected to be found."""
    disconnected = consistency.find_disconnected(model)
    assert len(disconnected) == num
def test_find_disconnected(model, num):
    """Expect the appropriate amount of disconnected to be found."""
    disconnected = consistency.find_disconnected(model)
    assert len(disconnected) == num