Question: Convert SAM to sorted BAM
1
gravatar for biomonika
4.3 years ago by
biomonika60
United States
biomonika60 wrote:

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).

sort sam samtools bam • 5.2k views
ADD COMMENTlink modified 4.3 years ago by Jennifer Hillman Jackson25k • written 4.3 years ago by biomonika60
3
gravatar for Jennifer Hillman Jackson
4.3 years ago by
United States
Jennifer Hillman Jackson25k wrote:

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

 

ADD COMMENTlink modified 4.3 years ago • written 4.3 years ago by Jennifer Hillman Jackson25k

samtools_sort is exactly what I needed, thanks! I was searching in the toolshed under "sam" and "bam", didn't think of this.

ADD REPLYlink written 4.3 years ago by biomonika60

Jen, we need to include samtools sort into the samtools suite and in main :)

ADD REPLYlink written 4.3 years ago by Bjoern Gruening5.1k
1

Agreed, super useful. The ticket above is open with high priority status. This may be just pending prioritization. All - cast your vote in Trello! Jen

ADD REPLYlink written 4.3 years ago by Jennifer Hillman Jackson25k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 182 users visited in the last hour