input: 
  def calculate_rRNA_mRNA_percent(htseq_counts_file: str, gtf_file: str) -> str:
      """
      Calculate the percent of transcripts mapping to rRNA and MT genes given an HTseq_counts file and a GTF file.
      The script will produce a summary output file named "<htseq_counts_file>_rRNAmtRNACounts.txt".
      
      >>> calculate_rRNA_mRNA_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_rRNAmtRNACounts.txt'
      """
  
output:     import pandas as pd
      import re
  
      # Read the GTF file and extract rRNA and MT genes
      rRNA_genes = set()
      MT_genes = 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_info = fields[8]
                      gene_id = re.search(r'gene_id "([^"]+)"', gene_info).group(1)
                      gene_type = re.search(r'gene_type "([^"]+)"', gene_info).group(1)
                      if gene_type == 'rRNA':
                          rRNA_genes.add(gene_id)
                      elif gene_type == 'Mt_rRNA' or gene_type == 'Mt_tRNA':
                          MT_genes.add(gene_id)
  
      # Read the HTseq counts file
      counts_df = pd.read_csv(htseq_counts_file, sep='\t', header=None, names=['gene_id', 'count'])
  
      # Calculate the total counts and counts for rRNA and MT genes
      total_counts = counts_df['count'].sum()
      rRNA_counts = counts_df[counts_df['gene_id'].isin(rRNA_genes)]['count'].sum()
      MT_counts = counts_df[counts_df['gene_id'].isin(MT_genes)]['count'].sum()
  
      # Calculate the percentages
      rRNA_percent = (rRNA_counts / total_counts) * 100
      MT_percent = (MT_counts / total_counts) * 100
  
      # Prepare the output file name
      output_file = f"{htseq_counts_file}_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 output_file