input: 
  def calculate_rRNA_MT_percent(HTseq_counts: str, GTF: str) -> str:
      """
      Calculate the percent of transcripts mapping to rRNA and MT for a given HTseq_counts file.
      The script will extract rRNA and MT identifiers from the GTF file, count reads that match
      these identifiers in the HTseq_counts file, and write the results to an output file.
      
      >>> calculate_rRNA_MT_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:     rRNA_ids = set()
      MT_ids = set()
  
      with open(GTF, 'r') as gtf_file:
          for line in gtf_file:
              if line.startswith('#'):
                  continue
              fields = line.strip().split('\t')
              if fields[2] == 'gene':
                  attributes = fields[8]
                  if 'gene_biotype "rRNA"' in attributes:
                      rRNA_ids.add(attributes.split('gene_id "')[1].split('";')[0])
                  elif 'gene_biotype "Mt_rRNA"' in attributes:
                      rRNA_ids.add(attributes.split('gene_id "')[1].split('";')[0])
                  elif 'gene_biotype "Mt_tRNA"' in attributes:
                      MT_ids.add(attributes.split('gene_id "')[1].split('";')[0])
  
      rRNA_count = 0
      MT_count = 0
      total_count = 0
  
      with open(HTseq_counts, 'r') as counts_file:
          for line in counts_file:
              if line.startswith('__'):
                  continue
              gene_id, count = line.strip().split('\t')
              count = int(count)
              total_count += count
              if gene_id in rRNA_ids:
                  rRNA_count += count
              elif gene_id in MT_ids:
                  MT_count += count
  
      rRNA_percent = (rRNA_count / total_count) * 100
      MT_percent = (MT_count / total_count) * 100
  
      output_file_name = HTseq_counts.replace('.txt', '_rRNAmtRNACounts.txt')
      with open(output_file_name, 'w') as output_file:
          output_file.write(f"Total reads: {total_count}\n")
          output_file.write(f"rRNA reads: {rRNA_count} ({rRNA_percent:.2f}%)\n")
          output_file.write(f"MT reads: {MT_count} ({MT_percent:.2f}%)\n")
  
      return f'Summary output file: {output_file_name}'