input: 
  def calculate_percent_rrna(htseq_counts_file: str, gtf_file: str) -> str:
      """Calculate the percent of transcripts mapping to rRNA and MT genes from HTseq counts and GTF files.
      The script will generate a summary output file named "HTseq_counts_file_rRNAmtRNACounts.txt" containing the counts and percentages.
      
      >>> 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:     
      rrna_mt_genes = 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]
                  if 'gene_biotype "rRNA"' in gene_info or 'gene_biotype "Mt_rRNA"' in gene_info or 'gene_biotype "Mt_tRNA"' in gene_info:
                      gene_id = gene_info.split('gene_id "')[1].split('";')[0]
                      rrna_mt_genes.add(gene_id)
      
      total_counts = 0
      rrna_mt_counts = 0
      with open(htseq_counts_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_mt_genes:
                  rrna_mt_counts += count
      
      percent_rrna_mt = (rrna_mt_counts / total_counts) * 100
      
      output_file = htseq_counts_file.replace('.txt', '_rRNAmtRNACounts.txt')
      with open(output_file, 'w') as out:
          out.write(f"Total counts: {total_counts}\n")
          out.write(f"rRNA and MT counts: {rrna_mt_counts}\n")
          out.write(f"Percent rRNA and MT: {percent_rrna_mt:.2f}%\n")
      
      return output_file
  