OMIM: Online Mendelian Inheritance in Man (omim)

omim provides an interface to Online Mendelian Inheritance in Man database. For now it only supports mapping genes to diseases.

orangecontrib.bio.omim.diseases()

Return all disease descriptors.

orangecontrib.bio.omim.genes()

Return a set of all genes referenced in OMIM.

orangecontrib.bio.omim.disease_genes(disease)

Return a set of all genes referenced by disease in OMIM.

orangecontrib.bio.omim.gene_diseases()

Return a dictionary {gene: set(disease_objects for gene), …}.

The following example creates a network of connected diseases and save it in Pajek .net format sets information file (omim_disease_network.py).

import orangecontrib.bio.omim

diseases = orangecontrib.bio.omim.diseases()
genes = [orangecontrib.bio.omim.disease_genes(disease) for disease in diseases]

vertices = []
edges = []
for i in range(len(diseases)):
    vertices.append('%i "%s"\n' % (i + 1, diseases[i].name))
    for j in range(i + 1, len(diseases)):
        intersection = set(genes[i]).intersection(genes[j])
        if intersection:
            edges.append('%i %i %i l "%s"\n' %(i + 1, j + 1, len(intersection), ",".join(sorted(intersection))))

file = open("disease.net", "wb")
file.write("*Vertices %i 2\n" % len(vertices))
file.writelines(vertices)
file.write("*Edges\n")
file.writelines(edges)