FRED-2 / OptiType

Precision HLA typing from next-generation sequencing data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Want to use Optitype HLA results as input file for pVACseq, if someone could provide suggestion?

edceeyuchen opened this issue · comments

commented

This is how I do it but I'm newbie in linux, so any suggestion are welcome.

  1. extract the 2nd row, 2-7 columns of optitype output tsv
  2. add a space in the front
  3. substitute the first space to "HLA-"
  4. substitute the rest sapces to ",HLA-"
  5. remove the ",HLA-" added to the end
echo " $(awk -F'\t' 'NR==2 {for(i=2; i<=7; i++) printf("%s ", $i); printf("\n")}' ${sample}_result.tsv" | 
sed 's/^ /HLA-/; s/ /,HLA-/g; s/,HLA-//6' > ${sample}_hla.txt

Example

cat ${sample}_result.tsv

        A1      A2      B1      B2      C1      C2      Reads   Objective
0       A*02:06 A*32:01 B*48:03 B*40:80 C*07:02 C*14:02 529.0   514.717
1       A*02:06 A*32:01 B*40:01 B*48:01 C*07:02 C*14:02 529.0   514.717
2       A*02:01 A*32:01 B*40:01 B*48:01 C*07:02 C*14:02 528.0   513.744

cat ${sample}_hla.txt

HLA-A*02:06,HLA-A*32:01,HLA-B*48:03,HLA-B*40:80,HLA-C*07:02,HLA-C*14:02

Hope it helps

Thank you very much! I will be try it!