source: orange-bioinformatics/docs/reference/obiOMIM.htm @ 1634:32373d957326

Revision 1634:32373d957326, 1.6 KB checked in by mitar, 2 years ago (diff)

Renamed addon reference documentation.

Line 
1<html>
2
3<head>
4<title>obiOMIM: Online Mendelian Inheritance in Man</title>
5<link rel=stylesheet href="../style.css" type="text/css">
6<link rel=stylesheet href="style-print.css" type="text/css" media=print>
7</head>
8
9<body>
10<h1>obiOMIM Online Mendelian Inheritance in Man</h1>
11<p>obiOMIM provides an interface to <a href="http://www.ncbi.nlm.nih.gov/sites/entrez?db=omim">OMIM - Online Mendelian Inheritance in Man</a>
12database. For now it only supports mapping genes to diseases.</p>
13
14<p class=section>Functions</p>
15<dl class=attributes>
16    <dt>diseases()</dt>
17    <dd>Return all disease descriptors</dd>
18    <dt>genes()</dt>
19    <dd>Return a set of all genes referenced in OMIM</dd>
20    <dt>disease_genes(disease)</dt>
21    <dd>Return a set of all genes referenced by disease in OMIM</dd>
22    <dt>gene_diseases()</dt>
23    <dd>Return a dictionary {gene: set(disease_objects for gene), ...}</dd>
24<dt>
25
26<h2>Example</h2>
27<p>Create a network of connected diseases and save it in pajek .net format(part of <a href="obiOMIM-disease-network.py">obiOMIM-disease-network.py</a>)</p>
28<xmp class=code>import obiOMIM
29
30diseases = obiOMIM.diseases()
31genes = [obiOMIM.disease_genes(disease) for disease in diseases]
32
33vertices = []
34edges = []
35for i in range(len(diseases)):
36    vertices.append('%i "%s"\n' % (i + 1, diseases[i].name))
37    for j in range(i + 1, len(diseases)):
38        if set(genes[i]).intersection(genes[j]):
39            edges.append('%i %i %i\n' %(i + 1, j + 1, len(set(genes[i]).intersection(genes[j]))))
40
41file = open("disease.net", "wb")
42file.write("*Vertices %i 2\n" % len(vertices))
43file.writelines(vertices)
44file.write("*Edges\n")
45file.writelines(edges)
46</xmp>
47
48
49
50
Note: See TracBrowser for help on using the repository browser.