Fix or remove format tag in .vcf file
1
0
Entering edit mode
4.0 years ago
j.lunger18 ▴ 30

I'm trying to use bcftools merge to merge vcf files, but am getting the following error:

Incorrect number of FORMAT/fb_AD values at chr14:21499293, cannot merge. The tag is defined as Number=R, but found
3 values and 2 alleles.

I'd love to fix this error, but for a quick fix I'm just trying to remove it. I tried:

bcftools annotate merged_final.vcf.gz -x FORMAT/fb_AD

but then got:

[W::vcf_parse_format] FORMAT 'GT_DISAGREE' is not defined in the header, assuming Type=String
[W::vcf_parse_format] FORMAT 'GT_SUPPORT' is not defined in the header, assuming Type=String
Encountered error, cannot proceed. Please check the error output above.

When I tried to grep the "fb_AD" fromt the file, it is still there:

bcftools view -h merged_final.vcf.gz | grep fb_AD
##FORMAT=<ID=fb_AD_presplit,Number=.,Type=Integer,Description="For the caller fb, (Raw value prior to multiallelic split) Number of observation for each allele">
##FORMAT=<ID=fb_AD,Number=R,Type=Integer,Description="For the caller fb, Allele depths, calculated from RO and AO tags.">

Not sure how to proceed.

vcf bcftools samtools • 3.4k views
ADD COMMENT
0
Entering edit mode
4.0 years ago

try to use --force http://samtools.github.io/bcftools/bcftools.html#annotate

 --force
    continue even when parsing errors, such as undefined tags, are encountered. Note this can be an unsafe operation and can result in corrupted BCF files. If this option is used, make sure to sanity check the result thoroughly.

When I tried to grep the "fb_AD" fromt the file, it is still there: bcftools view -h merged_final.vcf.gz | grep fb_AD

you're grep-ping the original file...

ADD COMMENT
0
Entering edit mode

Hmm, was this a removed option?

   bcftools annotate -x FORMAT/fb_AD --force merged_final.vcf.gz > merged_final2.vcf.gz

annotate: unrecognized option '--force'

        About:   Annotate and edit VCF/BCF files.
        Usage:   bcftools annotate [options] <in.vcf.gz>

        Options:
           -a, --annotations <file>       VCF file or tabix-indexed file with annotations: CHR\tPOS[\tVALUE]+
               --collapse <string>        matching records by <snps|indels|both|all|some|none>, see man page for details [some]
           -c, --columns <list>           list of columns in the annotation file, e.g. CHROM,POS,REF,ALT,-,INFO/TAG. See man page for details
           -e, --exclude <expr>           exclude sites for which the expression is true (see man page for details)
           -h, --header-lines <file>      lines which should be appended to the VCF header
           -I, --set-id [+]<format>       set ID column, see man page for details
           -i, --include <expr>           select sites for which the expression is true (see man page for details)
           -k, --keep-sites               leave -i/-e sites unchanged instead of discarding them
           -m, --mark-sites [+-]<tag>     add INFO/tag flag to sites which are ("+") or are not ("-") listed in the -a file
               --no-version               do not append version and command line to the header
           -o, --output <file>            write output to a file [standard output]
           -O, --output-type <b|u|z|v>    b: compressed BCF, u: uncompressed BCF, z: compressed VCF, v: uncompressed VCF [v]
           -r, --regions <region>         restrict to comma-separated list of regions
           -R, --regions-file <file>      restrict to regions listed in a file
               --rename-chrs <file>       rename sequences according to map file: from\tto
           -s, --samples [^]<list>        comma separated list of samples to annotate (or exclude with "^" prefix)
           -S, --samples-file [^]<file>   file of samples to annotate (or exclude with "^" prefix)
           -x, --remove <list>            list of annotations (e.g. ID,INFO/DP,FORMAT/DP,FILTER) to remove (or keep with "^" prefix). See man page for details
               --threads <int>            number of extra output compression threads [0]
ADD REPLY
0
Entering edit mode

Hmm, was this a removed option?

or is your version up-to-date ?

ADD REPLY

Login before adding your answer.

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