Changeset 1781:764dc2b10839 in orange-bioinformatics for server_update/updateDictyBase.py


Ignore:
Timestamp:
05/10/13 15:19:06 (11 months ago)
Author:
Flashpoint <vid.flashpoint@…>
Branch:
default
Message:

First attempt at configuring Orange server update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server_update/updateDictyBase.py

    r1721 r1781  
    66import tempfile 
    77from Orange.bio.obiDicty import DictyBase 
     8import Orange.bio.obiDictyMutants as DictyMutants 
    89 
    910tmpdir = tempfile.mkdtemp("dictybase") 
    10  
    1111base = DictyBase.pickle_data() 
    1212filename = os.path.join(tmpdir, "tf") 
     
    3131 
    3232shutil.rmtree(tmpdir) 
     33 
     34 
     35""" 
     36Orange server upload for DictyMutants  
     37""" 
     38 
     39tmpdir_mutants = tempfile.mkdtemp("dictymutants") 
     40base_mutants = DictyMutants.download_mutants() 
     41file_mutants = os.path.join(tmpdir_mutants, "tempMut") 
     42 
     43fm = open(file_mutants, "wb") 
     44fm.write(base_mutants) 
     45fm.close() 
     46 
     47fm_dom = DictyMutants.domain 
     48fm_name = DictyMutants.pickle_file 
     49 
     50print file_mutants 
     51 
     52sf_server.upload(fm_dom, fm_name, file_mutants, title="dictyBase mutant collection", 
     53    tags=DictyMutants.tags) 
     54sf_server.unprotect(fm_dom, fm_name) 
     55 
     56shutil.rmtree(tmpdir_mutants) 
     57 
     58""" 
     59Orange server upload for Dicty mutant gene sets 
     60""" 
     61from Orange.bio.obiGeneSets import dictyMutantSets, update_server_list 
     62import cPickle as pickle 
     63 
     64mutant_sets = dictyMutantSets() 
     65 
     66tmpdir_sets = tempfile.mkdtemp("dictygenesets") 
     67file_mutants = os.path.join(tmpdir_sets, "tempSets") 
     68 
     69with open(file_mutants, "wb") as f: 
     70    pickle.dump(mutant_sets, f, -1) 
     71 
     72fm_dom = "gene_sets" 
     73fm_name = "DictyMutant phenotypes" 
     74set_tags = ["Mutant", "phenotype", "dicty"] 
     75 
     76print file_mutants 
     77 
     78sf_server.upload(fm_dom, fm_name, file_mutants, title="Dictyostelium discoideum mutant phenotypes", 
     79    tags=set_tags) 
     80sf_server.unprotect(fm_dom, fm_name) 
     81update_server_list(sf_server) 
     82 
     83shutil.rmtree(tmpdir_sets) 
     84 
Note: See TracChangeset for help on using the changeset viewer.