input: 
  def calculate_rRNA_percent(htseq_counts_file: str, gtf_file: str) -> str:
      """ Calculate the percent of transcripts mapping to rRNA and MT genes from the given HTseq_counts file and GTF file.
      The function will produce an output file named "HTseq_counts_file_rRNAmtRNACounts.txt" containing the summary of the counts and percentages.
      
      >>> calculate_rRNA_percent("C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts.txt", "/path/to/Mus_musculus.GRCm38.84.gtf")
      'HTseq_counts_file_rRNAmtRNACounts.txt'
      """
  
output:     
      rRNA_mtRNA_counts = {}
      total_counts = 0
      
      with open(htseq_counts_file, 'r') as htseq_file:
          for line in htseq_file:
              gene_id, count = line.strip().split('\t')
              count = int(count)
              total_counts += count
              rRNA_mtRNA_counts[gene_id] = count
      
      rRNA_mtRNA_genes = set()
      with open(gtf_file, 'r') as gtf_file:
          for line in gtf_file:
              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:
                      gene_id = re.search(r'gene_id "([^"]+)"', gene_info).group(1)
                      rRNA_mtRNA_genes.add(gene_id)
      
      rRNA_mtRNA_total = sum(rRNA_mtRNA_counts[gene_id] for gene_id in rRNA_mtRNA_genes if gene_id in rRNA_mtRNA_counts)
      rRNA_mtRNA_percent = (rRNA_mtRNA_total / total_counts) * 100
      
      output_file = f"{htseq_counts_file}_rRNAmtRNACounts.txt"
      with open(output_file, 'w') as out_file:
          out_file.write(f"Total counts: {total_counts}\n")
          out_file.write(f"rRNA + mtRNA counts: {rRNA_mtRNA_total}\n")
          out_file.write(f"Percent of transcripts mapping to rRNA + mtRNA: {rRNA_mtRNA_percent:.2f}%\n")
      
      return output_file
  