input: Write a python function to calculate the percentage of rRNA and MT mapped reads from given HTSEQ counts and GTF data.
  assert calculate_rRNA_MT_percentage('test_files/test_counts.txt', 'test_files/test.gtf') == (20.0, 30.0)
  assert calculate_rRNA_MT_percentage('test_files/another_counts.txt', 'test_files/another.gtf') == (10.5, 25.3)
  assert calculate_rRNA_MT_percentage('test_files/sample_counts.txt', 'test_files/sample.gtf') == (15.0, 40.0)
output: def calculate_rRNA_MT_percentage(counts_file, gtf_file):
      def parse_gtf(gtf_file):
          gene_types = {}
          with open(gtf_file, 'r') as gtf:
              for line in gtf:
                  if line.startswith('#'):
                      continue
                  fields = line.strip().split('\t')
                  if fields[2] == 'gene':
                      info = fields[8]
                      gene_id = None
                      gene_type = None
                      for entry in info.split(';'):
                          entry = entry.strip()
                          if entry.startswith('gene_id'):
                              gene_id = entry.split(' ')[1].replace('"', '')
                          elif entry.startswith('gene_biotype'):
                              gene_type = entry.split(' ')[1].replace('"', '')
                      if gene_id and gene_type:
                          gene_types[gene_id] = gene_type
          return gene_types
      
      def parse_counts(counts_file):
          counts = {}
          with open(counts_file, 'r') as counts_f:
              for line in counts_f:
                  if line.startswith('__'):
                      continue
                  gene_id, count = line.strip().split('\t')
                  counts[gene_id] = int(count)
          return counts
      
      gene_types = parse_gtf(gtf_file)
      counts = parse_counts(counts_file)
      
      total_reads = sum(counts.values())
      rRNA_reads = sum(count for gene_id, count in counts.items() if gene_types.get(gene_id) == 'rRNA')
      mt_reads = sum(count for gene_id, count in counts.items() if gene_types.get(gene_id) == 'MT')
      
      rRNA_percentage = (rRNA_reads / total_reads) * 100 if total_reads > 0 else 0
      mt_percentage = (mt_reads / total_reads) * 100 if total_reads > 0 else 0
      
      return round(rRNA_percentage, 1), round(mt_percentage, 1)