input: 
  def calculate_percent_rRNA_transcripts(htseq_counts_file: str, gtf_file: str) -> str:
      """ Calculate the percent of transcripts mapping to rRNA using the provided HTseq_counts file and GTF file.
      >>> calculate_percent_rRNA_transcripts('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')
      'Summary output file: C17_3_S20_Aligned.out.srt.bam_htseq_combined_counts_rRNAmtRNACounts.txt'
      """
  
      import os, sys
      from optparse import OptionParser
      import re
  
      parser = OptionParser(usage="%prog [-x Excel [-i imagefile] [-s squares]", version="%prog 0.1")
      parser.add_option("--htseq", dest="FileName", type="string", action="store")
      parser.add_option("--gtf", dest="GTF", type="string", action="store")
      (options, args) = parser.parse_args()
  
      HTSEQ_COUNTS = htseq_counts_file
      GTF = gtf_file
  
      try:
          handle = open(GTF, "rU")
          handle.close()
      except:
          print("\nError->\tGTF File: %s does not exist\n" % GTF)
          sys.exit()
  
      try:
          handle = open(HTSEQ_COUNTS, "rU")
          handle.close()
      except:
          print("\nError->\tFile: %s does not exist\n" % HTSEQ_COUNTS)
          sys.exit()
  
      rRNA_identifiers = {}
      MT_identifiers = {}
  
      with open(GTF, "rU") as handle:
          for line in handle:
              line.rstrip('\n')
              if 'gene_biotype "rRNA"' in line:
                  identifier = line
                  identifier = re.sub('.*gene_id "', '', identifier)
                  identifier = re.sub('"; gene_version.*\n', '', identifier)
                  rRNA_identifiers[identifier] = 1
              if 'MT' in line:
                  identifier = line
                  identifier = re.sub('.*gene_id "', '', identifier)
                  identifier = re.sub('"; gene_version.*\n', '', identifier)
                  MT_identifiers[identifier] = 1    
      handle.close()    
  
      Cummulative_rRNA_Count = 0
      rRNA_genes = 0
      ReadCount = 0
      line_number = 0
      MT_genes = 0;
      Cummulative_MT_Count = 0;
  
      with open(HTSEQ_COUNTS, "rU") as handle:
          for line in handle:
              line.rstrip('\n')            
  
              split_line = line.split("\t")
              if line_number > 0:
                  if split_line[0] in rRNA_identifiers.keys():
                      rRNA_genes += 1
                      Cummulative_rRNA_Count += int(split_line[1])
                  if split_line[0] in MT_identifiers.keys():
                      MT_genes += 1
                      Cummulative_MT_Count += int(split_line[1])
                  ReadCount += int(split_line[1])
              line_number += 1
      handle.close()    
  
      out = HTSEQ_COUNTS + '_rRNAmtRNACounts.txt'; 
      out = re.sub('.txt_', '_', out)
  
      print("Summary output file:		", out, "\n")
  
      OUT = open(out, "w")
      OUT.write('HT-SEQ file name: \t' + HTSEQ_COUNTS + '\n\n')
      OUT.write('GTF file name: \t\t' + GTF + '\n\n\n')
      OUT.write('---------------------------------------------------------------------------------' + '\n')
      OUT.write('  rRNA and MT identifiers\n')
      OUT.write('---------------------------------------------------------------------------------' + '\n')
      OUT.write('No. of rRNA identifiers: ' + str(len(rRNA_identifiers.keys())) + '\n')
      OUT.write('No. of MT identifiers: ' + str(len(MT_identifiers.keys())) + '\n')
      OUT.write('\n\n')
      OUT.write('---------------------------------------------------------------------------------' + '\n')
      OUT.write('  HTSEQ mapping summary\n')
      OUT.write('---------------------------------------------------------------------------------' + '\n')
      OUT.write('ReadCount: ' + str(ReadCount) + '\n\n')
      OUT.write('Total no. of rRNA transcripts: ' + str(Cummulative_rRNA_Count) + '\n')
      perc_rRNA = 100*float(Cummulative_rRNA_Count)/float(ReadCount)
      perc_rRNA = str(round(perc_rRNA, 3))
      OUT.write('Percent rRNA mapped reads: ' + str(Cummulative_rRNA_Count) + ' / ' + str(ReadCount) + ' * 100 = ' + perc_rRNA + '%\n\n')
      OUT.write('Total no. of MT transcripts: ' + str(Cummulative_MT_Count) + '\n')
      perc_MT = 100*float(Cummulative_MT_Count)/float(ReadCount)
      perc_MT = str(round(perc_MT, 3))
      OUT.write('Percent MT mapped reads: ' + str(Cummulative_MT_Count) + ' / ' + str(ReadCount) + ' * 100 = ' + perc_MT + '%\n\n')
      OUT.close()
  
      return "Summary output file: " + out
  
output:     return "Summary output file: " + out