#!/usr/bin/env perl
use strict;
chomp(my @genes = `cat dlbcl_tiers.tsv bl_tiers.tsv fl_tiers.tsv mcl_tiers.tsv | cut -f 1 | grep -v Gene`);
for my $g (@genes){
  print "$g\n";
  my $o = "$g.html";
  #next if -e $o;
  #unless(-e $o){
    open O, ">$o";
    my $temp = "template.html";
    open T, $temp;
    while(<T>){
      s/GENE_NAME/$g/;
      print O;
    }
    close O;
    close T;
  #}
  my $oa = $g . "_hg38.html";
  open O, ">$oa";
  my $temp = "template_hg38.html";
  open T, $temp;
  while(<T>){
      s/GENE_NAME/$g/;
      print O;
  }
  close O;
  close T;
  my $o2 = $g . "_protein.html";
  open O, ">$o2";
  my $temp = "protein_template.html";
  open T, $temp;
  while(<T>){
      s/GENE_NAME/$g/;
      print O;
  }
  close O;
  close T;
  my $o3 = $g . "_protein_hg38.html";
  open O, ">$o3";
  my $temp = "protein_template_hg38.html";
  open T, $temp;
  while(<T>){
      s/GENE_NAME/$g/;
      print O;
  }
  close O;
  close T;
}
