diff gops_basecoverage.py @ 6:4d584cf5ced5 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/gops/basecoverage commit 200bd4645dd768eb6ee1aab7d181b76d34d13d4c
author devteam
date Mon, 13 Jun 2022 16:26:51 +0000
parents 37652c34b3bf
children
line wrap: on
line diff
--- a/gops_basecoverage.py	Thu Jun 22 18:37:49 2017 -0400
+++ b/gops_basecoverage.py	Mon Jun 13 16:26:51 2022 +0000
@@ -8,7 +8,6 @@
 from __future__ import print_function
 
 import fileinput
-import sys
 
 from bx.cookbook import doc_optparse
 from bx.intervals.io import NiceReaderWrapper
@@ -16,33 +15,33 @@
 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():
-    options, args = doc_optparse.parse( __doc__ )
+    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_1, start_col_1, end_col_1, strand_col_1 = parse_cols_arg(options.cols1)
         in_fname, out_fname = args
-    except:
+    except Exception:
         doc_optparse.exception()
 
-    g1 = NiceReaderWrapper( fileinput.FileInput( in_fname ),
-                            chrom_col=chr_col_1,
-                            start_col=start_col_1,
-                            end_col=end_col_1,
-                            strand_col=strand_col_1,
-                            fix_strand=True )
+    g1 = NiceReaderWrapper(
+        fileinput.FileInput(in_fname),
+        chrom_col=chr_col_1,
+        start_col=start_col_1,
+        end_col=end_col_1,
+        strand_col=strand_col_1,
+        fix_strand=True
+    )
 
     try:
         bases = base_coverage(g1)
     except ParseError as exc:
-        fail( "Invalid file format: %s" % str( exc ) )
-    out_file = open( out_fname, "w" )
-    out_file.write( "%s\n" % str( bases ) )
+        fail("Invalid file format: %s" % str(exc))
+    out_file = open(out_fname, "w")
+    out_file.write("%s\n" % str(bases))
     out_file.close()
     if g1.skipped > 0:
-        print(skipped( g1, filedesc="" ))
+        print(skipped(g1, filedesc=""))
 
 
 if __name__ == "__main__":