Dear all
I have two vcf files I wish to concatenate, but they have different INFO tags. I would like to match the data in the two files by deleting the extra info in one of them.
I have tried "bcftools annotate", but I found it returns only the header, without the data. I have also read "Remove columns from the VCF file using vcftools" which is very promising...
awk -v OFS="\t" '!/##/ {$1=$2=$3=$4="";print}' test.vcf|sed 's/^\s\+//g'
Along the lines of this bash order, I wonder whether is it possible to discard specific INFO columns (lets say INFO/RPBZ, INFO/MQBZ and INFO/BQBZ) and the corresponding header lines. Does OFS admit more than one separator at once? If I could use OFS="\t" plus OFS=";", the above bash line could be easily modified to select the precise columns. In that case, how do I match the correct header lines?
Thanks in advance.
Pablo
Ooops.. Eventually I realized there is no need for a complex OFS and it can be accomplish with OFS=";". Sorry to bother your time.
Pablo
this is useless, bcftools annotate already removes INFO from the header and from the variants.
Sorry Pierre... If that is ok with other users, fine. I double checked my "bcftools annotate infile" had the header and the variants but the outfile had only the header. Pablo
remove 'INFO/VDB', the header INFO ID=VDB was removed. there is no line containing VDB but a reminder of the bcftools annotate command.
check the variant at 970 is still here but INFO/VDB was removed.
Thank you Pierre. I'll look forward my mistake(s).
Should I close the question? I have not found the right place to do it
There is no need to close the question. If @Pierre's answer below helped you can accept that (green checkmark) that provides closure to this thread. Do not delete the thread.
Thanks to everybody sharing knowledge!!