bcftools filter by ALT == '.'
1
1
Entering edit mode
6.4 years ago
rightmirem ▴ 70

I have a large vcf.gz file for 70 samples. It contains many positions where all 70 samples match the reference. I'd like to filter those lines out.

I tried:

bcftools filter -e '%ALT == .' ./SIDXXX.vcf.gz

but it came back with ...

[filter.c:1741 filters_init1] Error: the tag "INFO/%ALT" is not defined in the VCF header

Thanks!

snp next-gen sequencing sequence SNP • 4.6k views
ADD COMMENT
2
Entering edit mode
6.4 years ago

try to use the variable N_ALT see https://samtools.github.io/bcftools/bcftools.html (with N_ALT==0)

variables calculated on the fly if not present: number of alternate alleles; number of samples; count of alternate alleles; minor allele count (similar to AC but is always smaller than 0.5); frequency of alternate alleles (AF=AC/AN); frequency of minor alleles (MAF=MAC/AN); number of alleles in called genotypes; number of samples with missing genotype; fraction of samples with missing genotype

N_ALT, N_SAMPLES, AC, MAC, AF, MAF, AN, N_MISSING, F_MISSING

ADD COMMENT
0
Entering edit mode

Worked brilliantly. Thanks!

ADD REPLY

Login before adding your answer.

Traffic: 3080 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