#/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" && $5 ~ "ENST"{print $1"\t"$5}' 
done > tgvid2ensembl.transcript.tsv.tmp

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