bcftools to remove non-variants sites
1
0
Entering edit mode
3.6 years ago
shiy05 ▴ 30

Dear all,

I am used to using vcftools to remove non-variants sites. The command I used: vcftools --vcf input.vcf --mac 1 --recode --out input.mac

However, I cannot find the same command in bcftools.

I tried bcftools view -m2 -M2 -v snps input.vcf

and bcftools view --min-ac=1 input.vcf

All these commands keep more variants then I need, for example, the snp with all alternative genotypes 1/1.

However, I am able to get correct results using below command:

bcftools view --min-ac=1 -Q 0.9999 input.vcf

Any better suggestions?

bctools SNP filter vcf vcftools • 4.2k views
ADD COMMENT
4
Entering edit mode
3.6 years ago
shiy05 ▴ 30

I find out my answer:

bcftools view -c 1 -c 1:nonmajor test.vcf
#or
bcftools view -i "MAC >=1" test.vcf  #make sure you have only biallelic sites
#or
bcftools filter -e "MAC == 0" test.vcf #make sure you have only biallelic sites

However, if your %INFO tags is wrong, bcftools will produce error results.

ADD COMMENT

Login before adding your answer.

Traffic: 2020 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6