input: def calculate_percent_rRNA(htseq_file: str, gtf_file: str) -> str:
      """
      Calculate the percentage of transcripts mapping to rRNA and generate a summary file.
      
      >>> calculate_percent_rRNA("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")
      'C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts_rRNAmtRNACounts.txt'
      """
output:     import re
      from collections import defaultdict
  
      # Read the GTF file to identify rRNA and tRNA features
      rrna_features = set()
      trna_features = 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_type = re.search(r'gene_biotype "([^"]+)"', gene_info)
                  if gene_type:
                      if gene_type.group(1) == 'rRNA':
                          rrna_features.add(re.search(r'gene_id "([^"]+)"', gene_info).group(1))
                      elif gene_type.group(1) == 'tRNA':
                          trna_features.add(re.search(r'gene_id "([^"]+)"', gene_info).group(1))
  
      # Read the htseq file and count rRNA and tRNA reads
      rrna_counts = defaultdict(int)
      trna_counts = defaultdict(int)
      total_counts = 0
      with open(htseq_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_features:
                  rrna_counts[gene_id] += count
              elif gene_id in trna_features:
                  trna_counts[gene_id] += count
  
      # Calculate the percentage of rRNA and tRNA reads
      rrna_total = sum(rrna_counts.values())
      trna_total = sum(trna_counts.values())
      rrna_percentage = (rrna_total / total_counts) * 100 if total_counts > 0 else 0
      trna_percentage = (trna_total / total_counts) * 100 if total_counts > 0 else 0
  
      # Generate the summary file
      output_file = htseq_file.replace('.txt', '_rRNAmtRNACounts.txt')
      with open(output_file, 'w') as out:
          out.write(f"Total rRNA reads: {rrna_total}\n")
          out.write(f"Total tRNA reads: {trna_total}\n")
          out.write(f"Total reads: {total_counts}\n")
          out.write(f"Percentage of rRNA reads: {rrna_percentage:.2f}%\n")
          out.write(f"Percentage of tRNA reads: {trna_percentage:.2f}%\n")
  
      return output_file