Using samtools sort to convert .sam files to .bam files
1
0
Entering edit mode
5.6 years ago
H.LU11 • 0

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.

RNA-Seq alignment • 5.0k views
ADD COMMENT
0
Entering edit mode

Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

ADD REPLY
0
Entering edit mode

Thank you for formatting the code for me.

ADD REPLY
0
Entering edit mode

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).

ADD REPLY
0
Entering edit mode
5.6 years ago

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.

ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

see option -m

 -m INT     Set maximum memory per thread; suffix K/M/G recognized [768M]
ADD REPLY

Login before adding your answer.

Traffic: 3254 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6