Exemple #1
0
def init_default_hrss(agg=semsim.agg_bma_max):
    go_onto = godb.load_go_obo()
    go_is_a_g = godb.onto_rel_graph(go_onto)
    ic = semsim.init_ic(go_onto, get_curated_frequencies_path())

    return semsim.HRSS(agg=agg, onto=go_onto, rel_g=go_is_a_g, ic=ic)
Exemple #2
0
def init_default_mica_dissim(agg=semsim.agg_bma_min):
    onto = godb.load_go_obo()
    go_is_a_g = godb.onto_rel_graph(go_onto)
    ic = semsim.init_ic(go_onto, get_curated_frequencies_path())

    return semsim.MICADissim(agg=agg, onto=onto, rel_g=go_is_a_g, ic=ic)
Exemple #3
0
    writer.writerow(('protein1', 'protein2', 'biological_process',
                     'cellular_component', 'molecular_function'))

    for i in range(len(annotations)):
        for j in range(len(annotations)):
            if np.any(comparison_mat[:, i, j] != 0):
                writer.writerow(
                    (annotations[i][0], annotations[j][0], comparison_mat[0, i,
                                                                          j],
                     comparison_mat[1, i, j], comparison_mat[2, i, j]))


if __name__ == '__main__':
    cmd = sys.argv[1]

    go_onto = godb.load_go_obo()
    go_is_a_g = godb.onto_rel_graph(go_onto)
    evidence_codes = godb.get_curated_evidence_codes()

    assert len(list(nx.weakly_connected_components(go_is_a_g))) == 3

    if cmd == 'alternatives':
        go_list_path = sys.argv[2]
        output_path = sys.argv[3]

        go_list = load_go_list(open_arg_file(go_list_path, 'r'))
        alternatives = find_valid_go_alternatives(go_list, go_onto, go_is_a_g,
                                                  evidence_codes)

        writer = csv.writer(open_arg_file(output_path, 'w+'), delimiter='\t')
        writer.writerows(alternatives)