view tools/mytools/bedsort.xml @ 1:cdcb0ce84a1b

author xuebing
date Fri, 09 Mar 2012 19:45:15 -0500
parents 9071e359b9a3
line wrap: on
line source

<tool id="bedsort" name="sort">
  <description>a interval file by chr and start</description>
  <command> head -n $skip $input > $output
  &amp;&amp; tail -n+`expr $skip + 1` $input | sort -k1,1 -k2,2g >> $output    
     <param name="input" type="data" format="bed" label="Input interval file"/>
     <param name="skip" type="integer" value="0" label="top lines to skip" help="output directly, not sorted"/>
    <data format="bed" name="output" />


Unix command used::

    head -n $skip $input > $output
    tail -n+`expr $skip + 1` $input | sort -k1,1 -k2,2g >> $output