Hi all,
I need to add lines to an existing VCF, corresponding to positions where I know for certain that information is missing, according to a BED file. That is, I would like to modify said VCF with additional records bearing an "./." genotype in every position that is contained in a BED file. Bcftools consensus has a somewhat similar option called "--mask", but unfortunately it only applies to the generation of FASTA files.
I could of course create a script that goes through the VCF and adds rows in those coordinates, but it would be convenient if there are any tools out there that can do this for me. Or at least if there is a more efficient way to approach this problem.
Thanks in advance.
Hi, thanks for the prompt response. However, what I need -I will edit the original post to make it clear- is to add these lines to an existing VCF file. Although it is probably not the most efficient option, I can take your solution and merge the resulting file (concat.vcf) with the original file (let's say existing.vcf), after removing any repeated positions from existing.vcf (since I want them to be listed as ./. only).
use bedtools to remove thoses positions from the bed file.
But I want those positions to have genotype "./.", which is not the case in the original VCF file. I don't expect this to happen often (or at all), but in case of any overlap, the shared lines have to be N.