Thanks for your help!
It's my first time to see the words 'compression level', I'll do some research about it .
I use GATK FastqToSam to generate sam file from Fastq. Then I use different tools to convert sam to bam. I found that the size of bam file are differet. But the number of reads between them are the same (Check by samtools flagstat).
Did anyone found this different before? Why the file size are different? (different compression method?) Would this difference affect subsequent analysis?
Digging a bit, samtools uses the default compression level of the system at hand. In my system, for example, it is 6, on a scale from 1 (fast, but low compression) to 9 (slow, but high compression).
GATK uses by default 5, but there are some versions with a different default of 1.
Check the command-lines you used, and also the versions of the programs.
Thanks for your help!
It's my first time to see the words 'compression level', I'll do some research about it .
Convert sam to bam by samtools: 85MB
if you're comparing sam and bam files, of course the binary+compressed bam file will be much more compact than the text file sam....
I means the size of three BAM file that generate by different tools are different. Not comparing SAM with BAM.
Or you means that samtools would convert SAM to BAM and also do further data compression, but gatk do not compress the file?
I'm not familiar with the data compression. I'll read the website you provided,thanks.
Log in to answer this question.
What are the exact commands you used? I would guess the difference is due to default compression level, but could be something else.
I will check the manual to see whether it have different compression level or not, thanks.