source: orange-bioinformatics/server_update/updateDictyBase.py @ 1783:4a72eace4f4c

Revision 1783:4a72eace4f4c, 1.4 KB checked in by markotoplak, 12 months ago (diff)

Register already calls update_server_list internally.

RevLine 
[1717]1##interval:7
[1721]2from common import *
3
[1717]4import sys, os
5from gzip import GzipFile
6import tempfile
[1718]7from Orange.bio.obiDicty import DictyBase
[1781]8import Orange.bio.obiDictyMutants as DictyMutants
[1717]9
10tmpdir = tempfile.mkdtemp("dictybase")
11base = DictyBase.pickle_data()
12filename = os.path.join(tmpdir, "tf")
13
14f = open(filename, 'wb')
15f.write(base)
16f.close()
17
18dom = DictyBase.domain
19fn = DictyBase.filename
20
21try:
[1721]22    sf_server.create_domain('dictybase')
[1717]23except:
24    pass
25
26print filename
27
[1721]28sf_server.upload(dom, fn, filename, title="dictyBase gene aliases",
[1717]29    tags=DictyBase.tags)
[1721]30sf_server.unprotect(dom, fn)
[1717]31
32shutil.rmtree(tmpdir)
[1781]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"""
[1782]61from Orange.bio.obiGeneSets import dictyMutantSets, update_server_list, register
[1781]62
[1782]63mutant_sets_split = dictyMutantSets().split_by_hierarchy()
64for mutant_sets in mutant_sets_split:
65    register(mutant_sets, sf_server)
Note: See TracBrowser for help on using the repository browser.