changeset 1:df4bce472400 draft

planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
author devteam
date Tue, 13 Oct 2015 12:51:35 -0400
parents 8a3448727cec
children 659a1c095357
files subtract_query.py tool_dependencies.xml
diffstat 2 files changed, 21 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/subtract_query.py	Tue Apr 01 09:12:49 2014 -0400
+++ b/subtract_query.py	Tue Oct 13 12:51:35 2015 -0400
@@ -6,7 +6,7 @@
 usage: %prog in_file_1 in_file_2 begin_col end_col output
     --ignore-empty-end-cols: ignore empty end columns when subtracting
 """
-import sys, re
+import sys
 from bx.cookbook import doc_optparse
 
 # Older py compatibility
@@ -17,6 +17,7 @@
 
 assert sys.version_info[:2] >= ( 2, 4 )
 
+
 def get_lines(fname, begin_col='', end_col='', ignore_empty_end_cols=False):
     lines = set([])
     i = 0
@@ -27,22 +28,25 @@
                 """Both begin_col and end_col must be integers at this point."""
                 try:
                     line = line.split('\t')
-                    line = '\t'.join([line[j] for j in range(begin_col-1, end_col)])
+                    line = '\t'.join([line[j] for j in range(begin_col - 1, end_col)])
                     if ignore_empty_end_cols:
                         # removing empty fields, we do not compare empty fields at the end of a line.
                         line = line.rstrip()
                     lines.add( line )
-                except: pass
+                except:
+                    pass
             else:
                 if ignore_empty_end_cols:
                     # removing empty fields, we do not compare empty fields at the end of a line.
                     line = line.rstrip()
                 lines.add( line )
-    if i: return (i+1, lines)
-    else: return (i, lines)
+    if i:
+        return (i + 1, lines)
+    else:
+        return (i, lines)
+
 
 def main():
-    
     # Parsing Command Line here
     options, args = doc_optparse.parse( __doc__ )
 
@@ -50,10 +54,10 @@
         inp1_file, inp2_file, begin_col, end_col, out_file = args
     except:
         doc_optparse.exception()
-    
+
     begin_col = begin_col.strip()
     end_col = end_col.strip()
-    
+
     if begin_col != 'None' or end_col != 'None':
         """
         The user selected columns for restriction.  We'll allow default
@@ -75,7 +79,7 @@
         begin_col = end_col = ''
 
     try:
-        fo = open(out_file,'w')
+        fo = open(out_file, 'w')
     except:
         print >> sys.stderr, "Unable to open output file"
         sys.exit()
@@ -88,7 +92,7 @@
     len1, lines1 = get_lines(inp1_file, begin_col, end_col, options.ignore_empty_end_cols)
     diff1 = len1 - len(lines1)
     len2, lines2 = get_lines(inp2_file, begin_col, end_col, options.ignore_empty_end_cols)
-    
+
     lines1.difference_update(lines2)
     """lines1 is now the set of unique lines in inp1_file - the set of unique lines in inp2_file"""
 
@@ -96,15 +100,15 @@
         print >> fo, line
 
     fo.close()
-    
-    info_msg = 'Subtracted %d lines. ' %((len1 - diff1) - len(lines1))
-    
+
+    info_msg = 'Subtracted %d lines. ' % ((len1 - diff1) - len(lines1))
+
     if begin_col and end_col:
         info_msg += 'Restricted to columns c' + str(begin_col) + ' thru c' + str(end_col) + '. '
 
     if diff1 > 0:
-        info_msg += 'Eliminated %d duplicate/blank/comment/invalid lines from first query.' %diff1
-    
+        info_msg += 'Eliminated %d duplicate/blank/comment/invalid lines from first query.' % diff1
+
     print info_msg
 
 if __name__ == "__main__":
--- a/tool_dependencies.xml	Tue Apr 01 09:12:49 2014 -0400
+++ b/tool_dependencies.xml	Tue Oct 13 12:51:35 2015 -0400
@@ -1,9 +1,9 @@
 <?xml version="1.0"?>
 <tool_dependency>
   <package name="bx-python" version="0.7.1">
-      <repository changeset_revision="cdb5991f9790" name="package_bx_python_0_7" owner="devteam" prior_installation_required="False" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+      <repository changeset_revision="35e2457234ef" name="package_bx_python_0_7" owner="devteam" toolshed="https://testtoolshed.g2.bx.psu.edu" />
     </package>
     <package name="galaxy-ops" version="1.0.0">
-      <repository changeset_revision="3287c55c02b8" name="package_galaxy_ops_1_0_0" owner="devteam" prior_installation_required="False" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+      <repository changeset_revision="3287c55c02b8" name="package_galaxy_ops_1_0_0" owner="devteam" toolshed="https://testtoolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>