This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BAM file became smaller after merging

Hello all

I merged 3 bam files but the merge one size were quite smaller than before. Does anyone know the reason?

Thanks

My code is

samtools merge output.bam input1.bam input2.bam input3.bam
bam

what is the output of

file input1.bam input2.bam input3.bam

?

output.bam here

That can't be the output of the command @Pierre asked you to run.

That aside it is possible to have final output BAM files drop in size after operations that change the read order since the data can compress better leading to smaller files.

so could you tell me how to do if I want to merger these files? Thxx

Your command looks fine. I assume you are referring to output file being smaller than adding sizes of the three inputs? Are your input BAM files sorted?

0 answers

No answers yet.

Log in to answer this question.