This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to merge different BAM files?

Hello dears all,

I have some BAM files from different samples which they have been mapped to the genome reference using bowtie2. Actually now I want to merge these bam files so that the out put will be a single .bam file. I will be so grateful if you can help me in this purpose.

Regards,

Omid

snp next-gen alignment bam samtools

1 answer

Did you google "merge bam files"? I see a samtools solution and a picardtools solution, can you explain why those don't work for you?

Yes I did, but just was not sure if it is completely fit with my purpose or not. If we use the option -h, then only one header will be in the final output?

Regards,

Omid

Well, why don't you try one to see how it works?

Sorry for the late reply. Yes apparently by that option one header will come in the output's header.

Log in to answer this question.