Repository 'get_flanks'
hg clone https://toolshed.g2.bx.psu.edu/repos/devteam/get_flanks

Changeset 3:4cd116158aef (2015-11-11)
Previous changeset 2:4b14d0e3a837 (2014-04-14) Next changeset 4:077f404ae1bb (2017-06-22)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/gops/get_flanks commit a1517c9d22029095120643bbe2c8fa53754dd2b7
modified:
get_flanks.py
get_flanks.xml
tool_dependencies.xml
b
diff -r 4b14d0e3a837 -r 4cd116158aef get_flanks.py
--- a/get_flanks.py Mon Apr 14 09:18:30 2014 -0400
+++ b/get_flanks.py Wed Nov 11 12:48:31 2015 -0500
[
b'@@ -9,15 +9,17 @@\n    -o, --off=N: Offset\n """\n \n-import sys, re, os\n+import sys\n from bx.cookbook import doc_optparse\n-from galaxy.tools.util.galaxyops import *\n+from galaxy.tools.util.galaxyops import parse_cols_arg\n+\n \n def stop_err( msg ):\n     sys.stderr.write( msg )\n     sys.exit()\n \n-def main(): \n+\n+def main():\n     try:\n         if int( sys.argv[3] ) < 0:\n             raise Exception\n@@ -30,26 +32,26 @@\n         chr_col_1, start_col_1, end_col_1, strand_col_1 = parse_cols_arg( options.cols )\n         inp_file, out_file, size, direction, region = args\n         if strand_col_1 <= 0:\n-            strand = "+"        #if strand is not defined, default it to +\n+            strand = "+"  # if strand is not defined, default it to +\n     except:\n         stop_err( "Metadata issue, correct the metadata attributes by clicking on the pencil icon in the history item." )\n     try:\n         offset = int(options.off)\n         size = int(size)\n-    except:    \n+    except:\n         stop_err( "Invalid offset or length entered. Try again by entering valid integer values." )\n \n-    fo = open(out_file,\'w\')\n-    \n+    fo = open(out_file, \'w\')\n+\n     skipped_lines = 0\n     first_invalid_line = 0\n     invalid_line = None\n     elems = []\n-    j=0\n+    j = 0\n     for i, line in enumerate( file( inp_file ) ):\n         line = line.strip()\n         if line and (not line.startswith( \'#\' )) and line != \'\':\n-            j+=1\n+            j += 1\n             try:\n                 elems = line.split(\'\\t\')\n                 #if the start and/or end columns are not numbers, skip that line.\n@@ -76,15 +78,15 @@\n                             elems[end_col_1] = str(int(elems[start_col_1]) + size)\n                     assert int(elems[start_col_1]) > 0 and int(elems[end_col_1]) > 0\n                     fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n-                                \n+\n                 elif direction == \'Downstream\':\n                     if strand == \'-\':\n                         if region == \'start\':\n-                           elems[end_col_1] = str(int(elems[end_col_1]) - offset)\n-                           elems[start_col_1] = str( int(elems[end_col_1]) - size )\n+                            elems[end_col_1] = str(int(elems[end_col_1]) - offset)\n+                            elems[start_col_1] = str( int(elems[end_col_1]) - size )\n                         else:\n-                           elems[end_col_1] = str(int(elems[start_col_1]) - offset)\n-                           elems[start_col_1] = str( int(elems[end_col_1]) - size )\n+                            elems[end_col_1] = str(int(elems[start_col_1]) - offset)\n+                            elems[start_col_1] = str( int(elems[end_col_1]) - size )\n                     elif strand == \'+\':\n                         if region == \'start\':\n                             elems[start_col_1] = str(int(elems[start_col_1]) + offset)\n@@ -94,31 +96,31 @@\n                             elems[end_col_1] = str(int(elems[start_col_1]) + size)\n                     assert int(elems[start_col_1]) > 0 and int(elems[end_col_1]) > 0\n                     fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n-                    \n+\n                 elif direction == \'Both\':\n                     if strand == \'-\':\n                         if region == \'start\':\n                             start = str(int(elems[end_col_1]) - offset)\n                             end1 = str(int(start) + size)\n                             end2 = str(int(start) - size)\n-                            elems[start_col_1]=start\n-                            elems[end_col_1]=end1\n+                            elems[start_col_1] = start\n+                            elems[end_col_1] = end1\n                             assert int(elems[start_col_1]) > 0 and int(elems[end_col_1]) > 0\n                             fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n-                            elems[start_col_1]=end2\n-                            elems[end_col_1]=start\n+                       '..b'           fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n-                            elems[start_col_1]=end2\n-                            elems[end_col_1]=start2\n+                            elems[start_col_1] = end2\n+                            elems[end_col_1] = start2\n                             assert int(elems[start_col_1]) > 0 and int(elems[end_col_1]) > 0\n                             fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n                     elif strand == \'+\':\n@@ -139,24 +141,24 @@\n                             start = str(int(elems[start_col_1]) + offset)\n                             end1 = str(int(start) - size)\n                             end2 = str(int(start) + size)\n-                            elems[start_col_1]=end1\n-                            elems[end_col_1]=start\n+                            elems[start_col_1] = end1\n+                            elems[end_col_1] = start\n                             assert int(elems[start_col_1]) > 0 and int(elems[end_col_1]) > 0\n                             fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n-                            elems[start_col_1]=start\n-                            elems[end_col_1]=end2\n+                            elems[start_col_1] = start\n+                            elems[end_col_1] = end2\n                             assert int(elems[start_col_1]) > 0 and int(elems[end_col_1]) > 0\n                             fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n                         elif region == \'end\':\n                             start = str(int(elems[end_col_1]) + offset)\n                             end1 = str(int(start) - size)\n                             end2 = str(int(start) + size)\n-                            elems[start_col_1]=end1\n-                            elems[end_col_1]=start\n+                            elems[start_col_1] = end1\n+                            elems[end_col_1] = start\n                             assert int(elems[start_col_1]) > 0 and int(elems[end_col_1]) > 0\n                             fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n-                            elems[start_col_1]=start\n-                            elems[end_col_1]=end2\n+                            elems[start_col_1] = start\n+                            elems[end_col_1] = end2\n                             assert int(elems[start_col_1]) > 0 and int(elems[end_col_1]) > 0\n                             fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n                         else:\n@@ -164,12 +166,12 @@\n                             end1 = str(int(start1) - size)\n                             start2 = str(int(elems[end_col_1]) + offset)\n                             end2 = str(int(start2) + size)\n-                            elems[start_col_1]=end1\n-                            elems[end_col_1]=start1\n+                            elems[start_col_1] = end1\n+                            elems[end_col_1] = start1\n                             assert int(elems[start_col_1]) > 0 and int(elems[end_col_1]) > 0\n                             fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n-                            elems[start_col_1]=start2\n-                            elems[end_col_1]=end2\n+                            elems[start_col_1] = start2\n+                            elems[end_col_1] = end2\n                             assert int(elems[start_col_1]) > 0 and int(elems[end_col_1]) > 0\n                             fo.write( "%s\\n" % \'\\t\'.join( elems ) )\n             except:\n@@ -183,7 +185,7 @@\n         stop_err( "Data issue: click the pencil icon in the history item to correct the metadata attributes." )\n     if skipped_lines > 0:\n         print \'Skipped %d invalid lines starting with #%dL "%s"\' % ( skipped_lines, first_invalid_line, invalid_line )\n-    print \'Location: %s, Region: %s, Flank-length: %d, Offset: %d \' %( direction, region, size, offset )\n-    \n+    print \'Location: %s, Region: %s, Flank-length: %d, Offset: %d \' % ( direction, region, size, offset )\n+\n if __name__ == "__main__":\n     main()\n'
b
diff -r 4b14d0e3a837 -r 4cd116158aef get_flanks.xml
--- a/get_flanks.xml Mon Apr 14 09:18:30 2014 -0400
+++ b/get_flanks.xml Wed Nov 11 12:48:31 2015 -0500
b
@@ -17,8 +17,8 @@
       <option value="Downstream">Downstream</option>
       <option value="Both">Both</option>
     </param>
-    <param name="offset" size="10" type="integer" value="0" label="Offset" help="Use positive values to offset co-ordinates in the direction of transcription and negative values to offset in the opposite direction."/>
-    <param name="size" size="10" type="integer" value="50" label="Length of the flanking region(s)" help="Use non-negative value for length"/>
+    <param name="offset" type="integer" value="0" label="Offset" help="Use positive values to offset co-ordinates in the direction of transcription and negative values to offset in the opposite direction."/>
+    <param name="size" type="integer" value="50" label="Length of the flanking region(s)" help="Use non-negative value for length"/>
     
     
   </inputs>
b
diff -r 4b14d0e3a837 -r 4cd116158aef tool_dependencies.xml
--- a/tool_dependencies.xml Mon Apr 14 09:18:30 2014 -0400
+++ b/tool_dependencies.xml Wed Nov 11 12:48:31 2015 -0500
b
@@ -1,9 +1,9 @@
 <?xml version="1.0"?>
 <tool_dependency>
   <package name="bx-python" version="0.7.1">
-      <repository changeset_revision="41eb9d9f667d" name="package_bx_python_0_7" owner="devteam" prior_installation_required="False" toolshed="http://toolshed.g2.bx.psu.edu" />
+      <repository changeset_revision="2d0c08728bca" name="package_bx_python_0_7" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
     <package name="galaxy-ops" version="1.0.0">
-      <repository changeset_revision="4e39032e4ec6" name="package_galaxy_ops_1_0_0" owner="devteam" prior_installation_required="False" toolshed="http://toolshed.g2.bx.psu.edu" />
+      <repository changeset_revision="9cbb20b85c01" name="package_galaxy_ops_1_0_0" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>