input: Write a function to calculate the percent of transcripts mapping to rRNA and MT genes based on the provided HTseq_counts file and GTF file. It should return the percentage of rRNA and MT mapped reads in the output file named "HTseq_counts_file_rRNAmtRNACounts.txt". If either the HTseq_counts file or the GTF file does not exist, it should print an error message and exit. If the function is called with an empty HTseq_counts file, it should return 0% for both rRNA and MT mapped reads.
  assert rRNA_MT_count(GTF_file_exists, HTseq_counts_file_exists)==True
  assert rRNA_MT_count(GTF_file_exists, HTseq_counts_file_not_exists)==False
  assert rRNA_MT_count(GTF_file_not_exists, HTseq_counts_file_exists)==False
  assert rRNA_MT_count(GTF_file_not_exists, HTseq_counts_file_not_exists)==False
  assert rRNA_MT_count(GTF_file_exists, empty_HTseq_counts_file)=='0.0%'
output: 
  def rRNA_MT_count(gtf_file, htseq_counts_file):
      import os
      if not os.path.exists(gtf_file) or not os.path.exists(htseq_counts_file):
          print("Error: One or both of the files do not exist.")
          return False
      
      if os.path.getsize(htseq_counts_file) == 0:
          return '0.0%'
      
      rRNA_genes = set()
      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].split(';')
                  gene_type = [x.strip().split(' ')[1].strip('"') for x in gene_info if 'gene_biotype' in x]
                  if 'rRNA' in gene_type:
                      gene_name = [x.strip().split(' ')[1].strip('"') for x in gene_info if 'gene_name' in x][0]
                      rRNA_genes.add(gene_name)
                  elif 'Mt_tRNA' in gene_type or 'Mt_rRNA' in gene_type:
                      gene_name = [x.strip().split(' ')[1].strip('"') for x in gene_info if 'gene_name' in x][0]
                      MT_genes.add(gene_name)
      
      rRNA_count = 0
      MT_count = 0
      total_count = 0
      
      with open(htseq_counts_file, 'r') as htseq:
          for line in htseq:
              if line.startswith('__'):
                  continue
              gene_name, count = line.strip().split('\t')
              count = int(count)
              total_count += count
              if gene_name in rRNA_genes:
                  rRNA_count += count
              elif gene_name in MT_genes:
                  MT_count += count
      
      if total_count == 0:
          return '0.0%'
      
      rRNA_percentage = (rRNA_count / total_count) * 100
      MT_percentage = (MT_count / total_count) * 100
      combined_percentage = rRNA_percentage + MT_percentage
      
      with open("HTseq_counts_file_rRNAmtRNACounts.txt", 'w') as outfile:
          outfile.write(f"{combined_percentage:.1f}%")
      
      return f"{combined_percentage:.1f}%"
  