Changeset 1330:45ced56f4661 in orange-bioinformatics for widgets/OWGOEnrichmentAnalysis.py


Ignore:
Timestamp:
02/24/11 16:48:10 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
5e9627628025d5cf7c79f9ca58f9908a8a190e20
Message:
  • changed special handling of genematcher for dicty
  • changed info label to show only matches for unique genes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • widgets/OWGOEnrichmentAnalysis.py

    r1328 r1330  
    521521                    try: 
    522522                        if taxid == "352472": 
    523                             matchers.append([matcher(taxid), obiGene.GMDicty()]) 
     523                            matchers.extend([matcher(taxid), obiGene.GMDicty(), 
     524                                            [matcher(taxid), obiGene.GMDicty()]]) 
     525                            # The reason machers are duplicated is that we want `matcher` or `GMDicty` to 
     526                            # match genes by them self if possible. Only use the joint matcher if they fail.    
    524527                        else: 
    525528                            matchers.append(matcher(taxid)) 
    526529                    except Exception, ex: 
    527530                        print ex 
    528             matchers.reverse() 
    529531            self.annotations.genematcher = obiGene.matcher(matchers) 
    530532            self.annotations.genematcher.set_targets(self.annotations.geneNames) 
     
    554556            self.error(1, "Failed to extract gene names from input dataset! %s" % str(ex)) 
    555557            return {} 
    556  
    557558        genesCount = len(clusterGenes) 
     559        genesSetCount = len(set(clusterGenes)) 
    558560         
    559561        self.clusterGenes = clusterGenes = self.annotations.GetGeneNamesTranslator(clusterGenes).values() 
    560562         
    561563#        self.clusterGenes = clusterGenes = filter(lambda g: g in self.annotations.aliasMapper or g in self.annotations.additionalAliases, clusterGenes) 
    562         self.infoLabel.setText("%i genes on input\n%i (%.1f%%) gene names matched" % (genesCount, len(clusterGenes), 100.0*len(clusterGenes)/genesCount if genesCount else 0.0)) 
     564        self.infoLabel.setText("%i unique genes on input\n%i (%.1f%%) genes with known annotations" % (genesSetCount, len(clusterGenes), 100.0*len(clusterGenes)/genesSetCount if genesSetCount else 0.0)) 
    563565         
    564566        referenceGenes = None 
Note: See TracChangeset for help on using the changeset viewer.