code: def profiler(self):
          
          printtime('Calculating core profiles', self.start)
          # Only create the profile if it doesn't exist already
          # if not os.path.isfile('{}/profile.txt'.format(self.profilelocation)):
          for strain in self.corealleles:
              # Add the gene name and allele number pair for each core gene in each strain
              self.coreset.add(tuple(sorted(self.corealleles[strain].items())))
          # Set the header to be similar to an MLST profile - ST,gene1,gene2,etc
          header = 'ST,{}\n'.format(','.join(sorted(self.geneset)))
          data = ''
          for count, core in sorted(enumerate(self.coreset)):
              # Increment count now to account for 0-based numbering
              count += 1
              # Add the sequence type number to the profile
              data += '{}'.format(count)
              # Store the sequence type for each strain
              for strain in self.corealleles:
                  if tuple(sorted(self.corealleles[strain].items())) == core:
                      self.profiles[strain] = count
              # Add the allele number for each gene
              for gene in sorted(core):
                  data += ',{}'.format(gene[1])
              data += '\n'
          # Write the profile
          with open(os.path.join(self.profilelocation, 'profile.txt'), 'w') as profile:
              profile.write(header)
              profile.write(data)
          # Create a list of which strains correspond to the sequence types
          self.linker()
docs: Calculates the core profile for each strain