Commits

Flashpoint  committed 663192b

Removed obiCytobands.py and created genesets in obiGeneSets.py. updateCytobands.py saves only genesets now

  • Participants
  • Parent commits 3a530b6

Comments (0)

Files changed (2)

File _bioinformatics/obiGeneSets.py

 
 def cytobandGeneSets():
     """
-    Return cytoband gene sets from Stanford Microarray Database
+    Create cytoband gene sets from Stanford Microarray Database
     """
-    from . import obiCytobands
-    
-    genesets = [GeneSet(id=band.name, name=band.descriptor, genes=obiCytobands.band_genes(band), hierarchy=("Cytobands",), organism="9606", # 352472 gathered from obiGO.py code_map -> Dicty identifier
-                        link="") \
-                        for band in obiCytobands.bands()]
-  
+    import urllib2
+
+    url = "http://www-stat.stanford.edu/~tibs/GSA/cytobands-stanford.gmt"
+    stream = urllib2.urlopen(url)
+    data = stream.read().splitlines()
+
+    genesets = []
+    for band in data:
+        b = band.split("\t")
+        genesets.append(GeneSet(id=b[0], name=b[1], genes=b[2:] if b[2:] else [], hierarchy=("Cytobands",), organism="9606", link=""))          
+
     return GeneSets(genesets)
 
 def omimGeneSets():
                 print "organism not found", org
 
 if __name__ == "__main__":
+    print cytobandGeneSets()
+    exit()
     rsf = orngServerFiles.ServerFiles(username=sys.argv[1], password=sys.argv[2])
     upload_genesets(rsf)
     pass

File _bioinformatics/obiOMIM.py

     def __init__(self, morbidmap_line):
         string = morbidmap_line.split("|", 1)[0]
         match = self.regex.match(string)
-#        print string
-#        print match.groups()
+        print string
+        print match.groups()
         self.name, self.id, self.mapping = [s.strip() if s else s for s in match.groups()[:3]]
         if match.group("m2"):
             self.mapping += " " + match.group("m2").strip()
             os.makedirs(self.local_database_path)
             
         filename = os.path.join(self.local_database_path, "morbidmap")
+        print filename
         if not os.path.exists(filename):
             stream = urllib2.urlopen("ftp://ftp.ncbi.nih.gov/repository/OMIM/ARCHIVE/morbidmap")
             with open(filename, "wb") as file: