root/galaxy-central/tools/visualization/GMAJ.py

リビジョン 2, 0.6 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
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__()
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。