hg19 as reference produce bad ordered bam starting chr10,chr11,chr,12…etc and then chr1,chr2,etc
This is true and annoying at times, but not easy to change. Question is: what specific problem is it causing you and can we find a workaround?
Have you tried the tool “bedtools SortBED”?
Regarding the cause I think the proper term is called “lexicographic order”. So what happens is that the sorting algorithm compares the first number in the string (ie 1, 2 etc) and then the second (0, 1, 2 or nothing for number 1-9). But I don’t know the specifics of different alignment tools and what they use for sorting.