9 months ago by
Convert the data to SAM format, then queryname sort. Or, queryname sort directly with Picard's SortSAM.
Samtools can only create coordinate-sorted BAM indexes in Galaxy. Picard has a queryname sort function and that always outputs a SAM file (even when BAM is input).
The Samtools Sort tool will be modified soon. The queryname sort/BAM output should be a failed result and could be considered a bug. There will be a new datatype for BAMs with a technically "unknown" sort-state in the next release named NativeBAM (can be queryname sorted or left unsorted). Tools that require queryname sorted input will be modified to have the option to re-sort directly on the tool form (some already do, example: Htseq_count).
These changes will help avoid many usage-level errors in the future. Some discussion to clear up exactly how this will work going forward was at our Gitter channel this afternoon if you are interested.
Thanks! Jen, Galaxy team