Flashpoint  committed a94aec2

Added pickling to, changed the URL in's omimGeneSets()

  • Participants
  • Parent commits ab15a6b
  • Branches default

Comments (0)

Files changed (2)

File _bioinformatics/

 import os
 import urllib2
 import shutil
+import cPickle as pickle
 from collections import defaultdict
     def __init__(self, local_database_path=None):
         self.local_database_path = local_database_path if local_database_path is not None else self.DEFAULT_DATABASE_PATH
+        self.local_pickle_path = os.path.join(self.local_database_path, "Mutants.pkl")
         if not os.path.exists(self.local_database_path):
-        _mutants = self.prepare_mutants()
+        if not os.path.exists(self.local_pickle_path):
+            self.prepare_mutants()
+        else:
+            self._mutants = pickle.load(open(self.local_pickle_path, "rb"))
     def update_file(self, name):
         url = ""
             if in the_others: mutant.other = True
         self._mutants = {x: x for x in _mutants}
+        pickle.dump(self._mutants, open(self.local_pickle_path, "wb"), -1)
     def get_instance(cls):

File _bioinformatics/

     Return gene sets from OMIM (Online Mendelian Inheritance in Man) diseses
-    from . import obiOMIM    # The link here leads to a redirection... should replace it with the new URL
+    from . import obiOMIM    
     genesets = [GeneSet(,, genes=obiOMIM.disease_genes(disease), hierarchy=("OMIM",), organism="9606",
-                    link=("" % if else None)) \
+                    link=("" % if else None)) \
                     for disease in obiOMIM.diseases()]
     return GeneSets(genesets)