Changeset 9268:e2026b131fff in orange


Ignore:
Timestamp:
11/24/11 19:41:44 (2 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
3ca639abeabc371d750ef1504862ed9df3f98a7a
Message:

Added STRINGDetailed server files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • install-scripts/orngServer/serverUpdateScripts/updateSTRING.py

    r9105 r9268  
    33 
    44import obiPPI, orngServerFiles 
    5 import os, sys, shutil, urllib2, tarfile 
     5import os, sys, shutil, urllib2, gzip 
    66from getopt import getopt 
    77 
     
    1313serverFiles = orngServerFiles.ServerFiles(username, password) 
    1414 
    15 filename = orngServerFiles.localpath("PPI", "string-protein.sqlite") 
     15import obiPPI 
     16 
     17filename = orngServerFiles.localpath("PPI", obiPPI.STRING.FILENAME) 
     18 
    1619if os.path.exists(filename): 
    1720    os.remove(filename) 
    18      
    19 import obiPPI 
     21 
    2022obiPPI.STRING.download_data("v9.0") 
    2123 
    2224gzfile = gzip.GzipFile(filename + ".gz", "wb") 
    23 shutil.copyfileobj(open(fileaname, "rb"), gzfile) 
     25shutil.copyfileobj(open(filename, "rb"), gzfile) 
    2426 
    25 serverFiles.upload("PPI", "string-protein.sqlite", filename + ".gz", "STRING Protein interactions", 
    26                    tags=["protein interaction", "STRING", "#compression:gz", "#version:%s" % obiPPI.STRING.VERSION] 
     27serverFiles.upload("PPI", obiPPI.STRING.FILENAME, filename + ".gz",  
     28                   "STRING Protein interactions (Creative Commons Attribution 3.0 License)", 
     29                   tags=["protein interaction", "STRING",  
     30                         "#compression:gz", "#version:%s" % obiPPI.STRING.VERSION] 
    2731                   ) 
    28 serverFiles.unprotect("PPI", "string-protein.sqlite") 
     32serverFiles.unprotect("PPI", obiPPI.STRING.FILENAME) 
     33 
     34# The second part 
     35filename = orngServerFiles.localpath("PPI", obiPPI.STRINGDetailed.FILENAME_DETAILED) 
     36 
     37if os.path.exists(filename): 
     38    os.remove(filename) 
     39 
     40obiPPI.STRINGDetailed.download_data("v9.0") 
     41 
     42gzfile = gzip.GzipFile(filename + ".gz", "wb") 
     43shutil.copyfileobj(open(filename, "rb"), gzfile) 
     44 
     45serverFiles.upload("PPI", obiPPI.STRINGDetailed.FILENAME_DETAILED, filename + ".gz",  
     46                   "STRING Protein interactions (Creative Commons Attribution-Noncommercial-Share Alike 3.0 License)" , 
     47                   tags=["protein interaction", "STRING", 
     48                         "#compression:gz", "#version:%s" % obiPPI.STRINGDetailed.VERSION] 
     49                   ) 
     50serverFiles.unprotect("PPI", obiPPI.STRINGDetailed.FILENAME_DETAILED) 
     51     
Note: See TracChangeset for help on using the changeset viewer.