#/bin/bash

for i in `seq 1 22; echo X; echo Y; echo MT`
do
  cat ../TogoVar.vep.out.20210308.chr${i}.tab 			|\
  awk '$1 !~ "#" && $1 ~ "tgv" && $13 ~ "rs"{print $1"\t"$13}' | awk -F'[ ,]' '$3 !~ "COS"{print $1,$2}'
done > tgvid2dbsnp.tsv.tmp

cat tgvid2dbsnp.tsv.tmp | awk '{print $1,$2,$1"_"$2}' | sort -k 3 | uniq | awk '{print $1"\t"$2}' > tgvid2dbsnp.tsv && rm tgvid2dbsnp.tsv.tmp
