I am new to RNA seq analysis, and I am at the stage of sorting my bam file after alignment. I need to further use this sorted bam file as an input for HTseq counting. I understand that I can perform the sorting by name or by coordinates according to the samtools documentation. Could someone please explain how to decide between sorting by name or by coordinate? I read that the default is by coordinate, and that the coordinate sorted bam file will work as an input for "samtools index" command, as well as for HTseq counting command. So it seems like coordinate sorted file is the best. However, is there any case where a name sorted file is better? What does one need to consider? Thank you for your help.
Oh okay, I see. Thanks so much for the examples!
If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.
oh okay thanks for letting me know!