0
|
1 #!/usr/bin/env python
|
|
2
|
|
3 """
|
|
4 Wraps genetrack.scripts.tabs2genetrack so the tool can be executed from Galaxy.
|
|
5
|
|
6 usage: %prog input output shift
|
|
7 """
|
|
8
|
|
9 import sys, shutil, os
|
|
10 from galaxy import eggs
|
|
11 import pkg_resources
|
|
12 pkg_resources.require( "GeneTrack" )
|
|
13
|
|
14 from genetrack.scripts import tabs2genetrack
|
|
15 from genetrack import logger
|
|
16
|
|
17 if __name__ == "__main__":
|
|
18 import os
|
|
19 os.environ[ 'LC_ALL' ] = 'C'
|
|
20 #os.system( 'export' )
|
|
21
|
|
22 parser = tabs2genetrack.option_parser()
|
|
23
|
|
24 options, args = parser.parse_args()
|
|
25
|
|
26 # uppercase the format
|
|
27 options.format = options.format.upper()
|
|
28
|
|
29 if options.format not in ('BED', 'GFF'):
|
|
30 sys.stdout = sys.stderr
|
|
31 parser.print_help()
|
|
32 sys.exit(-1)
|
|
33
|
|
34 logger.disable(options.verbosity)
|
|
35
|
|
36 # missing file names
|
|
37 if not (options.inpname and options.outname and options.format):
|
|
38 parser.print_help()
|
|
39 sys.exit(-1)
|
|
40 else:
|
|
41 tabs2genetrack.transform(inpname=options.inpname, outname=options.outname,\
|
|
42 format=options.format, shift=options.shift, index=options.index, options=options)
|