Merge bam files
0
0
Entering edit mode
5.2 years ago

I already ask a question about this, but I didn't get my answer complete.

Merge bam files and get VCF file

I have 6 bam file that one of them is just 2 Mb and one is 2 Gb. I think the comparison between VCF file of these bam files is not fair, because they don't have equal read. so I want to merge all the reads ( probably bam files) to a single file and then get the VCF file output of this. I want to do following command:

samtools merge file_1.bam file_2.bam ... -o merge.bam
samtools mpileup -f reference.fa merge.bam output.vcf

am I doing right?

SNP samtools bam vcf • 1.3k views
ADD COMMENT
0
Entering edit mode

You should be using bcftools mpileup now as the samtools one is deprecated.

Also note you can specify multiple files directly with mpileup and they'll be merged in-situ as it processes them so there is no need to merge them manually. Eg:

bcftools mpileup -f reference.fa -o output.vcf file_1.bam file2.bam
ADD REPLY

Login before adding your answer.

Traffic: 1733 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