input: Write a function to calculate the percentage of transcripts mapping to rRNA and MT based on provided HTseq_counts and GTF files. The function should return a string with the percentage of rRNA and MT transcripts relative to the total count of reads. If any of the input files is missing or cannot be accessed, the function should return "Error".
  assert calculate_rRNA_MT_percentage("/path/to/HTseq/file", "/path/to/GTF/file") == "Percent rRNA mapped reads: x.xx%, Percent MT mapped reads: y.yy%"
  assert calculate_rRNA_MT_percentage("", "/path/to/GTF/file") == "Error"
  assert calculate_rRNA_MT_percentage("/path/to/HTseq/file", "") == "Error"
  assert calculate_rRNA_MT_percentage("", "") == "Error"
  assert calculate_rRNA_MT_percentage("/invalid/path/HTseq/file", "/invalid/path/GTF/file") == "Error"
output: def calculate_rRNA_MT_percentage(htseq_file, gtf_file):
      try:
          if not htseq_file or not gtf_file:
              return "Error"
          
          with open(gtf_file, 'r') as gtf:
              rRNA_features = set()
              MT_features = set()
              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][0]
                      gene_id = [x.strip().split()[1].strip('"') for x in gene_info if 'gene_id' in x][0]
                      if gene_type == 'rRNA':
                          rRNA_features.add(gene_id)
                      elif gene_type == 'Mt_tRNA' or gene_type == 'Mt_rRNA':
                          MT_features.add(gene_id)
          
          rRNA_count = 0
          MT_count = 0
          total_count = 0
          
          with open(htseq_file, 'r') as htseq:
              for line in htseq:
                  if line.startswith('__'):
                      continue
                  gene_id, count = line.strip().split('\t')
                  count = int(count)
                  total_count += count
                  if gene_id in rRNA_features:
                      rRNA_count += count
                  elif gene_id in MT_features:
                      MT_count += count
          
          rRNA_percentage = (rRNA_count / total_count) * 100
          MT_percentage = (MT_count / total_count) * 100
          
          return f"Percent rRNA mapped reads: {rRNA_percentage:.2f}%, Percent MT mapped reads: {MT_percentage:.2f}%"
      
      except Exception:
          return "Error"