Commits

Marko Toplak  committed 42a5e77

Convert obiOMIM documentation to rst.

  • Participants
  • Parent commits 0b3c285

Comments (0)

Files changed (6)

File docs/reference-html/obiOMIM-disease-network.py

-import obiOMIM
-
-diseases = obiOMIM.diseases()
-genes = [obiOMIM.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)

File docs/reference-html/obiOMIM.htm

-<html>
-
-<head>
-<title>obiOMIM: Online Mendelian Inheritance in Man</title>
-<link rel=stylesheet href="style.css" type="text/css">
-<link rel=stylesheet href="style-print.css" type="text/css" media=print>
-</head>
-
-<body>
-<h1>obiOMIM Online Mendelian Inheritance in Man</h1>
-<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>
-database. For now it only supports mapping genes to diseases.</p>
-
-<p class=section>Functions</p>
-<dl class=attributes>
-	<dt>diseases()</dt>
-	<dd>Return all disease descriptors</dd>
-	<dt>genes()</dt>
-	<dd>Return a set of all genes referenced in OMIM</dd>
-	<dt>disease_genes(disease)</dt>
-	<dd>Return a set of all genes referenced by disease in OMIM</dd>
-	<dt>gene_diseases()</dt>
-	<dd>Return a dictionary {gene: set(disease_objects for gene), ...}</dd>
-<dt>
-
-<h2>Example</h2>
-<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>
-<xmp class=code>import obiOMIM
-
-diseases = obiOMIM.diseases()
-genes = [obiOMIM.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)):
-        if set(genes[i]).intersection(genes[j]):
-            edges.append('%i %i %i\n' %(i + 1, j + 1, len(set(genes[i]).intersection(genes[j]))))
-
-file = open("disease.net", "wb")
-file.write("*Vertices %i 2\n" % len(vertices))
-file.writelines(vertices)
-file.write("*Edges\n")
-file.writelines(edges)
-</xmp>
-
-
-
-

File docs/rst/index.rst

    reference/genesets.rst
    reference/prob.rst
    reference/geo.rst
+   reference/omim.rst
 
 Installation
 ------------

File docs/rst/reference/code/omim_disease_network.py

+from Orange.bio import obiOMIM
+
+diseases = obiOMIM.diseases()
+genes = [obiOMIM.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)

File docs/rst/reference/omim.rst

+.. py:currentmodule:: Orange.bio.obiOMIM
+
+.. index:: NCBI
+.. index:: OMIM
+
+**************************************************************
+OMIM: Online Mendelian Inheritance in Man (:mod:`obiOMIM`)
+**************************************************************
+
+:obj:`obiOMIM` provides an interface to 
+`Online Mendelian Inheritance in Man <http://www.ncbi.nlm.nih.gov/omim>`_
+database. For now it only supports mapping genes to diseases.
+
+.. autofunction:: diseases
+
+.. autofunction:: genes
+
+.. autofunction:: disease_genes
+
+.. autofunction:: gene_diseases
+
+The following example creates a network of connected diseases and save it in pajek .net format 
+sets information file (:download:`omim_disease_network.py <code/omim_disease_network.py>`).
+
+.. literalinclude:: code/omim_disease_network.py
+

File orangecontrib/bio/obiOMIM.py

         return d
 
 def diseases():
-    """ Return all disease objects
+    """ Return all disease descriptors.
     """
     return OMIM.get_instance().diseases()
 
 def genes():
-    """ Return a set of all genes referenced in OMIM 
+    """ Return a set of all genes referenced in OMIM.
     """
     return OMIM.get_instance().genes()
 
 def disease_genes(disease):
-    """ Return a set of all genes referenced by disease in OMIM 
+    """ Return a set of all genes referenced by disease in OMIM.
     """
     return OMIM.get_instance().disease_genes(disease)
 
 def gene_diseases():
-    """ Return a dictionary {gene: set(disease_objects for gene), ...}
+    """ Return a dictionary {gene: set(disease_objects for gene), ...}.
     """
     return OMIM.get_instance().gene_diseases()