input: 
  from typing import List
  
  
  def calculate_percent_rRNA(gtf_path: str, htseq_path: str) -> str:
      """ Calculate the percent of transcripts mapping to rRNA. This function requires 
      an HTseq_counts file and an original reference transcriptome aligned to. It will 
      extract all the identifiers of genes/transcripts mapping to the rRNA and MT genes 
      and store them in two arrays. Then, it will count reads matching the rRNA identifiers 
      and write the output files. The summary output file will be named 
      "HTseq_counts_file_rRNAmtRNACounts.txt".
      
      >>> calculate_percent_rRNA('Mus_musculus.GRCm38.84.gtf', 'C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts.txt')
      'C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts_rRNAmtRNACounts.txt'
      >>> calculate_percent_rRNA('Mus_musculus.GRCm38.83.gtf', 'C18_1_S21_Aligned.out.srt.bam_htseq_combined_counts.txt')
      'C18_1_S21_Aligned.out.srt.bam_htseq_combined_counts_rRNAmtRNACounts.txt'
      """
  
output:     
      rRNA_ids = []
      mtRNA_ids = []
  
      with open(gtf_path, '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].split(';')
                  gene_id = None
                  gene_biotype = None
                  for attr in attributes:
                      if 'gene_id' in attr:
                          gene_id = attr.split()[1].strip('"')
                      elif 'gene_biotype' in attr:
                          gene_biotype = attr.split()[1].strip('"')
                  if gene_biotype == 'rRNA':
                      rRNA_ids.append(gene_id)
                  elif gene_biotype == 'Mt_rRNA':
                      mtRNA_ids.append(gene_id)
  
      rRNA_counts = 0
      total_counts = 0
  
      with open(htseq_path, 'r') as htseq_file:
          for line in htseq_file:
              if line.startswith('__'):
                  continue
              fields = line.strip().split('\t')
              gene_id = fields[0]
              count = int(fields[1])
              total_counts += count
              if gene_id in rRNA_ids or gene_id in mtRNA_ids:
                  rRNA_counts += count
  
      percent_rRNA = (rRNA_counts / total_counts) * 100
  
      output_file_name = htseq_path.replace('.txt', '_rRNAmtRNACounts.txt')
      with open(output_file_name, 'w') as output_file:
          output_file.write(f"Total counts: {total_counts}\n")
          output_file.write(f"rRNA counts: {rRNA_counts}\n")
          output_file.write(f"Percent rRNA: {percent_rRNA:.2f}%\n")
  
      return output_file_name
  