This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to annotate a vcf file?

I'm trying to annotate variants in a vcf file according to:

  • position
  • variant type

My bcftools command looks something like this:

bcftools annotate -o output_file.vcf -c CHROM,FROM,TO,ALT --annotations annotation_file.bed -k --mark-sites "MY_VARIANT" input_vcf.gz

The problem is bcftools annotate only matches the position of the variant, not the type. Is there a way to make sure that only variants that match the ALT from the bed file are annotated?

bcftools

So I have tried doing that, but, adding in ref throws an error:

Error: the Ref columns will be ignored when BEG,END (or FROM, TO) is present. Replace END (or TO) with "-".

So I update -c CHROM,FROM,-,REF,ALT (so I'm not sure how that changes how TO is used), but it still doesn't match on the ALT. I'm not familiar enough with bcftools to know if that should work (i.e. my problem is elsewhere) or not.

I'm also assuming the ALT should match between the bed file and the vcf file: e.g. <DEL> in the bed file should equal <DEL> in the vcf file

0 answers

No answers yet.

Log in to answer this question.