예제 #1
0
def test_go_rule11():
    a = ["blah"] * 16
    a[4] = "GO:0003674"
    a[6] = "ND"

    test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig())
    print("first test, we have {}".format(test_result))
    assert test_result.result_type == qc.ResultType.PASS

    # Bad GO ID
    a = ["blah"] * 16
    a[4] = "GO:1234567"
    a[6] = "ND"

    test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.ERROR

    # Not ND and not Root
    a = ["blah"] * 16
    a[4] = "GO:1234567"
    a[6] = "FOO"

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

    # Root, but not ND
    a = ["blah"] * 16
    a[4] = "GO:0003674"
    a[6] = "FOO"
    test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.ERROR
예제 #2
0
파일: test_qc.py 프로젝트: valearna/ontobio
def test_go_rule11():
    a = ["blah"] * 15
    a[3] = ""
    a[4] = "GO:0003674"
    a[6] = "ND"
    a[8] = "F"
    a[13] = "20200303"
    assoc = gafparser.to_association(a).associations[0]

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

    # Bad GO ID
    a = ["blah"] * 15
    a[3] = ""
    a[4] = "GO:1234567"
    a[6] = "ND"
    a[8] = "F"
    a[13] = "20200303"
    assoc = gafparser.to_association(a).associations[0]

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

    # Not ND and not Root
    a[3] = ""
    a[4] = "GO:1234567"
    a[6] = "IEA"
    a[8] = "F"
    a[13] = "20200303"
    assoc = gafparser.to_association(a).associations[0]

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

    # Root, but not ND
    a = ["blah"] * 15
    a[3] = ""
    a[4] = "GO:0003674"
    a[6] = "IEA"
    a[8] = "F"
    a[13] = "20200303"
    assoc = gafparser.to_association(a).associations[0]

    test_result = qc.GoRule11().test(assoc, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.ERROR
예제 #3
0
def test_go_rule11():

    assoc = make_annotation(goid="GO:0003674", evidence="ND").associations[0]
    test_result = qc.GoRule11().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.PASS

    # Bad GO ID
    assoc = make_annotation(goid="GO:1234567", evidence="ND").associations[0]
    test_result = qc.GoRule11().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.ERROR

    # Not ND and not Root
    assoc = make_annotation(goid="GO:1234567", evidence="IEA").associations[0]
    test_result = qc.GoRule11().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.PASS

    # Root, but not ND
    assoc = make_annotation(goid="GO:0003674", evidence="IEA").associations[0]
    test_result = qc.GoRule11().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.ERROR
예제 #4
0
def test_go_rule11():
    a = ["blah"] * 16
    a[4] = "GO:0003674"
    a[6] = "ND"

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

    # Bad GO ID
    a = ["blah"] * 16
    a[4] = "GO:1234567"
    a[6] = "ND"

    test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.ERROR

    # Not ND
    a = ["blah"] * 16
    a[4] = "GO:1234567"
    a[6] = "FOO"
    a[7] = "GO_REF:0000001"

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