Beispiel #1
0
def test_go_rule_16():
    # No GO term w/ID
    assoc = make_annotation(evidence="IC",
                            withfrom="BLAH:12345").associations[0]

    test_result = qc.GoRule16().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.ERROR

    # withfrom has GO term
    assoc.evidence.with_support_from = association.ConjunctiveSet.str_to_conjunctions(
        "GO:0023456")

    test_result = qc.GoRule16().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.PASS

    # Pipe
    assoc.evidence.with_support_from = association.ConjunctiveSet.str_to_conjunctions(
        "GO:0012345|BLAH:54321")

    test_result = qc.GoRule16().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.PASS

    # Empty withfrom
    assoc.evidence.with_support_from = []

    test_result = qc.GoRule16().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.ERROR

    # Not IC
    assoc.evidence.type = Curie.from_str("ECO:0000501")
    assoc.evidence.with_support_from = association.ConjunctiveSet.str_to_conjunctions(
        "BLAH:5555555|FOO:999999")

    test_result = qc.GoRule16().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.PASS
Beispiel #2
0
def test_go_rule_16_list_terms():
    gr16 = qc.GoRule16()

    withfrom = "GO:12345"
    assert gr16._list_terms(withfrom) == ["GO:12345"]

    withfrom = ""
    assert gr16._list_terms(withfrom) == []

    withfrom = "GO:12345|GO:2223334"
    assert gr16._list_terms(withfrom) == ["GO:12345", "GO:2223334"]
Beispiel #3
0
def test_go_rule_16():
    # No GO term w/ID
    a = ["blah"] * 16
    a[6] = "IC"
    a[7] = "BLAH:12345"

    test_result = qc.GoRule16().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.WARNING

    # withfrom has GO term
    a = ["blah"] * 16
    a[6] = "IC"
    a[7] = "GO:12345"

    test_result = qc.GoRule16().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS

    # Pipe
    a = ["blah"] * 16
    a[6] = "IC"
    a[7] = "GO:12345|BLAH:54321"

    test_result = qc.GoRule16().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS

    # Empty withfrom
    a = ["blah"] * 16
    a[6] = "IC"
    a[7] = ""

    test_result = qc.GoRule16().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.WARNING

    # Not IC
    a = ["blah"] * 16
    a[6] = "GOT"
    a[7] = "BLAH:5555555|FOO:999999"

    test_result = qc.GoRule16().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS
Beispiel #4
0
def test_go_rule_16():
    # No GO term w/ID
    a = ["blah"] * 15
    a[3] = ""
    a[4] = "GO:1234567"
    a[6] = "IC"
    a[7] = "BLAH:12345"
    a[8] = "P"
    a[13] = "20200303"
    assoc = gafparser.to_association(a).associations[0]

    test_result = qc.GoRule16().test(assoc, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.ERROR

    # withfrom has GO term
    assoc.evidence.with_support_from = [association.ConjunctiveSet(["GO:0023456"])]

    test_result = qc.GoRule16().test(assoc, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS

    # Pipe
    assoc.evidence.with_support_from = [association.ConjunctiveSet(["GO:0012345"]), association.ConjunctiveSet(["BLAH:54321"])]

    test_result = qc.GoRule16().test(assoc, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS

    # Empty withfrom
    assoc.evidence.with_support_from = []

    test_result = qc.GoRule16().test(assoc, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.ERROR

    # Not IC
    assoc.evidence.type = "ECO:0000501"
    assoc.evidence.with_support_from =  [association.ConjunctiveSet(["BLAH:5555555"]),  association.ConjunctiveSet(["FOO:999999"])]

    test_result = qc.GoRule16().test(assoc, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS