Changeset 1778:a94aec22f398 in orange-bioinformatics


Ignore:
Timestamp:
05/07/13 09:58:15 (12 months ago)
Author:
Flashpoint <vid.flashpoint@…>
Branch:
default
Message:

Added pickling to obiDictyMutants.py, changed the URL in obiGeneSets.py's omimGeneSets()

Location:
_bioinformatics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiDictyMutants.py

    r1776 r1778  
    22import urllib2 
    33import shutil 
     4import cPickle as pickle 
    45 
    56from collections import defaultdict 
     
    2728    def __init__(self, local_database_path=None): 
    2829        self.local_database_path = local_database_path if local_database_path is not None else self.DEFAULT_DATABASE_PATH 
     30        self.local_pickle_path = os.path.join(self.local_database_path, "Mutants.pkl") 
    2931 
    3032        if not os.path.exists(self.local_database_path): 
    3133            os.mkdir(self.local_database_path) 
    3234             
    33         _mutants = self.prepare_mutants() 
     35        if not os.path.exists(self.local_pickle_path): 
     36            self.prepare_mutants() 
     37        else: 
     38            self._mutants = pickle.load(open(self.local_pickle_path, "rb")) 
    3439  
    3540    def update_file(self, name): 
     
    7580        
    7681        self._mutants = {x: x for x in _mutants} 
     82        pickle.dump(self._mutants, open(self.local_pickle_path, "wb"), -1) 
    7783 
    7884    @classmethod 
  • _bioinformatics/obiGeneSets.py

    r1761 r1778  
    7575    Return gene sets from OMIM (Online Mendelian Inheritance in Man) diseses 
    7676    """ 
    77     from . import obiOMIM    # The link here leads to a redirection... should replace it with the new URL 
     77    from . import obiOMIM     
    7878    genesets = [GeneSet(id=disease.id, name=disease.name, genes=obiOMIM.disease_genes(disease), hierarchy=("OMIM",), organism="9606", 
    79                     link=("http://www.ncbi.nlm.nih.gov/entrez/dispomim.cgi?id=" % disease.id if disease.id else None)) \ 
     79                    link=("http://www.omim.org/entry/%s" % disease.id if disease.id else None)) \ 
    8080                    for disease in obiOMIM.diseases()] 
    8181    return GeneSets(genesets) 
Note: See TracChangeset for help on using the changeset viewer.