input: from typing import List, Tuple
  
  
  def calculate_rrna_percent(htseq_counts: str, gtf_file: str) -> Tuple[int, int, float, float]:
      """
      Calculates the percentage of transcripts mapping to rRNA and MT genes from HTseq counts and GTF file.
  
      Parameters:
      htseq_counts (str): Path to the HTseq counts file.
      gtf_file (str): Path to the GTF file.
  
      Returns:
      Tuple[int, int, float, float]: A tuple containing the total number of rRNA transcripts, 
      total number of MT transcripts, percentage of rRNA mapped reads, and percentage of MT mapped reads.
  
      Example:
      >>> calculate_rrna_percent('C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts.txt', '/Users/malwina/Documents/CTR-Data/genomes/Mus_musculus/mm10/Mus_musculus.GRCm38.84.gtf')
      (2500, 1200, 12.5, 6.0)
      """
output:     
      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':
                  attributes = fields[8].split(';')
                  gene_name = None
                  gene_type = None
                  for attr in attributes:
                      if 'gene_name' in attr:
                          gene_name = attr.split('"')[1]
                      elif 'gene_biotype' in attr:
                          gene_type = attr.split('"')[1]
                  if gene_type == 'rRNA':
                      rrna_genes.add(gene_name)
                  elif gene_type == 'Mt_rRNA':
                      mt_genes.add(gene_name)
  
      total_rrna_count = 0
      total_mt_count = 0
      total_reads = 0
  
      with open(htseq_counts, 'r') as htseq:
          for line in htseq:
              if line.startswith('__'):
                  continue
              gene_id, count = line.strip().split('\t')
              count = int(count)
              total_reads += count
              if gene_id in rrna_genes:
                  total_rrna_count += count
              elif gene_id in mt_genes:
                  total_mt_count += count
  
      rrna_percent = (total_rrna_count / total_reads) * 100
      mt_percent = (total_mt_count / total_reads) * 100
  
      return total_rrna_count, total_mt_count, rrna_percent, mt_percent
  