Ejemplo n.º 1
0
def test_go_rule_06():

    assoc = make_annotation(goid="GO:0005575", evidence="HEP", aspect="C").associations[0]

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

    assoc.aspect = "P"
    assoc.object.id = Curie.from_str("GO:0008150")
    test_result = qc.GoRule06().test(assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS

    assoc.evidence.type = Curie.from_str("ECO:0000501")
    test_result = qc.GoRule06().test(assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS
Ejemplo n.º 2
0
def test_go_rule_06():
    a = ["blah"] * 16
    a[6] = "HEP"
    a[8] = "C"
    test_result = qc.GoRule06().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.ERROR

    a = ["blah"] * 16
    a[6] = "HEP"
    a[8] = "P"
    test_result = qc.GoRule06().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS

    a = ["blah"] * 16
    a[6] = "IEA"
    a[8] = "P"
    test_result = qc.GoRule06().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS
Ejemplo n.º 3
0
def test_go_rule_06():
    a = ["blah"] * 15
    a[3] = ""
    a[4] = "GO:0005575" # Cellular component
    a[6] = "HEP"
    a[8] = "C"
    a[13] = "20200303"

    assoc = gafparser.to_association(a).associations[0]

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

    assoc.aspect = "P"
    assoc.object.id = "GO:0008150"
    test_result = qc.GoRule06().test(assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS

    assoc.evidence.type = "ECO:0000501"
    test_result = qc.GoRule06().test(assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS