Changeset 1932:7b87ecd92e85 in orange-bioinformatics


Ignore:
Timestamp:
12/11/13 23:10:54 (4 months ago)
Author:
markotoplak
Branch:
default
Message:

Gene matching documentation.

Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • docs/rst/index.rst

    r1919 r1932  
    2727   reference/ontology.rst 
    2828   reference/dictybase.rst 
     29   reference/gene.rst 
    2930 
    3031Installation 
  • orangecontrib/bio/obiGene.py

    r1927 r1932  
    423423class Matcher(object): 
    424424    """ 
    425     Gene matcher tries to match an input gene to some target. 
     425    Matches an input gene to some target gene (set in advance). 
    426426    """ 
    427427 
     
    434434    def set_targets(self, targets): 
    435435        """ 
    436         Set input list of gene names as targets.  
    437         Abstract function. 
     436        Set input list of gene names (a list of strings) as target genes. 
    438437        """ 
    439438        notImplemented() 
    440439 
    441440    def match(self, gene): 
    442         """Returns a list of matching target gene names.""" 
     441        """Return a list of target gene aliases which share a set of aliases with the input gene (can be empty).""" 
    443442        notImplemented() 
    444443 
    445444    def umatch(self, gene): 
    446         """Returns an unique (only one matching target) target or None""" 
     445        """Return an the single (unique)  matching target gene or None, if there are no matches or multiple matches.""" 
    447446        mat = self.match(gene) 
    448447        return mat[0] if len(mat) == 1 else None 
     
    450449    def explain(self, gene): 
    451450        """  
    452         Returns an gene matches with explanations as lists of tuples.  
    453         Each tuple consists of a list of target genes in a set 
    454         of aliases matched to input gene, returned as a second part 
    455         of the tuple. 
     451        Return gene matches with explanations as lists of tuples: 
     452        a list of matched target genes and the corresponding set of gene aliases. 
    456453        """ 
    457454        notImplemented() 
     
    651648 
    652649class MatcherAliasesKEGG(MatcherAliasesPickled): 
     650    """ Alias: GMKEGG.  
     651    """ 
    653652 
    654653    def _organism_name(self, organism): 
     
    691690 
    692691class MatcherAliasesGO(MatcherAliasesPickled): 
     692    """ Alias: GMGO. 
     693    """ 
    693694 
    694695    def _organism_name(self, organism): 
     
    717718 
    718719class MatcherAliasesDictyBase(MatcherAliasesPickled): 
     720    """ Alias: GMDicty. 
     721    """ 
    719722 
    720723    def create_aliases(self): 
     
    738741 
    739742class MatcherAliasesNCBI(MatcherAliasesPickled): 
     743    """ Alias: GMNCBI. 
     744    """ 
    740745 
    741746    def _organism_name(self, organism): 
     
    778783         
    779784class MatcherAliasesEnsembl(MatcherAliasesPickled): 
    780     """ A matcher for Ensemble ids 
     785    """ A matcher for Ensemble ids. Alias: GMEnsemble. 
    781786    """ 
    782787    DEF_ATTRS = ["ensembl_gene_id", "external_gene_id", "entrezgene"] 
     
    908913class MatcherDirect(Matcher): 
    909914    """ 
    910     Direct matching to targets. 
     915    Directly match target names. Can ignore case. Alias: GMDirect. 
    911916    """ 
    912917 
     
    942947def matcher(matchers, direct=True, ignore_case=True): 
    943948    """ 
    944     Build a matcher from a sequence of matchers. If a sequence element is a 
    945     sequence, join matchers in the subsequence. 
    946  
    947     direct - if True, add a direct matcher to targets 
    948     ignore_case - if True, ignores case with optionally added direct matcher  
     949    Builds a new matcher from a list of gene matchers. Apply matchers in 
     950    the input list successively until a match is found. If a list element 
     951    is a a list, join matchers in the list by joining overlapping sets 
     952    of aliases. 
     953 
     954    :param matchers: gene matchers.   
     955    :param direct: If True, first try 
     956      to match gene directly (a :obj:`MatcherDirect` is inserted in front of the 
     957      gene matcher sequence).   
     958    :param ignore_case: passed to the added 
     959      direct matcher. 
    949960    """ 
    950961    seqmat = [] 
Note: See TracChangeset for help on using the changeset viewer.