input: Write a function that calculates the percentage of transcripts mapping to rRNA and MT genes from an HTseq_counts file using a GTF file. The function should return a summary output file named "HTseq_counts_file_rRNAmtRNACounts.txt". Provide the function header, usage example, and test cases.
  
  assert rRNA_MT_percentage("C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts.txt", "Mus_musculus.GRCm38.84.gtf") == "C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts_rRNAmtRNACounts.txt"
  assert rRNA_MT_percentage("sample1_htseq.txt", "sample_gtf.gtf") == "sample1_htseq_rRNAmtRNACounts.txt"
  assert rRNA_MT_percentage("test_counts.txt", "test_gtf.gtf") == "test_counts_rRNAmtRNACounts.txt"
  assert rRNA_MT_percentage("empty_counts.txt", "empty_gtf.gtf") == "empty_counts_rRNAmtRNACounts.txt"
output: def rRNA_MT_percentage(htseq_counts_file, gtf_file):
      rRNA_mtRNA_counts = 0
      total_counts = 0
      rRNA_mtRNA_genes = set()
  
      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 or 'gene_biotype "Mt_rRNA"' in gene_info or 'gene_biotype "Mt_tRNA"' in gene_info:
                      gene_id = gene_info.split('gene_id "')[1].split('"')[0]
                      rRNA_mtRNA_genes.add(gene_id)
  
      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_counts += count
              if gene_id in rRNA_mtRNA_genes:
                  rRNA_mtRNA_counts += count
  
      percentage = (rRNA_mtRNA_counts / total_counts) * 100 if total_counts > 0 else 0
  
      output_file = htseq_counts_file.replace('.txt', '_rRNAmtRNACounts.txt')
      with open(output_file, 'w') as out:
          out.write(f"rRNA and MT gene counts: {rRNA_mtRNA_counts}\n")
          out.write(f"Total counts: {total_counts}\n")
          out.write(f"Percentage of rRNA and MT gene counts: {percentage:.2f}%\n")
  
      return output_file