source: orange-bioinformatics/server_update/updateOMIM.py @ 1719:6e8861564778

Revision 1719:6e8861564778, 883 bytes checked in by markotoplak, 20 months ago (diff)

Fixed update scripts for MeSH, GO, HomoloGene, NCBI_geneinfo, OMIM, PPI. Moved wget to Orange.utils.

Line 
1##!interval=7
2##!contact=ales.erjavec@fri.uni-lj.si
3
4from Orange.bio import obiOMIM
5import Orange.utils.serverfiles as 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.