Commits

Flashpoint committed f1e7390

Added Reactome Pathways genesets for humans

  • Participants
  • Parent commits 43f9097

Comments (0)

Files changed (3)

_bioinformatics/obiGeneSets.py

 
     return GeneSets(genesets)
 
+def reactomePathwaysGeneSets():
+    """
+    Prepare human pathways gene sets from reactome pathways
+    """
+    import urllib
+    import io
+    from zipfile import ZipFile
+
+    url = urllib.urlopen("http://www.reactome.org/download/current/ReactomePathways.gmt.zip")
+    memfile = io.BytesIO(url.read())
+    with ZipFile(memfile, "r") as myzip:
+        f = myzip.open("ReactomePathways.gmt")
+        content = f.read().splitlines()      
+
+    genesets = [GeneSet(id=path.split("\t")[0], name=path.split("\t")[0], genes=path.split("\t")[2:] if path.split("\t")[2:] else [], hierarchy=("Reactome", "Pathways"), organism="9606", link="") for path in content]
+    return GeneSets(genesets)
+
+
 def omimGeneSets():
     """
     Return gene sets from OMIM (Online Mendelian Inheritance in Man) diseses
                 print "organism not found", org
 
 if __name__ == "__main__":
-    print cytobandGeneSets()
+    print reactomePathwaysGeneSets()
     exit()
     rsf = orngServerFiles.ServerFiles(username=sys.argv[1], password=sys.argv[2])
     upload_genesets(rsf)

server_update/updateCytobands.py

+##interval:7
+from common import *
+
+"""
+Orange server upload for Cytoband gene sets
+"""
+from Orange.bio.obiGeneSets import cytobandGeneSets, register
+
+cytoband_sets_split = cytobandGeneSets().split_by_hierarchy()
+for band_sets in cytoband_sets_split:
+    register(band_sets, sf_server)

server_update/updateReactomePathways.py

+##interval:7
+from common import *
+
+"""
+Orange server upload for Cytoband gene sets
+"""
+from Orange.bio.obiGeneSets import reactomePathwaysGeneSets, register
+
+reactome_sets_split = reactomePathwaysGeneSets().split_by_hierarchy()
+for pathway_sets in reactome_sets_split:
+    register(pathway_sets, sf_server)