Esempio n. 1
0
def test_overlapping_unnormalizations_for_proteins_on_accept_entity_uniprot_go_taxonomy():

    # Must always be false if gold is known but not the prediction
    assert False is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|P08100",
        "e_1|0,1|n_7|UNKNOWN:")

    # Gold UNKNOWN AND overlapping --> None
    assert None is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|UNKNOWN:",
        "e_1|0,1|n_7|P08100")

    # Gold UNKNOWN AND overlapping --> None
    assert None is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|UNKNOWN:aaa",
        "e_1|0,1|n_7|UNKNOWN:bbb")

    # One gold is known and matches the prediction --> True
    assert True is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|UNKNOWN:,P08100",
        "e_1|0,1|n_7|P08100")

    # One gold is known and does not match the prediction --> False
    assert False is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|UNKNOWN:,P08100",
        "e_1|0,1|n_7|xxx")
Esempio n. 2
0
def test_nonoverlapping_unnormalizations_for_proteins_on_accept_entity_uniprot_go_taxonomy():

    # Gold UNKNOWN BUT NO overlapping --> False
    assert False is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|UNKNOWN:",
        "e_1|1,2|n_7|P08100")

    # Gold UNKNOWN BUT NO overlapping --> False
    assert False is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|UNKNOWN:",
        "e_1|1,2|n_7|UNKNOWN:")
Esempio n. 3
0
def test_overlapping_cases_for_proteins_on_accept_entity_uniprot_go_taxonomy():

    assert False is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|P08100",
        "e_1|1,2|n_7|P08100")

    assert True is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|P08100",
        "e_1|0,1|n_7|P08100")

    assert True is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|P08100",
        "e_1|0,2|n_7|P08100")
Esempio n. 4
0
def test_seq_identity_for_proteins_on_accept_entity_uniprot_go_taxonomy():

    assert False is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|P08100",
        "e_1|0,1|n_7|P02699")

    assert True is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|P08100",
        "e_1|0,1|n_7|P02699",
        min_seq_identity=90)

    assert True is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|P02699",
        "e_1|0,1|n_7|P08100",
        min_seq_identity=90)

    assert False is accept_entity_uniprot_go_taxonomy(
        "e_1|0,1|n_7|P08100",
        "e_1|0,1|n_7|P02699",
        min_seq_identity=95)
Esempio n. 5
0
 def accept_checking_sequence_identity(gold, pred):
     return accept_entity_uniprot_go_taxonomy(gold,
                                              pred,
                                              min_seq_identity=90)