samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
676 stars 240 forks source link

Set minimum variant frequency for variant calling with bcftools call/view #958

Open kpatankar opened 5 years ago

kpatankar commented 5 years ago

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!!

pd3 commented 5 years ago

I am assuming by "variant frequency" you mean the proportion of reads with the alternate allele? This can be done only as a post-processing step. Run bcftools mpileup -a FORMAT/AD to add allelic depths and then use the -i/-e filtering expression to filter calls with few alternate reads.

Indirectly this can be tweaked by setting different bcftools call --pval-threshold threshold.