Changeset 1795:663192bd4469 in orange-bioinformatics for _bioinformatics/obiGeneSets.py


Ignore:
Timestamp:
05/20/13 10:24:50 (11 months ago)
Author:
Flashpoint <vid.flashpoint@…>
Branch:
default
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGeneSets.py

    r1794 r1795  
    7979def cytobandGeneSets(): 
    8080    """ 
    81     Return cytoband gene sets from Stanford Microarray Database 
    82     """ 
    83     from . import obiCytobands 
    84      
    85     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 
    86                         link="") \ 
    87                         for band in obiCytobands.bands()] 
    88    
     81    Create cytoband gene sets from Stanford Microarray Database 
     82    """ 
     83    import urllib2 
     84 
     85    url = "http://www-stat.stanford.edu/~tibs/GSA/cytobands-stanford.gmt" 
     86    stream = urllib2.urlopen(url) 
     87    data = stream.read().splitlines() 
     88 
     89    genesets = [] 
     90    for band in data: 
     91        b = band.split("\t") 
     92        genesets.append(GeneSet(id=b[0], name=b[1], genes=b[2:] if b[2:] else [], hierarchy=("Cytobands",), organism="9606", link=""))           
     93 
    8994    return GeneSets(genesets) 
    9095 
     
    391396 
    392397if __name__ == "__main__": 
     398    print cytobandGeneSets() 
     399    exit() 
    393400    rsf = orngServerFiles.ServerFiles(username=sys.argv[1], password=sys.argv[2]) 
    394401    upload_genesets(rsf) 
Note: See TracChangeset for help on using the changeset viewer.