annotate tools/visualization/GMAJ.py @ 1:cdcb0ce84a1b

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:45:15 -0500
parents 9071e359b9a3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
1 #!/usr/bin/env python
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3 """
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4 Script that Creates a zip file for use by GMAJ
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5 """
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6 import sys, zipfile
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8 def __main__():
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
9 #create a new zip file
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
10 out_file = zipfile.ZipFile( sys.argv[1], "w" )
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
11 #add info files
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
12 out_file.write( sys.argv[3], "input.gmaj" ) #THIS FILE MUST BE ADDED FIRST
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
13 out_file.write( sys.argv[2], "input.maf" )
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
14
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
15 #add annotation files
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
16 for line in open( sys.argv[4] ):
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
17 try:
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
18 out_file.write( *[ field.strip() for field in line.split( "=", 1 ) ] )
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
19 except:
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
20 continue
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
21 out_file.close()
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
22
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
23 if __name__ == "__main__": __main__()