comparison gops_basecoverage.py @ 5:37652c34b3bf draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/gops/basecoverage commit cae3e05d02e60f595bb8b6d77a84f030e9bd1689
author devteam
date Thu, 22 Jun 2017 18:37:49 -0400
parents c929b6540d07
children 4d584cf5ced5
comparison
equal deleted inserted replaced
4:346e0034714a 5:37652c34b3bf
3 Count total base coverage. 3 Count total base coverage.
4 4
5 usage: %prog in_file out_file 5 usage: %prog in_file out_file
6 -1, --cols1=N,N,N,N: Columns for start, end, strand in first file 6 -1, --cols1=N,N,N,N: Columns for start, end, strand in first file
7 """ 7 """
8 from __future__ import print_function
8 9
9 import fileinput 10 import fileinput
10 import sys 11 import sys
12
13 from bx.cookbook import doc_optparse
11 from bx.intervals.io import NiceReaderWrapper 14 from bx.intervals.io import NiceReaderWrapper
12 from bx.intervals.operations.base_coverage import base_coverage 15 from bx.intervals.operations.base_coverage import base_coverage
13 from bx.cookbook import doc_optparse
14 from bx.tabular.io import ParseError 16 from bx.tabular.io import ParseError
15 from galaxy.tools.util.galaxyops import fail, parse_cols_arg, skipped 17 from galaxy.tools.util.galaxyops import fail, parse_cols_arg, skipped
16 18
17 assert sys.version_info[:2] >= ( 2, 4 ) 19 assert sys.version_info[:2] >= ( 2, 4 )
18 20
32 strand_col=strand_col_1, 34 strand_col=strand_col_1,
33 fix_strand=True ) 35 fix_strand=True )
34 36
35 try: 37 try:
36 bases = base_coverage(g1) 38 bases = base_coverage(g1)
37 except ParseError, exc: 39 except ParseError as exc:
38 fail( "Invalid file format: %s" % str( exc ) ) 40 fail( "Invalid file format: %s" % str( exc ) )
39 out_file = open( out_fname, "w" ) 41 out_file = open( out_fname, "w" )
40 out_file.write( "%s\n" % str( bases ) ) 42 out_file.write( "%s\n" % str( bases ) )
41 out_file.close() 43 out_file.close()
42 if g1.skipped > 0: 44 if g1.skipped > 0:
43 print skipped( g1, filedesc="" ) 45 print(skipped( g1, filedesc="" ))
46
44 47
45 if __name__ == "__main__": 48 if __name__ == "__main__":
46 main() 49 main()