Merge bam files
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?
• 1,588 views
•
link
0 answers
No answers yet.
Log in to answer this question.
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: