Changeset 1574:fc0bf0206c8b in orange-bioinformatics


Ignore:
Timestamp:
02/20/12 19:57:11 (2 years ago)
Author:
ales_erjavec
Branch:
default
rebase_source:
a7669921cd2ae8c8c565efb116806f03a22ee244
Message:

Added import of orngEnviron. Check the geneset taxids for valid ids.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • widgets/OWSetEnrichment.py

    r1498 r1574  
    1313import math 
    1414import orngServerFiles 
     15import orngEnviron 
    1516 
    1617from orngDataCaching import data_hints 
     
    5455        rhs = _toPyObject(other.data(column, Qt.DisplayRole)) 
    5556        return lhs < rhs 
     57     
     58def name_or_none(id): 
     59    """Return organism name for ncbi taxid or None if not found. 
     60    """ 
     61    try: 
     62        return obiTaxonomy.name(id) 
     63    except obiTaxonomy.UnknownSpeciesIdentifier: 
     64        return None 
    5665             
    5766class OWSetEnrichment(OWWidget): 
     
    197206                organisms = set(obiTaxonomy.essential_taxids() + [t[1] for t in all]) 
    198207            self.progressBarFinished() 
     208             
     209            organism_names = map(name_or_none, organisms) 
     210            organisms = [taxid for taxid, name in zip(organisms, organism_names) \ 
     211                         if name is not None] 
     212             
    199213            self.taxid_list = list(organisms) 
    200214            self.speciesComboBox.clear() 
Note: See TracChangeset for help on using the changeset viewer.