input: 
  from typing import List
  
  def calculate_rrna_percentage(htseq_counts_file: str, gtf_file: str) -> float:
      """ Calculate the percentage of transcripts mapping to rRNA in the given HTseq_counts file.
      This function requires two inputs: an HTseq_counts file and a GTF file.
      It extracts all the identifiers of genes/transcripts mapping to rRNA and MT genes,
      counts the reads matching these identifiers, and calculates the percentage of 
      transcripts mapping to rRNA. The summary output file will be named 
      "HTseq_counts_file_rRNAmtRNACounts.txt".
      
      >>> calculate_rrna_percentage('/path/to/HTseq_counts/file', '/path/to/GTF/file')
      15.3
      >>> calculate_rrna_percentage('/path/to/another/HTseq_counts/file', '/path/to/another/GTF/file')
      12.7
      """
      # Function implementation would go here
      pass
  
output:     
      import re
      from collections import defaultdict
  
      # Read GTF file and extract rRNA and MT genes
      rrna_mt_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]
                  gene_id = re.search(r'gene_id "([^"]+)"', gene_info).group(1)
                  gene_type = re.search(r'gene_biotype "([^"]+)"', gene_info).group(1)
                  if gene_type == 'rRNA' or gene_type == 'Mt_rRNA' or gene_type == 'Mt_tRNA':
                      rrna_mt_genes.add(gene_id)
  
      # Read HTseq_counts file and count reads mapping to rRNA and MT genes
      rrna_mt_counts = defaultdict(int)
      total_reads = 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_mt_genes:
                  rrna_mt_counts[gene_id] += count
  
      # Calculate the percentage of reads mapping to rRNA and MT genes
      rrna_mt_total_reads = sum(rrna_mt_counts.values())
      rrna_percentage = (rrna_mt_total_reads / total_reads) * 100
  
      # Write the summary output file
      output_file = htseq_counts_file + '_rRNAmtRNACounts.txt'
      with open(output_file, 'w') as out:
          out.write(f"Total reads: {total_reads}\n")
          out.write(f"Reads mapping to rRNA and MT genes: {rrna_mt_total_reads}\n")
          out.write(f"Percentage of reads mapping to rRNA and MT genes: {rrna_percentage:.1f}%\n")
  
      return rrna_percentage
  