Mercurial > repos > devteam > coverage
diff gops_coverage.py @ 2:7b226a8a6722 draft
planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
author | devteam |
---|---|
date | Tue, 13 Oct 2015 12:50:01 -0400 |
parents | 6b81ee6c18d3 |
children | ad25eb2c422d |
line wrap: on
line diff
--- a/gops_coverage.py Thu Apr 10 13:47:13 2014 -0400 +++ b/gops_coverage.py Tue Oct 13 12:50:01 2015 -0400 @@ -7,24 +7,22 @@ -1, --cols1=N,N,N,N: Columns for start, end, strand in first file -2, --cols2=N,N,N,N: Columns for start, end, strand in second file """ -import sys, traceback, fileinput -from warnings import warn -from bx.intervals import * -from bx.intervals.io import * -from bx.intervals.operations.coverage import * +import fileinput +import sys +from bx.intervals.io import GenomicInterval, NiceReaderWrapper +from bx.intervals.operations.coverage import coverage from bx.cookbook import doc_optparse -from galaxy.tools.util.galaxyops import * +from bx.tabular.io import ParseError +from galaxy.tools.util.galaxyops import fail, parse_cols_arg, skipped assert sys.version_info[:2] >= ( 2, 4 ) + def main(): - upstream_pad = 0 - downstream_pad = 0 - options, args = doc_optparse.parse( __doc__ ) try: chr_col_1, start_col_1, end_col_1, strand_col_1 = parse_cols_arg( options.cols1 ) - chr_col_2, start_col_2, end_col_2, strand_col_2 = parse_cols_arg( options.cols2 ) + chr_col_2, start_col_2, end_col_2, strand_col_2 = parse_cols_arg( options.cols2 ) in_fname, in2_fname, out_fname = args except: doc_optparse.exception() @@ -45,7 +43,7 @@ out_file = open( out_fname, "w" ) try: - for line in coverage( [g1,g2] ): + for line in coverage( [g1, g2] ): if type( line ) is GenomicInterval: out_file.write( "%s\n" % "\t".join( line.fields ) ) else: