#/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" && $20 == "EntrezGene"{print $1"\t"$4}' 
done > tgvid2ncbigene.tsv.tmp

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