When sorting by queryname with Samtools (samtools sort -n
), Samtools does a natural sort by colon-delimited subfield. On the other hand, when sorting by queryname with Picard (picard SortSam SORT_ORDER=queryname
), Picard does not sort by colon-delimited subfield, instead treating the queryname as one field and then sorting in ASCII sort order (for example, as described in this comment and its sub-comments).
I would like to sort my bam files in the picard SortSam SORT_ORDER=queryname
manner, but Picard SortSam is quite a bit slower than samtools sort -n
; samtools sort -n
can be parallelized while picard SamSort SORT_ORDER=queryname
cannot be parallelized. Is there a fast alternative to picard SamSort SORT_ORDER=queryname
for this task?