Exemple #1
0
def test_go_rules_15():

    assoc = make_annotation(goid="GO:0044419",
                            taxon="taxon:123|taxon:456").associations[0]

    ontology = ontol_factory.OntologyFactory().create(
        "tests/resources/go-interspecies-20210520.json")

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

    assoc.object.id = Curie.from_str("GO:1234567")
    test_result = qc.GoRule15().test(assoc,
                                     all_rules_config(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    assoc.object.id = Curie.from_str("GO:0002812")
    test_result = qc.GoRule15().test(assoc,
                                     all_rules_config(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS

    assoc.object.id = Curie.from_str("GO:0044215")
    assoc.object.id = Curie.from_str("NCBITaxon:123")
    assoc.interacting_taxon = None  # This is the important part, no interacting taxon
    test_result = qc.GoRule15().test(assoc,
                                     all_rules_config(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS
Exemple #2
0
def test_go_rules_15():

    a = ["blah"] * 15
    a[3] = ""
    a[4] = "GO:0044419"
    a[6] = "IEA"
    a[8] = "P"
    a[12] = "taxon:123|taxon:456"
    assoc = gafparser.to_association(a).associations[0]

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

    assoc.object.id = "GO:1234567"
    test_result = qc.GoRule15().test(
        assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    assoc.object.id = "GO:0044215"
    assoc.object.id = "NCBITaxon:123"
    assoc.interacting_taxon = None  # This is the important part, no interacting taxon
    test_result = qc.GoRule15().test(
        assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS
Exemple #3
0
def test_go_rules_15():

    assoc = make_annotation(goid="GO:0044419", taxon="taxon:123|taxon:456").associations[0]

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

    assoc.object.id = Curie.from_str("GO:1234567")
    test_result = qc.GoRule15().test(assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    assoc.object.id = Curie.from_str("GO:0044215")
    assoc.object.id = Curie.from_str("NCBITaxon:123")
    assoc.interacting_taxon = None # This is the important part, no interacting taxon
    test_result = qc.GoRule15().test(assoc, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS
Exemple #4
0
def test_go_rules_15():

    a = ["blah"] * 16
    a[4] = "GO:0044419"
    a[12] = "taxon:123|taxon:456"

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

    a[4] = "GO:123456"
    test_result = qc.GoRule15().test(
        a, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.WARNING

    a[4] = "GO:0044215"
    a[12] = "taxon:123"
    test_result = qc.GoRule15().test(
        a, assocparser.AssocParserConfig(ontology=ontology))
    assert test_result.result_type == qc.ResultType.PASS