input: Write a function to calculate the percent of transcripts mapping to rRNA given an HTseq_counts file and an original reference transcriptome aligned to a GTF file. The function should return a dictionary containing the total number of rRNA and MT transcripts, the percentage of rRNA and MT mapped reads, and the summary output file name. If the input files do not exist, the function should raise an error.
  assert calculate_rRNA_percentage("/path/to/HTseq_counts/file", "/path/to/GTF/file") == {
      "total_rRNA_transcripts": 1000,
      "total_MT_transcripts": 50,
      "percent_rRNA_mapped": 20.0,
      "percent_MT_mapped": 1.0,
      "summary_output_file": "HTseq_counts_file_rRNAmtRNACounts.txt"
  }
  assert calculate_rRNA_percentage("/nonexistent/HTseq_counts/file", "/path/to/GTF/file") == "Error - HTseq_counts file does not exist"
  assert calculate_rRNA_percentage("/path/to/HTseq_counts/file", "/nonexistent/GTF/file") == "Error - GTF file does not exist"
output: 
  def calculate_rRNA_percentage(htseq_counts_file, gtf_file):
      import os
      if not os.path.exists(htseq_counts_file):
          raise FileNotFoundError("Error - HTseq_counts file does not exist")
      if not os.path.exists(gtf_file):
          raise FileNotFoundError("Error - GTF file does not exist")
      
      total_reads = 0
      rRNA_reads = 0
      MT_reads = 0
      
      with open(htseq_counts_file, 'r') as f:
          for line in f:
              if line.startswith('__'):
                  continue
              transcript, count = line.strip().split('\t')
              count = int(count)
              total_reads += count
              if 'rRNA' in transcript:
                  rRNA_reads += count
              if 'MT' in transcript:
                  MT_reads += count
      
      percent_rRNA_mapped = (rRNA_reads / total_reads) * 100 if total_reads > 0 else 0
      percent_MT_mapped = (MT_reads / total_reads) * 100 if total_reads > 0 else 0
      
      summary_output_file = os.path.basename(htseq_counts_file).replace('.txt', '_rRNAmtRNACounts.txt')
      
      return {
          "total_rRNA_transcripts": rRNA_reads,
          "total_MT_transcripts": MT_reads,
          "percent_rRNA_mapped": percent_rRNA_mapped,
          "percent_MT_mapped": percent_MT_mapped,
          "summary_output_file": summary_output_file
      }
  