diff subtract_query.py @ 3:f58ba0382c26 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/gops/subtract_query commit cae3e05d02e60f595bb8b6d77a84f030e9bd1689
author devteam
date Thu, 22 Jun 2017 18:51:44 -0400
parents df4bce472400
children
line wrap: on
line diff
--- a/subtract_query.py	Fri Dec 18 19:39:32 2015 -0500
+++ b/subtract_query.py	Thu Jun 22 18:51:44 2017 -0400
@@ -1,12 +1,14 @@
 #!/usr/bin/env python
 # Greg Von Kuster
-
 """
 Subtract an entire query from another query
 usage: %prog in_file_1 in_file_2 begin_col end_col output
     --ignore-empty-end-cols: ignore empty end columns when subtracting
 """
+from __future__ import print_function
+
 import sys
+
 from bx.cookbook import doc_optparse
 
 # Older py compatibility
@@ -81,7 +83,7 @@
     try:
         fo = open(out_file, 'w')
     except:
-        print >> sys.stderr, "Unable to open output file"
+        print("Unable to open output file", file=sys.stderr)
         sys.exit()
 
     """
@@ -97,7 +99,7 @@
     """lines1 is now the set of unique lines in inp1_file - the set of unique lines in inp2_file"""
 
     for line in lines1:
-        print >> fo, line
+        print(line, file=fo)
 
     fo.close()
 
@@ -109,7 +111,8 @@
     if diff1 > 0:
         info_msg += 'Eliminated %d duplicate/blank/comment/invalid lines from first query.' % diff1
 
-    print info_msg
+    print(info_msg)
+
 
 if __name__ == "__main__":
     main()