input: Write a function to calculate the percentage of transcripts mapping to rRNA from an HTseq_counts file and a GTF file. The function should return a tuple with the total number of rRNA transcripts, the total number of MT transcripts, and the percentage of reads mapped to rRNA. If either file does not exist, the function should print an error message and exit.
  assert calculate_rRNA_percentage("/path/to/GTF/file", "/path/to/HTseq_counts/file")==(Cummulative_rRNA_Count, Cummulative_MT_Count, perc_rRNA)
  assert calculate_rRNA_percentage("nonexistent.gtf", "/path/to/HTseq_counts/file")=="\nError->\tGTF File: nonexistent.gtf does not exist\n"
  assert calculate_rRNA_percentage("/path/to/GTF/file", "nonexistent.htseq")=="\nError->\tFile: nonexistent.htseq does not exist\n"
output: import os
  
  def calculate_rRNA_percentage(gtf_file, htseq_counts_file):
      if not os.path.exists(gtf_file):
          print(f"\nError->\tGTF File: {gtf_file} does not exist\n")
          exit()
      if not os.path.exists(htseq_counts_file):
          print(f"\nError->\tFile: {htseq_counts_file} does not exist\n")
          exit()
      
      rRNA_count = 0
      MT_count = 0
      total_reads = 0
      
      with open(gtf_file, 'r') as gtf:
          rRNA_ids = set()
          for line in gtf:
              if line.startswith('#'):
                  continue
              fields = line.strip().split('\t')
              if fields[2] == 'transcript' and 'rRNA' in fields[8]:
                  rRNA_ids.add(fields[8].split(';')[0].split()[1].strip('"'))
              elif fields[2] == 'transcript' and 'MT' in fields[8]:
                  MT_count += 1
      
      with open(htseq_counts_file, 'r') as htseq:
          for line in htseq:
              if line.startswith('__'):
                  continue
              transcript_id, count = line.strip().split('\t')
              count = int(count)
              total_reads += count
              if transcript_id in rRNA_ids:
                  rRNA_count += count
      
      perc_rRNA = (rRNA_count / total_reads) * 100 if total_reads > 0 else 0
      
      return (rRNA_count, MT_count, perc_rRNA)