Question: bcftools filter by ALT == '.'
0
gravatar for rightmirem
16 months ago by
rightmirem60
rightmirem60 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!

ADD COMMENTlink modified 16 months ago by Pierre Lindenbaum120k • written 16 months ago by rightmirem60
2
gravatar for Pierre Lindenbaum
16 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum120k 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 16 months ago by Pierre Lindenbaum120k

Worked brilliantly. Thanks!

ADD REPLYlink written 16 months ago by rightmirem60
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: 1937 users visited in the last hour