示例#1
0
def test_go_rule08():
    a = ["blah"] * 16
    a[4] = "GO:0006810"  # do not annotate
    a[6] = "IEA"

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

    a[6] = "IC"
    test_result = qc.GoRule08().test(
        a, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    a[4] = "GO:0007049"  # do not manually annotate
    # evidence is IC, non IEA
    test_result = qc.GoRule08().test(
        a, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    a[6] = "IEA"
    # IEA, but on not manual, so should pass
    test_result = qc.GoRule08().test(
        a, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS

    a[4] = "GO:0034655"  # neither
    a[6] = "IC"
    test_result = qc.GoRule08().test(
        a, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS
示例#2
0
def test_go_rule08():

    assoc = make_annotation(goid="GO:0006810", evidence="IEA").associations[0]

    test_result = qc.GoRule08().test(assoc,
                                     all_rules_config(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    assoc.evidence.type = Curie.from_str("ECO:0000305")
    test_result = qc.GoRule08().test(assoc,
                                     all_rules_config(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    assoc.object.id = Curie.from_str("GO:0007049")  # do not manually annotate
    # evidence is IC, non IEA
    test_result = qc.GoRule08().test(assoc,
                                     all_rules_config(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    assoc.evidence.type = Curie.from_str("ECO:0000501")  #IEA
    # IEA, but on not manual, so should pass
    test_result = qc.GoRule08().test(assoc,
                                     all_rules_config(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS

    assoc.object.id = Curie.from_str("GO:0034655")  # neither
    assoc.evidence.type = Curie.from_str("ECO:0000305")
    test_result = qc.GoRule08().test(assoc,
                                     all_rules_config(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS
示例#3
0
def test_go_rule08():
    a = ["blah"] * 15
    a[3] = ""
    a[4] = "GO:0006810"  # do not annotate
    a[6] = "IEA"
    a[8] = "P"
    assoc = gafparser.to_association(a).associations[0]

    test_result = qc.GoRule08().test(
        assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    assoc.evidence.type = "ECO:0000305"
    test_result = qc.GoRule08().test(
        assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    assoc.object.id = "GO:0007049"  # do not manually annotate
    # evidence is IC, non IEA
    test_result = qc.GoRule08().test(
        assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    assoc.evidence.type = "ECO:0000501"  #IEA
    # IEA, but on not manual, so should pass
    test_result = qc.GoRule08().test(
        assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS

    assoc.object.id = "GO:0034655"  # neither
    assoc.evidence.type = "ECO:0000305"
    test_result = qc.GoRule08().test(
        assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS