input: Write a function to calculate the percent of transcripts mapping to rRNA. The function should accept two inputs: an HTseq_counts file and a GTF file. 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".
  
  def calculate_rRNA_percent(htseq_file, gtf_file):
      # Implement the logic here
      
      return output_file
  
  assert calculate_rRNA_percent('C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts.txt', '/path/to/GTF/file') == 'C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts_rRNAmtRNACounts.txt'
  assert calculate_rRNA_percent('another_file.txt', '/path/to/another/GTF/file') == 'another_file_rRNAmtRNACounts.txt'
  assert calculate_rRNA_percent('empty.txt', '/path/to/empty/GTF/file') == 'empty_rRNAmtRNACounts.txt'
  assert calculate_rRNA_percent('nonexistent.txt', '/path/to/nonexistent/GTF/file') == 'FileNotFoundError'
  assert calculate_rRNA_percent('existing.txt', 'nonexistent_gtf_file') == 'FileNotFoundError'
output: def calculate_rRNA_percent(htseq_file, gtf_file):
      try:
          with open(gtf_file, 'r') as gtf:
              rRNA_ids = set()
              mtRNA_ids = set()
              for line in gtf:
                  if 'rRNA' in line:
                      rRNA_ids.add(line.split('\t')[8].split(';')[0].split()[1].strip('"'))
                  if 'MT' in line:
                      mtRNA_ids.add(line.split('\t')[8].split(';')[0].split()[1].strip('"'))
          
          rRNA_counts = 0
          total_counts = 0
          with open(htseq_file, 'r') as htseq:
              for line in htseq:
                  gene_id, count = line.strip().split('\t')
                  total_counts += int(count)
                  if gene_id in rRNA_ids:
                      rRNA_counts += int(count)
          
          output_file = htseq_file.replace('.txt', '_rRNAmtRNACounts.txt')
          with open(output_file, 'w') as out:
              out.write(f"rRNA_counts\t{rRNA_counts}\n")
              out.write(f"total_counts\t{total_counts}\n")
              out.write(f"rRNA_percent\t{(rRNA_counts / total_counts) * 100 if total_counts != 0 else 0}\n")
          
          return output_file
      except FileNotFoundError:
          return 'FileNotFoundError'