This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Annotating indels and SNVs

I have a vcf and bed file with around 17 million SNPs, indels, and SNVs. SNPs are annotated and have rsID, however, indels and SNVs don't have ID and appear as '.' I need all of them for my analyses, therefore I can't exclude any.

Is there any way to annotate indels and SNVs in a way to make them have provisional rsIDs? I already managed to rename bed file to contain something like baseposition_refallele_alt_allele as a variant ID, however, the software I am using (BFMAP, SLEMM) recognizes only rsIDs.

What can I do?

annotation indels snv

1 answer

gunzip -c in.vcf.gz | awk -F '\t' '/^#/ {print;next;} {OFS="\t";$3=sprintf("rs%d",NR);print;}'

Thank you Pierre! It works!

Log in to answer this question.