input: 
  def calculate_rRNA_percent(htseq_file: str, gtf_file: str) -> str:
      """ Calculate the percent of transcripts mapping to rRNA using an HTseq_counts file and a GTF file.
      The script will extract all the identifiers of genes/transcripts mapping to the rRNA and MT genes,
      count reads matching these identifiers, and write the output to a summary 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')
      'C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts.txt_rRNAmtRNACounts.txt'
      """
  
output:     rRNA_ids = set()
      MT_ids = set()
      total_reads = 0
      rRNA_MT_reads = 0
  
      # Extract rRNA and MT gene IDs from GTF file
      with open(gtf_file, 'r') as gtf:
          for line in gtf:
              if not line.startswith('#'):
                  fields = line.strip().split('\t')
                  if fields[2] == 'gene':
                      attributes = fields[8].split(';')
                      gene_id = None
                      gene_type = None
                      for attr in attributes:
                          if 'gene_id' in attr:
                              gene_id = attr.split('"')[1]
                          elif 'gene_type' in attr:
                              gene_type = attr.split('"')[1]
                      if gene_type == 'rRNA':
                          rRNA_ids.add(gene_id)
                      elif gene_type == 'Mt_rRNA' or gene_type == 'Mt_tRNA':
                          MT_ids.add(gene_id)
  
      # Count reads mapping to rRNA and MT genes
      with open(htseq_file, 'r') as htseq:
          for line in htseq:
              if not line.startswith('__'):
                  fields = line.strip().split('\t')
                  gene_id = fields[0]
                  count = int(fields[1])
                  total_reads += count
                  if gene_id in rRNA_ids or gene_id in MT_ids:
                      rRNA_MT_reads += count
  
      # Calculate percent
      percent_rRNA_MT = (rRNA_MT_reads / total_reads) * 100
  
      # Write output to summary file
      output_file = htseq_file + '_rRNAmtRNACounts.txt'
      with open(output_file, 'w') as out:
          out.write(f"Total reads: {total_reads}\n")
          out.write(f"rRNA + MT reads: {rRNA_MT_reads}\n")
          out.write(f"Percent rRNA + MT: {percent_rRNA_MT:.2f}%\n")
  
      return output_file