Hi Pierre, thank you for the information. If the size of the .sam files are small and can fit in the memory, is it possible to have zero temporary chunks of data? Thank you.
Using samtools sort to convert .sam files to .bam files
Hi all, I am using the following command to convert .sam files to .bam files:
samtools sort -@ 8 -o SampleID.bam SmapleID.sam
The standard error files usually start with something like "merging from 16 (this number varies) files ..." I was wondering what the number means.
Also, for several of my samples, I got messages saying that "merging from 0 files..." Does it indicate that the resulting .bam files do not contain any alignment information?
Any input?
Thank you very much.
• 5,575 views
•
link
1 answer
merging from 16 (this number varies) files
when the number of reads cannot fit in memory, the tool need to sort on disk. https://en.wikipedia.org/wiki/External_sorting
those '16 files' are the temporay chunks of data stored on disk.
• 1 views
•
link
• 1 views
•
link
see option -m
-m INT Set maximum memory per thread; suffix K/M/G recognized [768M]
• 1 views
•
link
Log in to answer this question.
Please use the formatting bar (especially the
codeoption) to present your post better. I've done it for you this time.Thank you for formatting the code for me.
Note that if what you are really after is sam - bam conversion, its must faster to use
samtools view(but it doesn't sort obviously).