I am looking for a tool to convert SAM to sorted BAM (sorted by the coordinates, such as with samtools sort or picard's SortSam).
Hi,
Samtools sort is available in the ToolShed for use in a local or cloud Galaxy:
http://toolshed.g2.bx.psu.edu/view/iuc/samtools_sort
A ticket to add this tool to the public Main Galaxy instance http://usegalaxy.org is open here: https://trello.com/c/PxiesIK6
Main has a tool that sorts by the ordering of the reference genome (Reorder SAM/BAM) but this is not quite the same function.
And finally, SAM files can be coordinate sorted, then converted to BAM format, but this will not change the sort status in the header. Still, it is often enough for many tools. A sample workflow is below. If starting with a SAM file, modify the workflow to eliminate the initial BAM-to-SAM conversion:
http://usegalaxy.org/u/jen-bx-galaxy-edu/w/sort-bam-inc-headers
Best, Jen, Galaxy team