input: def calculate_rRNA_percent(htseq_file: str, gtf_file: str) -> str:
      """Calculate the percent of transcripts mapping to rRNA and MT genes from given HTseq_counts file and GTF file.
      >>> calculate_rRNA_percent('C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts.txt', '/Users/malwina/Documents/CTR-Data/genomes/Mus_musculus/mm10/Mus_musculus.GRCm38.84.gtf')
      'Summary output file:        C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts_rRNAmtRNACounts.txt'
      """
output:     import re
      from collections import defaultdict
  
      # Read the GTF file and extract gene_biotype information
      gene_biotypes = defaultdict(set)
      with open(gtf_file, 'r') as gtf:
          for line in gtf:
              if not line.startswith('#'):
                  fields = line.strip().split('\t')
                  if fields[2] == 'gene':
                      gene_id = re.search(r'gene_id "([^"]+)"', fields[8]).group(1)
                      gene_biotype = re.search(r'gene_biotype "([^"]+)"', fields[8]).group(1)
                      gene_biotypes[gene_id].add(gene_biotype)
  
      # Read the HTseq_counts file and calculate counts for rRNA and MT genes
      rrna_counts = 0
      mt_counts = 0
      total_counts = 0
      with open(htseq_file, 'r') as htseq:
          for line in htseq:
              if not line.startswith('__'):
                  gene_id, count = line.strip().split('\t')
                  count = int(count)
                  total_counts += count
                  if 'rRNA' in gene_biotypes.get(gene_id, set()):
                      rrna_counts += count
                  if 'Mt_rRNA' in gene_biotypes.get(gene_id, set()):
                      mt_counts += count
  
      # Calculate the percentage
      rrna_percent = (rrna_counts / total_counts) * 100
      mt_percent = (mt_counts / total_counts) * 100
  
      # Create the summary output file name
      output_file = htseq_file.replace('.txt', '_rRNAmtRNACounts.txt')
  
      # Write the summary to the output file
      with open(output_file, 'w') as out:
          out.write(f"Total counts: {total_counts}\n")
          out.write(f"rRNA counts: {rrna_counts} ({rrna_percent:.2f}%)\n")
          out.write(f"MT counts: {mt_counts} ({mt_percent:.2f}%)\n")
  
      return f'Summary output file: {output_file}'