This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Adding a simple tag to VCF Info column

Hello everyone! I'm trying to use CNVkit, which uses b-allele frequency to find LoH

For this program, my somatic mutations must be tagged "SOMATIC" in the INFO field.

I have an annotated VCF with my somatic mutations with different tags.

How could I add another flag to my INFO field, after all the tags that are already there?

For example, the header for this new field would be

##INFO=<ID=SOMATIC,Number=0,Type=Flag,Description="Somatic event">

And the value would be

MVSDULK=0,0,0,1,0,0,0;NUM_TOOLS=1;LC=12.4;SOMATIC

My original VCF already had:

MVSDULK=0,0,0,1,0,0,0;NUM_TOOLS=1;LC=12.4

In the INFO field.

Any help is appreciated,

vcf

1 answer

hum.. something like

awk '/^##/ {print;next;} /^#CHROM/ {printf("##INFO=<ID=SOMATIC,Number=0,Type=Flag,Description=\"Somatic event\">\n");print;next;} {OFS="\t";$8=sprintf("%s;SOMATIC",$8);print;}' in.vcf 

?

Im going to try that on a minimal example VCF and give a feedback. Thanks

Log in to answer this question.