input: 
  def calculate_rRNA_MT_percent(htseq_counts_file: str, gtf_file: str) -> str:
      """ Calculate the percent of transcripts mapping to rRNA and MT genes from given HTseq_counts file and GTF file.
      The script will extract all the identifiers of genes/transcripts mapping to the rRNA and MT genes and count reads matching these identifiers.
      The summary output file will be named based on the input HTseq_counts file with '_rRNAmtRNACounts.txt' appended.
      >>> calculate_rRNA_MT_percent('/path/to/HTseq_counts/file', '/path/to/GTF/file')
      'Summary output file: /path/to/HTseq_counts/file_rRNAmtRNACounts.txt'
      """
  
output:     
      rRNA_MT_ids = 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':
                  attributes = fields[8].split(';')
                  gene_id = None
                  gene_type = None
                  for attr in attributes:
                      if 'gene_id' in attr:
                          gene_id = attr.split()[1].strip('"')
                      elif 'gene_type' in attr:
                          gene_type = attr.split()[1].strip('"')
                  if gene_type in ['rRNA', 'Mt_rRNA', 'Mt_tRNA']:
                      rRNA_MT_ids.add(gene_id)
  
      total_reads = 0
      rRNA_MT_reads = 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_reads += count
              if gene_id in rRNA_MT_ids:
                  rRNA_MT_reads += count
  
      percent = (rRNA_MT_reads / total_reads) * 100
      output_file = htseq_counts_file + '_rRNAmtRNACounts.txt'
      with open(output_file, 'w') as out:
          out.write(f'Total reads: {total_reads}\n')
          out.write(f'rRNA and MT reads: {rRNA_MT_reads}\n')
          out.write(f'Percent of reads mapping to rRNA and MT genes: {percent:.2f}%\n')
  
      return f'Summary output file: {output_file}'
  