This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Set minimum variant frequency while calling variants with samtools

Hi All,

Currently I am using following command to call variants using samtools/bcftools.

samtools mpileup -d 1000000 -L 1000000 -uf ref.fasta sample.sorted.bam | bcftools view -vcg  - > sample.SAMtools.vcf

What I want is to report the variants present at and above 1% variant frequency in the vcf file. I looked into both mpileup, bcftools view, and bcftools call manual but could not find any parameter to set variant frequency.

This option is available in freebayes (-F 0.01) and VarScan (--min-var-freq 0.01).

How can I set these parameters for samtools and know what default parameters are used?

Thanks!!

samtools resequencing alignment variant frequency

1 answer

You can filter your VCF file as it is being produced with bcf filter

Hi Istvan,

I tried the following command but it does not seem to work.

 samtools mpileup -d 1000000 -L 1000000 -uf ref.fasta Sample.sorted.bam | bcftools view -vcg -i 'MAF[*] >= 0.5'  - > Sample.SAMtools_VF50.vcf

This should give me the variants present at > 50 % frequency but all variants are reported even those which are less than 50%.

Can you please give me an example of the bcf filter command which you mentioned?

Log in to answer this question.