input: 
  from typing import List
  
  def calculate_rRNA_percent(htseq_counts_path: str, gtf_path: str) -> str:
      """ Calculates the percent of transcripts mapping to rRNA and MT genes from given HTseq_counts and GTF files.
      It returns the filename of the summary output file containing the counts and percentages.
      
      >>> calculate_rRNA_percent("/path/to/C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts.txt", "/path/to/Mus_musculus.GRCm38.84.gtf")
      "C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts_rRNAmtRNACounts.txt"
      """
      pass # Implementation goes here
  
output:     
      import os
      import re
  
      def read_counts(file_path):
          with open(file_path, 'r') as file:
              counts = {}
              for line in file:
                  gene_id, count = line.strip().split('\t')
                  counts[gene_id] = int(count)
          return counts
  
      def read_gtf(file_path):
          rRNA_genes = set()
          MT_genes = set()
          with open(file_path, 'r') as file:
              for line in file:
                  if not line.startswith('#'):
                      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':
                              rRNA_genes.add(gene_id)
                          elif gene_type == 'Mt_rRNA' or gene_type == 'Mt_tRNA':
                              MT_genes.add(gene_id)
          return rRNA_genes, MT_genes
  
      counts = read_counts(htseq_counts_path)
      rRNA_genes, MT_genes = read_gtf(gtf_path)
  
      total_counts = sum(counts.values())
      rRNA_counts = sum(counts[gene_id] for gene_id in rRNA_genes if gene_id in counts)
      MT_counts = sum(counts[gene_id] for gene_id in MT_genes if gene_id in counts)
  
      rRNA_percent = (rRNA_counts / total_counts) * 100 if total_counts > 0 else 0
      MT_percent = (MT_counts / total_counts) * 100 if total_counts > 0 else 0
  
      output_filename = os.path.splitext(htseq_counts_path)[0] + "_rRNAmtRNACounts.txt"
      with open(output_filename, 'w') as output_file:
          output_file.write(f"Total counts: {total_counts}\n")
          output_file.write(f"rRNA counts: {rRNA_counts} ({rRNA_percent:.2f}%)\n")
          output_file.write(f"MT counts: {MT_counts} ({MT_percent:.2f}%)\n")
  
      return output_filename
  