#/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 ~ "NM_"{print $1"\t"$5}' | awk -F'[ .]' '{print $1"\t"$2}'
done > tgvid2refseqmRNA.tsv.tmp

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