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

Revision 1719:6e8861564778, 1.6 KB 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 obiPPI
5import Orange.utils.serverfiles as orngServerFiles
6import os, sys, shutil, urllib2, tarfile
7from getopt import getopt
8
9opt = dict(getopt(sys.argv[1:], "u:p:", ["user=", "password="])[0])
10
11username = opt.get("-u", opt.get("--user", "username"))
12password = opt.get("-p", opt.get("--password", "password"))
13
14serverFiles = orngServerFiles.ServerFiles(username, password)
15
16try:
17    os.mkdir(orngServerFiles.localpath("PPI"))
18except OSError:
19    pass
20
21try:
22    serverFiles.create_domain("PPI")
23except Exception, ex:
24    print ex
25
26if True:
27    obiPPI.MIPS.download()
28
29    filename = orngServerFiles.localpath("PPI", "mppi.gz")
30    serverFiles.upload("PPI", "allppis.xml", filename, "MIPS Protein interactions",
31                       tags=["protein interaction", "MIPS", "#compression:gz", "#version:%i" % obiPPI.MIPS.VERSION]
32                       )
33    serverFiles.unprotect("PPI", "allppis.xml") 
34
35if True:
36    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
37
38    sfn = obiPPI.BioGRID.SERVER_FILE
39
40    filename = orngServerFiles.localpath("PPI", sfn)
41
42    import gzip
43    gz = gzip.GzipFile(filename + ".gz", "wb")
44    gz.write(open(filename, "rb").read())
45    gz.close()
46
47    serverFiles.upload("PPI", sfn, filename + ".gz", 
48        title="BioGRID Protein interactions", 
49        tags=["protein interaction", "BioGrid", "#compression:gz", "#version:%s" % obiPPI.BioGRID.VERSION]
50        )
51    serverFiles.unprotect("PPI", sfn)
52
Note: See TracBrowser for help on using the repository browser.