I understand that sorting a BAM file, e.g.
will allow for faster random access. This makes sense, as viewing reads aligned to a certain region of the genome is much simpler if the reads are ordered by genome coordinates.
But if you sort a .bam file by read name, e.g.
then how does this allow faster random access?
I ask because there is no samtools functionality for observing reads by name - the "view" family of commands only accepts genome regions (coordinates).
How would you random access a .bam file by read name?
Code:
samtools sort my_file.bam my_file.sorted
But if you sort a .bam file by read name, e.g.
Code:
samtools sort [B]-no[/B] my_file.bam my_file.sorted_by_name
I ask because there is no samtools functionality for observing reads by name - the "view" family of commands only accepts genome regions (coordinates).
How would you random access a .bam file by read name?
Comment