Changeset 1654:61fbdcb67aab in orange-bioinformatics for _bioinformatics/obiGeneAtlas.py


Ignore:
Timestamp:
05/21/12 10:25:29 (2 years ago)
Author:
mitar
Branch:
default
Children:
1655:9d3ae06d69be, 1657:edc96b23f6ef
Parents:
1653:508c7aa2e03c (diff), 1622:3d2f34a594e5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Tags:
2.5a1
Message:

Merge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGeneAtlas.py

    r1643 r1654  
    3838## 
    3939 
     40CACHE_VERSION = 1 
     41 
     42 
    4043def _cache(name="AtlasGeneResult.shelve"): 
    4144    """ Return a open cache instance (a shelve object). 
     
    4649        except OSError: 
    4750            pass 
    48     return shelve.open(orngServerFiles.localpath("GeneAtlas", name)) 
     51    cache = shelve.open(orngServerFiles.localpath("GeneAtlas", name)) 
     52    if cache.get(name + "__CACHE_VERSION__", None) == CACHE_VERSION: 
     53        return cache 
     54    else: 
     55        cache = shelve.open(orngServerFiles.localpath("GeneAtlas", name), "n") 
     56        cache[name + "__CACHE_VERSION__"] = CACHE_VERSION 
     57        return cache 
     58 
    4959 
    5060SLEEP_TIME_MULTIPLIER = 3.0 
     
    116126            result_experiment = [] 
    117127            for exp in experiments: 
    118                 exp_accession = exp["accession"] 
    119                 updown = exp["expression"] 
     128                if "accession" in exp: 
     129                    exp_accession = exp["accession"] 
     130                elif "experimentAccession" in exp: 
     131                    exp_accession = exp["experimentAccession"] 
     132                else: 
     133                    raise KeyError() 
     134                if "expression" in exp: 
     135                    updown = exp["expression"] 
     136                elif "updn" in exp: 
     137                    updown = exp["updn"] 
     138                else: 
     139                    raise KeyError 
    120140                pval = exp["pvalue"] 
    121141                result_experiment.append(ExperimentExpression(exp_accession, updown, pval)) 
Note: See TracChangeset for help on using the changeset viewer.