I was just wondering why we always needs to convert .sam to .bam and the sort it and convert back to .sam Any programming bottle necks to handle .sam file directly for this?
I was just wondering why we always needs to convert .sam to .bam and the sort it and convert back to .sam Any programming bottle necks to handle .sam file directly for this?
Sorting is a resource consuming operation, the binary formats will sort much faster.
Why would you convert back to sam? Leave things in .bam as much as possible. You probably only need to eyeball exerpts of your .sam file. pipe samtools view into something else if you have to run awk or grep or something like that on a ,bam file
You could use Picard's SortSam
tool to just sort the .sam
file directly.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
If you convert a sorted .bam file to .sam file, are you sure the .sam file is sorted?
yes, the samtools view command output the records in the bam file in the order they are stored.