source: orange-bioinformatics/server_update/updatePPI.py @ 1721:921b3780c6cc

Revision 1721:921b3780c6cc, 1.2 KB checked in by markotoplak, 19 months ago (diff)

Moved common functionality of the server files update scripts to a separate file.

Line 
1##!interval=7
2##!contact=ales.erjavec@fri.uni-lj.si
3
4from Orange.bio import obiPPI
5import urllib2, tarfile
6
7from common import *
8
9try:
10    os.mkdir(sf_local.localpath("PPI"))
11except OSError:
12    pass
13
14try:
15    sf_server.create_domain("PPI")
16except Exception, ex:
17    print ex
18
19if True:
20    obiPPI.MIPS.download()
21
22    filename = sf_local.localpath("PPI", "mppi.gz")
23    sf_server.upload("PPI", "allppis.xml", filename, "MIPS Protein interactions",
24                       tags=["protein interaction", "MIPS", "#compression:gz", "#version:%i" % obiPPI.MIPS.VERSION]
25                       )
26    sf_server.unprotect("PPI", "allppis.xml") 
27
28if True:
29    obiPPI.BioGRID.download_data("http://thebiogrid.org/downloads/archives/Release%20Archive/BIOGRID-3.1.91/BIOGRID-ALL-3.1.91.tab2.zip") #replace with the newest version
30
31    sfn = obiPPI.BioGRID.SERVER_FILE
32
33    filename = sf_local.localpath("PPI", sfn)
34
35    import gzip
36    gz = gzip.GzipFile(filename + ".gz", "wb")
37    gz.write(open(filename, "rb").read())
38    gz.close()
39
40    sf_server.upload("PPI", sfn, filename + ".gz", 
41        title="BioGRID Protein interactions", 
42        tags=["protein interaction", "BioGrid", "#compression:gz", "#version:%s" % obiPPI.BioGRID.VERSION]
43        )
44    sf_server.unprotect("PPI", sfn)
45
Note: See TracBrowser for help on using the repository browser.