SNP calling with SAMtools on multiple samples
2
0
Entering edit mode
3.3 years ago

Hello.

I found similar questions here, but couldnt find exactly what I am searching for.

I have several (+180) .bam files, each from a different sample. I will proceed to SNP calling with SAMtools/bcftools. I need to obtain a single .vcf file with all my samples on it. Should I merge all my .bam files and do the SNP calling once, or should I do the SNP calling for each sample and then merge all the .vcf files?

SNP samtools vcf bam • 3.6k views
2
Entering edit mode
3.3 years ago

you call all the bams with one call of bcftools mpileup https://samtools.github.io/bcftools/bcftools.html#mpileup

 -b, --bam-list FILE
List of input alignment files, one file per line [null]

0
Entering edit mode

Thanks! This will output a single .vcf file, with all the samples?

0
Entering edit mode

Thanks! This will output a single .vcf file, with all the samples?

yes.

0
Entering edit mode
3.2 years ago
Begali • 0

Hi @Pierre Lindenbaum

how if I merged all bam files in one single bam that containll samples with their RG tag, then call varaints with samtools and bcftools

0
Entering edit mode

You don't need to change anything, just feed it the merged bam. From the bcftools docs:

"Individuals are identified from the SM tags in the @RG header lines. Multiple individuals can be pooled in one alignment file, also one individual can be separated into multiple files. If sample identifiers are absent, each input file is regarded as one sample."