view bamsort.xml @ 5:bdd1995c9e66

upgrade to mimodd version 0.1.6.1
author Wolfgang Maier
date Tue, 28 Jul 2015 23:21:11 +0200
parents 72d20758ba2c
children 85214e4428fd
line wrap: on
line source

<tool id="bamsort" name="Sort BAM file" version="0.1.6.1">
  <description>Sort a BAM file by coordinates (or names) of the mapped reads</description>
  <macros>
    <import>toolshed_macros.xml</import>
  </macros>
  <expand macro="requirements"/>
  <version_command>mimodd version -q</version_command>
  <command>
	mimodd sort "$input.ifile" -o "$output" --iformat $input.iformat --oformat $oformat $by_name
  </command>
  
  <inputs>
    <conditional name="input">
      <param name="iformat" type="select" label = "Input data format">
        <option value="bam">bam</option>
        <option value="sam">sam</option>
      </param>
      <when value="bam">
        <param name="ifile" type="data" format="bam" label="BAM input file to sort" />
      </when>
      <when value="sam">
        <param name="ifile" type="data" format="sam" label="SAM input file to sort" />
      </when>
    </conditional>
    <param name="oformat" type="select" label = "Output format for the sorted data">
      <option value="bam">bam</option>
      <option value="sam">sam</option>
    </param>
    <param name="by_name" type="boolean" truevalue = "-n" falsevalue ="" label="Sort by read names instead of coordinates" checked = "false" help="A less common option, but necessary, e.g., if you want to re-align sorted output from a previous run of the Snap Align Tool." />
  </inputs>
  
  <outputs>
    <data name="output" format="bam" label="Sorted output from MiModd ${tool.name} on ${on_string}">
      <change_format>
	 <when input="oformat" value="sam" format="sam" />
      </change_format>
    </data>
  </outputs>

<help>
.. class:: infomark

   **What it does**

The tool sorts a BAM file of aligned reads, typically by the reference genome coordinates that the reads have been mapped to.

Coordinate-sorted input files are expected by most downstream MiModD tools, but note that the *SNAP Read Alignment* produces coordinate-sorted output by default and it is only necessary to sort files that come from other sources or from *SNAP Read Alignment* jobs with a custom sort order.

The option *Sort by read names instead of coordinates* is useful if you want to re-align coordinate-sorted paired-end data. In *paired-end mode*, the *SNAP Read Alignment* tool expects the reads in the input file to be arranged in read pairs, i.e., the forward read information of a pair must be followed immediately by its reverse mate information, which is typically not the case in coordinate-sorted files. Resorting such files by read names fixes this problem.

</help>
</tool>