input: Write a function to calculate the percent of transcripts mapping to rRNA and MT genes given an HTseq_counts file and a GTF file. The function should return a tuple containing the percentages of rRNA and MT mapped reads respectively. If the input files are empty or do not exist, the function should return (0, 0).
  assert rRNA_MT_percentage("./sample_data/sample_htseq.txt", "./sample_data/sample_gtf.txt")==(5.34, 2.14)
  assert rRNA_MT_percentage("./nonexistent_file.txt", "./nonexistent_file.txt")==(0, 0)
  assert rRNA_MT_percentage("./sample_data/empty_htseq.txt", "./sample_data/sample_gtf.txt")==(0, 0)
  assert rRNA_MT_percentage("./sample_data/sample_htseq.txt", "./sample_data/empty_gtf.txt")==(0, 0)
output: def rRNA_MT_percentage(htseq_file, gtf_file):
      try:
          with open(gtf_file, 'r') as gtf:
              rRNA_genes = set()
              MT_genes = set()
              for line in gtf:
                  if line.startswith('#'):
                      continue
                  fields = line.split('\t')
                  if fields[2] == 'gene':
                      info = fields[8]
                      if 'gene_biotype "rRNA"' in info:
                          rRNA_genes.add(info.split('gene_id "')[1].split('"')[0])
                      elif 'gene_biotype "Mt_tRNA"' in info or 'gene_biotype "Mt_rRNA"' in info:
                          MT_genes.add(info.split('gene_id "')[1].split('"')[0])
          
          rRNA_count = 0
          MT_count = 0
          total_count = 0
          
          with open(htseq_file, 'r') as htseq:
              for line in htseq:
                  if line.startswith('__'):
                      continue
                  gene_id, count = line.rsplit(maxsplit=1)
                  count = int(count)
                  total_count += count
                  if gene_id in rRNA_genes:
                      rRNA_count += count
                  elif gene_id in MT_genes:
                      MT_count += count
          
          rRNA_percent = (rRNA_count / total_count) * 100 if total_count > 0 else 0
          MT_percent = (MT_count / total_count) * 100 if total_count > 0 else 0
          
          return (round(rRNA_percent, 2), round(MT_percent, 2))
      
      except FileNotFoundError:
          return (0, 0)