Changeset 1345:738b2b2377a2 in orange-bioinformatics


Ignore:
Timestamp:
03/10/11 12:58:30 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
38f77043b35dff6e6ace43944d68a01d0bc87457
Message:

Added a obiArrayExpress-test.py testing script, added format parameter to query_experiments/files.

Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • obiArrayExpress.py

    r1344 r1345  
    4747        DEFAULT_CACHE = {} 
    4848     
    49     DEFAULT_ADDRESS = "http://www.ebi.ac.uk/arrayexpress/xml/v2/" 
     49    DEFAULT_ADDRESS = "http://www.ebi.ac.uk/arrayexpress/{format}/v2/" 
     50    DEFAULT_FORMAT = "json" 
    5051     
    5152    # Order of arguments in the query 
     
    8384        query = self.format_query(**kwargs) 
    8485        url = posixpath.join(self.address, what) 
     86        url = url.format(format=kwargs.get("format", self.DEFAULT_FORMAT)) 
    8587        url = url + "?" + query 
    8688#        print url 
     
    259261    """ 
    260262    import obiOntology 
     263#    return obiOntology.OBOOntology(urllib2.urlopen("http://efo.svn.sourceforge.net/svnroot/efo/trunk/src/efoinobo/efo.obo")) 
    261264    import orngServerFiles 
    262     # Should this be in the OBOFoundry domain 
     265    # Should this be in the OBOFoundry (Ontology) domain 
    263266    file_name = orngServerFiles.localpath_download("ArrayExpress", "efo.obo") 
    264267    return obiOntology.OBOOntology(open(filename, "rb")) 
     
    399402""" 
    400403 
    401 def query_atlas(condition, format="json"): 
     404def query_atlas(condition, format="json", start=None, rows=None, indent=False): 
    402405    """ Query Atlas based on a `condition` (instance of AtlasCondition) 
    403406     
     
    408411    """ 
    409412    connection = GeneExpressionAtlasConenction() 
    410     results = connection.query(condition, format=format) 
     413    results = connection.query(condition, format=format, start=start, 
     414                               rows=rows, indent=indent) 
    411415    return results 
    412416 
     
    476480    doctest.testmod(optionflags=doctest.ELLIPSIS, extraglobs={"conn": conn}) 
    477481     
    478      
    479          
Note: See TracChangeset for help on using the changeset viewer.