Changes in [1803:e8183616f755:1811:d89e4d232162] in orange-bioinformatics


Ignore:
Location:
_bioinformatics
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGeneSets.py

    r1798 r1807  
    1010import cPickle as pickle, os, tempfile, sys 
    1111from collections import defaultdict 
     12import datetime 
    1213 
    1314import Orange.core as orange 
     
    143144 
    144145    go_sets = obimiRNA.get_GO(mirnas, annotations, enrichment=enrichment, pval=pval, goSwitch=False) 
    145     print go_sets 
    146146 
    147147    go_sets = obimiRNA.filter_GO(go_sets, annotations, treshold=treshold) 
     
    224224    gs_files = filter(is_genesets_file, os.listdir(pth)) 
    225225    return [ filename_parse(fn) + (True,) for fn in gs_files ] 
     226 
     227def remove_local(gene_set): 
     228    """ Removes a given gene set from the local repository. """ 
     229    pth = local_path() 
     230    gs_files = filter(is_genesets_file, os.listdir(pth))  
     231    for setfile in gs_files: 
     232        if setfile.__contains__(gene_set): 
     233            setBgone = os.path.join(pth, setfile) 
     234            os.remove(setBgone)  
     235 
     236def modification_date(file): 
     237    t = os.path.getmtime(file) 
     238    return datetime.datetime.fromtimestamp(t) 
    226239 
    227240def list_serverfiles_from_flist(flist): 
     
    414427 
    415428if __name__ == "__main__": 
    416     print reactomePathwaysGeneSets() 
    417     exit() 
    418429    rsf = orngServerFiles.ServerFiles(username=sys.argv[1], password=sys.argv[2]) 
    419430    upload_genesets(rsf) 
  • _bioinformatics/widgets/OWSetEnrichment.py

    r1794 r1810  
    6969    def __init__(self, parent=None, signalManager=None, name="Gene Set Enrichment Analysis", **kwargs): 
    7070        OWWidget.__init__(self, parent, signalManager, name, **kwargs) 
    71         self.inputs = [("Example Table", ExampleTable, self.setData, Default), ("Reference", ExampleTable, self.setReference)] 
    72         self.outputs = [("Selected Examples", ExampleTable)] 
     71        self.inputs = [("Data", ExampleTable, self.setData, Default), ("Reference", ExampleTable, self.setReference)] 
     72        self.outputs = [("Data subset", ExampleTable)] 
    7373 
    7474        self.speciesIndex = 0 
     
    204204            with orngServerFiles.DownloadProgress.setredirect(self.progressBarSet): 
    205205                all, local = obiGeneSets.list_all(), obiGeneSets.list_local() 
    206                 organisms = set(obiTaxonomy.essential_taxids() + [t[1] for t in all]) 
     206                organisms = set(obiTaxonomy.essential_taxids() + filter(None, [t[1] for t in all])) 
    207207            self.progressBarFinished() 
    208208 
     
    268268        for hierarchy, t_id, _ in self.genesets: 
    269269            collect(collection[t_id], hierarchy) 
     270 
     271        #add genesets without species identifiers 
     272        collection[taxid].update(collection[None]) 
    270273        return collection[taxid] 
    271274 
Note: See TracChangeset for help on using the changeset viewer.