| 1 | #!/usr/bin/env python
|
|---|
| 2 |
|
|---|
| 3 | """
|
|---|
| 4 | Script that Creates a zip file for use by GMAJ
|
|---|
| 5 | """
|
|---|
| 6 | import sys, zipfile
|
|---|
| 7 |
|
|---|
| 8 | def __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 |
|
|---|
| 23 | if __name__ == "__main__": __main__()
|
|---|