def corewriter(self):
        printtime('Creating core allele files', self.start)
        for gene in sorted(self.genesequence):
            self.geneset.add(gene)
            genefile = os.path.join(self.coregenelocation, '{}.fasta'.format(gene))
            if not os.path.isfile(genefile):
                with open(genefile, 'w') as core:
                    for count, sequence in enumerate(self.genesequence[gene]):
                        definitionline = '{}-{}'.format(gene, count + 1)
                        fasta = SeqRecord(Seq(sequence),
                                          description='',
                                          id=definitionline)
                        SeqIO.write(fasta, core, 'fasta')
                        for strain in self.coresequence[sequence]:
                            try:
                                self.corealleles[strain[:-6]].update({gene: count + 1})
                            except KeyError:
                                self.corealleles[strain[:-6]] = {gene: count + 1}
            else:
                for count, sequence in enumerate(self.genesequence[gene]):
                    for strain in self.coresequence[sequence]:
                        try:
                            self.corealleles[strain[:-6]].update({gene: count + 1})
                        except KeyError:
                            self.corealleles[strain[:-6]] = {gene: count + 1}
        if not os.path.isfile(os.path.join(self.coregenelocation, 'core_combined.fasta')):
            fastafiles = glob(os.path.join(self.coregenelocation, '*.fasta'))
            self.combinealleles(fastafiles)
        self.profiler()