I have 2 sorted Bam files and I want to merge them and get a VCF file from them using samtools pileup.
first i merge these 2 files with samtools merge
and then I get a VCF file as output.
samtools mpileup genome.fa merged-bam.bam output.vcf
then I use
samtools mpileup genome.fa 1.bam 2.bam output.vcf
but the output of these 2 approach had different size. where am I doing wrong?
thanks a lot
I have read the link you shared, I didn't understand it properly. how should my bam file header be to use the second approach?
i you have defined read-groups, for each sample, there should be no difference event if you merge the bam.