source: orange-bioinformatics/server_update/updateOMIM.py @ 1717:b9f395780e75

Revision 1717:b9f395780e75, 839 bytes checked in by markotoplak, 20 months ago (diff)

Copied server update scripts from Orange source.

Line 
1##!interval=7
2##!contact=ales.erjavec@fri.uni-lj.si
3
4import obiOMIM
5import orngServerFiles
6
7import orngEnviron
8import os, sys
9
10from getopt import getopt
11
12opt = dict(getopt(sys.argv[1:], "u:p:", ["user=", "password="])[0])
13
14username = opt.get("-u", opt.get("--user", "username"))
15password = opt.get("-p", opt.get("--password", "password"))
16
17path = os.path.join(orngEnviron.bufferDir, "tmp_OMIM")
18serverFiles = orngServerFiles.ServerFiles(username, password)
19
20try:
21    os.mkdir(path)
22except OSError:
23    pass
24filename = os.path.join(path, "morbidmap")
25obiOMIM.OMIM.download_from_NCBI(filename)
26
27serverFiles.upload("OMIM", "morbidmap", filename, title="Online Mendelian Inheritance in Man (OMIM)",
28                   tags=["genes", "diseases", "human", "OMIM" "#version:%i" % obiOMIM.OMIM.VERSION])
29serverFiles.unprotect("OMIM", "morbidmap")
Note: See TracBrowser for help on using the repository browser.