How to annotate a vcf file?
0
0
Entering edit mode
12 months ago
conorproud89 ▴ 20

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 • 738 views
ADD COMMENT
0
Entering edit mode

https://samtools.github.io/bcftools/bcftools.html

When REF and ALT are present, only matching VCF records will be annotated.

REF is missing.

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

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