Question: bcftools filter by ALT == '.'
1
gravatar for rightmirem
2.4 years ago by
rightmirem70
rightmirem70 wrote:

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!

sequencing snp sequence next-gen • 1.6k views
ADD COMMENTlink modified 2.4 years ago by Pierre Lindenbaum128k • written 2.4 years ago by rightmirem70
2
gravatar for Pierre Lindenbaum
2.4 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum128k wrote:

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 COMMENTlink written 2.4 years ago by Pierre Lindenbaum128k

Worked brilliantly. Thanks!

ADD REPLYlink written 2.4 years ago by rightmirem70
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1147 users visited in the last hour