Question: Need help with "Sort" tool
gravatar for hkhoja
3.5 years ago by
United States
hkhoja0 wrote:


Hi Can this tool available on Galaxy be used to sort a sam file before converting to bam file?  Should the default settings be used for that or do i need to identify the columns? Thank you





Tool name: Sort
Tool version: 1.0.3
Tool ID: sort1


sort • 794 views
ADD COMMENTlink modified 3.4 years ago • written 3.5 years ago by hkhoja0

You can use "sort" for this, but you need to know exactly what you want to archive. Do you want to sort by coordinate or read name?

ADD REPLYlink written 3.5 years ago by Bjoern Gruening5.0k
gravatar for Jennifer Hillman Jackson
3.5 years ago by
United States
Jennifer Hillman Jackson25k wrote:


Check out these published workflows for some ideas about how to use it. These sort in a way that is best for the RNA-seq tools in the Tuxedo suite (found on the public Main server or MACS. But you can import and edit any way that you'd like. You can start with a SAM or BAM file, and preserve headers, as some of these do.


Hope this helps, Jen, Galaxy team

ADD COMMENTlink written 3.5 years ago by Jennifer Hillman Jackson25k

I have looked at these work flows and as far as i can see that using the alphabetical  sorting of column 3  (RNAME) will place all the unmapped sequences with '*' at the top of the list.  

Also won't chromosomes named  1, 3, 10, 11 be ordered 1, 10 , 11, 3?

Won't all of this cause problems for programs like 'Indel Realigner '.

Isn' there an easy way to go from a BWA>sam file to a sorted bam, using the tools on use

Thanks Guy





ADD REPLYlink modified 3.3 years ago • written 3.3 years ago by Guy Reeves1.0k

Hello, The workflows are examples for RNA-seq pipelines. The Sort tool itself has many options for different types of sorting by fields. If you are not sure how each works, just run a small file through. For GATK, you will want to the sort order to be the same as the reference genome (which itself needs to be ordered "GATK style = 1,2,3,....X,Y,M"): try the tool "Picard: Reorder SAM/BAM". If you would like to review the latest set of tools we are building up (including more sorting tools) please see our test server: . The Tool Shed also has other sorting tools available for a local/cloud Galaxy:

We really do test on the Test server, so if you run into a problem with a tool, sharing it as a bug report would be great. Just note that some tools are not fully set up on Test (this changes daily) and quotas are small - this is a server to experiment on.

Thanks, Jen, Galaxy team

ADD REPLYlink written 3.3 years ago by Jennifer Hillman Jackson25k

Hi Jen 

to get files onto  is there way to transfer 1 or 2   easily from  without having to FTP them?


ADD REPLYlink written 3.3 years ago by Guy Reeves1.0k
gravatar for hkhoja
3.4 years ago by
United States
hkhoja0 wrote:

Thank you Bjoern and Jennifer for your input. to explain further, I needed to sort the bam file so that it could be used for a few of the picard analysis tools. IGV also requires sorted bam files. I was not sure if the sort tool on galaxy was the correct one to use since my data is already there.  In the past I have used the sort command in IGVTools but I am not sure if that sorts by coordinates or reads. 

Thanks again.






ADD COMMENTlink written 3.4 years ago by hkhoja0

No problem, glad that helped! Can you please mark the Jennifer's answer as correct and vote it up. This will help other with similar problems.

ADD REPLYlink written 3.4 years ago by Bjoern Gruening5.0k
Please log in to add an answer.


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