Question: Using samtools sort to convert .sam files to .bam files
0
gravatar for H.LU11
6 months ago by
H.LU110
H.LU110 wrote:

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 • 539 views
ADD COMMENTlink modified 6 months ago by Pierre Lindenbaum119k • written 6 months ago by H.LU110

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 REPLYlink written 6 months ago by RamRS21k

Thank you for formatting the code for me.

ADD REPLYlink written 6 months ago by H.LU110

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 REPLYlink written 6 months ago by Carlo Yague4.4k
0
gravatar for Pierre Lindenbaum
6 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum119k wrote:

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 COMMENTlink written 6 months ago by Pierre Lindenbaum119k

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 REPLYlink written 6 months ago by H.LU110

see option -m

 -m INT     Set maximum memory per thread; suffix K/M/G recognized [768M]
ADD REPLYlink written 6 months ago by Pierre Lindenbaum119k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1194 users visited in the last hour