source: orange-bioinformatics/server_update/updateDictyBase.py @ 1718:146dc04e42de

Revision 1718:146dc04e42de, 872 bytes checked in by markotoplak, 20 months ago (diff)

Removed KEGG update scripts, updated (and ran) dicty base and GEO.

Line 
1##interval:7
2import Orange.utils.serverfiles
3import sys, os
4from gzip import GzipFile
5from getopt import getopt
6import tempfile
7from Orange.bio.obiDicty import DictyBase
8import shutil
9
10opt = dict(getopt(sys.argv[1:], "u:p:", ["user=", "password="])[0])
11
12tmpdir = tempfile.mkdtemp("dictybase")
13
14username = opt.get("-u", opt.get("--user", "username"))
15password = opt.get("-p", opt.get("--password", "password"))
16
17print username, password
18
19base = DictyBase.pickle_data()
20filename = os.path.join(tmpdir, "tf")
21
22f = open(filename, 'wb')
23f.write(base)
24f.close()
25
26dom = DictyBase.domain
27fn = DictyBase.filename
28
29sf = Orange.utils.serverfiles.ServerFiles(username, password)
30
31try:
32    sf.create_domain('dictybase')
33except:
34    pass
35
36print filename
37
38sf.upload(dom, fn, filename, title="dictyBase gene aliases",
39    tags=DictyBase.tags)
40sf.unprotect(dom, fn)
41
42shutil.rmtree(tmpdir)
Note: See TracBrowser for help on using the repository browser.