PageRenderTime 32ms CodeModel.GetById 28ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tools/visualization/GMAJ.py

https://bitbucket.org/h_morita_dbcls/galaxy-central
Python | 23 lines | 12 code | 4 blank | 7 comment | 5 complexity | d5926aaaa7adfaa03c636e6fbea1dd34 MD5 | raw file
 1#!/usr/bin/env python
 2
 3"""
 4Script that Creates a zip file for use by GMAJ
 5"""
 6import sys, zipfile
 7
 8def __main__():
 9    #create a new zip file
10    out_file  = zipfile.ZipFile( sys.argv[1], "w" )
11    #add info files
12    out_file.write( sys.argv[3], "input.gmaj" ) #THIS FILE MUST BE ADDED FIRST
13    out_file.write( sys.argv[2], "input.maf" )
14    
15    #add annotation files
16    for line in open( sys.argv[4] ):
17        try:
18            out_file.write( *[ field.strip() for field in line.split( "=", 1 ) ] )
19        except:
20            continue
21    out_file.close()
22
23if __name__ == "__main__": __main__()