input: Write a function to calculate the percentage of transcripts mapping to rRNA and MT genes based on an HTseq_counts file and a GTF file. The function should take two input arguments: the path to the HTseq_counts file and the path to the GTF file. It should return a summary output file named "HTseq_counts_file_rRNAmtRNACounts.txt" containing the total number of rRNA and MT transcripts, the total read count, and the percentage of reads mapped to rRNA and MT genes. If the input files do not exist, the function should print an error message and exit the program.
  
  
  assert calculate_rRNA_MT_percentage('./example_files/HTseq_counts.txt', './example_files/GTF.gtf') == None
  assert calculate_rRNA_MT_percentage('./example_files/non_existent_file.txt', './example_files/GTF.gtf') == "\nError->\tFile: ./example_files/non_existent_file.txt does not exist\n"
  assert calculate_rRNA_MT_percentage('./example_files/HTseq_counts.txt', './example_files/non_existent_file.gtf') == "\nError->\tGTF File: ./example_files/non_existent_file.gtf does not exist\n"
  
output: 
  def calculate_rRNA_MT_percentage(htseq_counts_file, gtf_file):
      import os
      if not os.path.exists(htseq_counts_file):
          print(f"\nError->\tFile: {htseq_counts_file} does not exist\n")
          return
      if not os.path.exists(gtf_file):
          print(f"\nError->\tGTF File: {gtf_file} does not exist\n")
          return
      
      rRNA_genes = set()
      MT_genes = set()
      total_reads = 0
      rRNA_MT_reads = 0
      
      with open(gtf_file, 'r') as gtf:
          for line in gtf:
              if line.startswith('#'):
                  continue
              fields = line.strip().split('\t')
              if fields[2] == 'gene':
                  gene_info = fields[8]
                  if 'gene_biotype "rRNA"' in gene_info:
                      rRNA_genes.add(gene_info.split('gene_id "')[1].split('"')[0])
                  elif 'gene_biotype "Mt_rRNA"' in gene_info or 'gene_biotype "Mt_tRNA"' in gene_info:
                      MT_genes.add(gene_info.split('gene_id "')[1].split('"')[0])
      
      with open(htseq_counts_file, 'r') as htseq:
          for line in htseq:
              if line.startswith('__'):
                  continue
              gene_id, count = line.strip().split('\t')
              count = int(count)
              total_reads += count
              if gene_id in rRNA_genes or gene_id in MT_genes:
                  rRNA_MT_reads += count
      
      percentage = (rRNA_MT_reads / total_reads) * 100 if total_reads > 0 else 0
      
      output_file = f"{htseq_counts_file}_rRNAmtRNACounts.txt"
      with open(output_file, 'w') as out:
          out.write(f"Total rRNA and MT transcripts: {len(rRNA_genes) + len(MT_genes)}\n")
          out.write(f"Total read count: {total_reads}\n")
          out.write(f"Percentage of reads mapped to rRNA and MT genes: {percentage:.2f}%\n")
  