Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGeneSets.py

    r1719 r1761  
    3434        hier = ("GO", term.namespace) 
    3535        if len(genes) > 0: 
    36             gs = GeneSet(id=termn, name=term.name, genes=genes, hierarchy=hier, organism=org, link=link_fmt % termn)  
     36            gs = GeneSet(id=termn, name=term.name, genes=genes, hierarchy=hier, organism=org, link=link_fmt % termn) 
    3737            genesets.append(gs) 
    3838 
     
    4343    Returns gene sets from KEGG pathways. 
    4444    """ 
    45      
     45 
    4646    kegg = obiKEGG.KEGGOrganism(org) 
    4747 
     
    6161    return GeneSets(genesets) 
    6262 
     63def dictyMutantSets(): 
     64    """ 
     65    Return dicty mutant phenotype gene sets from Dictybase 
     66    """ 
     67    from . import obiDictyMutants 
     68    genesets = [GeneSet(id=dicty_mutant.id, name=dicty_mutant.descriptor, genes=obiDictyMutants.mutant_genes(mutant), hierarchy=("Dictybase", "mutant_phenotypes"), organism="352472", # 352742 gathered from obiGO.py code_map -> Dicty identifier 
     69                        link=("http://dictybase.org/db/cgi-bin/dictyBase/SC/scsearch.pl?searchdb=strains&search_term=%s&column=all&B1=Submit" % mutant.id if mutant.id else None)) \ 
     70                        for mutant in obiDictyMutants.mutants()] 
     71    return GeneSets(genesets) 
     72 
    6373def omimGeneSets(): 
    6474    """ 
    6575    Return gene sets from OMIM (Online Mendelian Inheritance in Man) diseses 
    6676    """ 
    67     from . import obiOMIM 
     77    from . import obiOMIM    # The link here leads to a redirection... should replace it with the new URL 
    6878    genesets = [GeneSet(id=disease.id, name=disease.name, genes=obiOMIM.disease_genes(disease), hierarchy=("OMIM",), organism="9606", 
    6979                    link=("http://www.ncbi.nlm.nih.gov/entrez/dispomim.cgi?id=" % disease.id if disease.id else None)) \ 
     
    8898    if ontology is None: 
    8999        ontology = obiGO.Ontology() 
    90           
     100 
    91101    annotations = obiGO.Annotations(org, ontology=ontology) 
    92      
     102 
    93103    go_sets = obimiRNA.get_GO(mirnas, annotations, enrichment=enrichment, pval=pval, goSwitch=False) 
    94104    print go_sets 
    95      
     105 
    96106    go_sets = obimiRNA.filter_GO(go_sets, annotations, treshold=treshold) 
    97      
     107 
    98108    link_fmt = "http://amigo.geneontology.org/cgi-bin/amigo/term-details.cgi?term=%s" 
    99109    gsets = [GeneSet(id=key, name=ontology[key].name, genes=value, hierarchy=("miRNA", "go_sets",), 
     
    102112    return gset 
    103113 
    104  
    105114def loadGMT(contents, name): 
    106115    """ 
    107116    Eech line consists of tab separated elements. First is 
    108117    the geneset name, next is it's description. 
    109      
     118 
    110119    For now the description is skipped. 
    111120    """ 
     
    174183    gs_files = filter(is_genesets_file, os.listdir(pth)) 
    175184    return [ filename_parse(fn) + (True,) for fn in gs_files ] 
    176      
     185 
    177186def list_serverfiles_from_flist(flist): 
    178187    gs_files = filter(is_genesets_file, flist) 
     
    212221 
    213222    tfname = pickle_temp(flist) 
    214      
     223 
    215224    try: 
    216225        fn = "index.pck" 
     
    254263    #save to temporary file 
    255264    tfname = pickle_temp(genesets) 
    256      
     265 
    257266    try: 
    258267        taxname = obiTaxonomy.name(org) 
     
    300309    out = GeneSets() 
    301310    for (h, o) in [ files[i] for i in hierd[(hierarchy, organism)]]: 
    302         fname = orngServerFiles.localpath_download(sfdomain,  
     311        fname = orngServerFiles.localpath_download(sfdomain, 
    303312            filename(h, o)) 
    304313        out.update(pickle.load(open(fname, 'r'))) 
     
    344353def upload_genesets(rsf): 
    345354    """ 
    346     Builds the default gene sets and  
     355    Builds the default gene sets and 
    347356    """ 
    348357    orngServerFiles.update_local_files() 
     
    367376    upload_genesets(rsf) 
    368377    pass 
     378 
     379 
Note: See TracChangeset for help on using the changeset viewer.